{"id":462,"date":"2022-08-30T15:01:45","date_gmt":"2022-08-30T15:01:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/error-in-testing-restful-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:01:45","modified_gmt":"2022-08-30T15:01:45","slug":"error-in-testing-restful-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/error-in-testing-restful-collection-of-common-programming-errors\/","title":{"rendered":"error in testing restful-Collection of common programming errors"},"content":{"rendered":"<p>what is the error at this project i am using netbeans 7.0.1<\/p>\n<pre><code>Error occurred during deployment: Exception while deploying the app [WebApplication] : org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 30; Deployment descriptor file WEB-INF\/web.xml in archive [web].  cvc-complex-type.2.4.a: Invalid content was found starting with element 'persistence-context-ref'. One of '{\"http:\/\/java.sun.com\/xml\/ns\/j2ee\":description, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":display-name, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":icon, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":distributable, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":context-param, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":filter, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":filter-mapping, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":listener, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":servlet, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":servlet-mapping, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":session-config, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":mime-mapping, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":welcome-file-list, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":error-page, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":jsp-config, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":security-constraint, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":login-config, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":security-role, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":env-entry, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":ejb-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":ejb-local-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":service-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":resource-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":resource-env-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":message-destination-ref, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":message-destination, \"http:\/\/java.sun.com\/xml\/ns\/j2ee\":locale-encoding-mapping-list}' is expected.. Please see server.log for more details.\n    C:\\Users\\win-7\\Desktop\\WebApplication\\nbproject\\build-impl.xml:727: \n    The module has not been deployed.\n        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)\n        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)\n        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)\n        at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n        at java.lang.reflect.Method.invoke(Method.java:601)\n        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)\n        at org.apache.tools.ant.Task.perform(Task.java:348)\n        at org.apache.tools.ant.Target.execute(Target.java:390)\n        at org.apache.tools.ant.Target.performTasks(Target.java:411)\n        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)\n        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)\n        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)\n        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)\n        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)\n        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)\n        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)\n    BUILD FAILED (total time: 2 seconds)\n<\/code><\/pre>\n<p>web.xml<\/p>\n<pre><code> \n\n     \n         Generated servlet for Java ME Client to Web Application \n         Javon service for  MyPackage.WebToMobileServlet\n         WebToMobileServlet\n         MyPackage.WebToMobileServlet\n     \n     \n         ServletAdaptor\n         com.sun.jersey.spi.container.servlet.ServletContainer\n         1\n     \n     \n         WebToMobileServlet\n        \/servlet\/MyPackage.WebToMobileServlet\n     \n     \n         ServletAdaptor\n         \/resources\/*\n     \n     \n         \n             30\n         \n     \n     \n         index.jsp\n      \n      \n        persistence\/WebApplicationPU\n        WebApplicationPU\n      \n     \n         UserTransaction\n         javax.transaction.UserTransaction\n         Container \n      \n\n<\/code><\/pre>\n<ol>\n<li>\n<p>Your web.xml file is malformed, can you post it here?<\/p>\n<p>The elemnet <strong>persistence-context-ref<\/strong> belongs to Java EE 5. Your web.xml should be using http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd schema not http:\/\/java.sun.com\/xml\/ns\/j2ee\/web-app_2_4.xsd<\/p>\n<p>Changing only this will not fix the problem, your project was created for 1.4 spec and that tag is for Java EE 5 spec.<\/p>\n<p>Recreate the project with the correct spec version or don&#8217;t use that tag.<\/p>\n<p>The header of the web.xml file must look like this:<\/p>\n<pre><code>xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\"  \nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" version=\"2.5\"  \nxsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee  \n    http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd\"\n<\/code><\/pre>\n<\/li>\n<li>\n<p>It looks like your web.xml is malformed or out of order. Can you post it here and maybe we can eyeball the problem?<\/p>\n<p>The web.xml is located in a directory called WEB-INF<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:43:51. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>what is the error at this project i am using netbeans 7.0.1 Error occurred during deployment: Exception while deploying the app [WebApplication] : org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 30; Deployment descriptor file WEB-INF\/web.xml in archive [web]. cvc-complex-type.2.4.a: Invalid content was found starting with element &#8216;persistence-context-ref&#8217;. One of &#8216;{&#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:description, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:display-name, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:icon, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:distributable, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:context-param, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:filter, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:filter-mapping, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:listener, &#8220;http:\/\/java.sun.com\/xml\/ns\/j2ee&#8221;:servlet, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}