title: Glassfish Exception during Deployment: Failure while processing glassfish-resources.xml(s) in the archive
body: <p>I'm new to Glassfish and I already discovered that Glassfish 4.1.1 (and I guess 4.1) had a bug. I got around that after a google search and I updated to Glassfish 4.1.2. Now, I'm getting the following exception and stack trace when I deploy my application:</p>
  
  <pre><code>Severe:   Exception while deploying the app [DHWear-1.0]
  Severe:   Exception during lifecycle processing
  org.glassfish.deployment.common.DeploymentException: Failue while processing glassfish-resources.xml(s) in the archive  -- E:\Program Files\glassfish4\glassfish\domains\randomlogic\applications\DHWear-1.0\DHWweb-1.0_war\WEB-INF\lib\DHWbean-1.0.jarMETA-INF\glassfish-resources.xml (The system cannot find the path specified)
  at org.glassfish.resources.admin.cli.ResourcesXMLParser.initProperties(ResourcesXMLParser.java:284)
  at org.glassfish.resources.admin.cli.ResourcesXMLParser.&lt;init&gt;(ResourcesXMLParser.java:151)
  at org.glassfish.resources.module.ResourcesDeployer.processArchive(ResourcesDeployer.java:274)
  at org.glassfish.resources.module.ResourcesDeployer.processResources(ResourcesDeployer.java:766)
  at org.glassfish.resources.module.ResourcesDeployer.event(ResourcesDeployer.java:715)
  at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:419)
  at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
  at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:360)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:360)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
  at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
  at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
  at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
  at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
  at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
  at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
  at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
  at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
  at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
  at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
  at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
  at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
  at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
  at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
  at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
  at java.lang.Thread.run(Thread.java:748)
  
  Severe:   Exception while deploying the app [DHWear-1.0] : Failue while processing glassfish-resources.xml(s) in the archive  -- E:\Program Files\glassfish4\glassfish\domains\randomlogic\applications\DHWear-1.0\DHWweb-1.0_war\WEB-INF\lib\DHWbean-1.0.jarMETA-INF\glassfish-resources.xml (The system cannot find the path specified)
  </code></pre>
  
  <p>This exception occurs whether I deploy using NetBeans 8.2 or I use the Glassfish web administration console.</p>
  
  <p>This error is meaningless to me and the path it shows:</p>
  
  <pre><code>E:\Program Files\glassfish4\glassfish\domains\randomlogic\applications\DHWear-1.0\DHWweb-1.0_war\WEB-INF\lib\DHWbean-1.0.jarMETA-INF\glassfish-resources.xml
  </code></pre>
  
  <p>looks odd to me. This portion:</p>
  
  <pre><code>\DHWbean-1.0.jarMETA-INF\
  </code></pre>
  
  <p>appears as if something was parsed incorrectly. It seems to me it should be:</p>
  
  <pre><code>\DHWbean-1.0.jar\META-INF\
  </code></pre>
  
  <p>Looking into the archive, I see that the path</p>
  
  <pre><code>\DHWear-1.0\DHWweb-1.0_war\WEB-INF\lib\DHWbean-1.0.jar\META-INF\glassfish-resources.xml
  </code></pre>
  
  <p>does exist.</p>
  
  <p>Regardless, has anyone come across this, and if so how do I fix it?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found that deploying the WAR file did not show this error and revealed that NetBeans was not configuring the Glassfish JDBC resources at all (apparently an open bug - funny that it works with a Tomcat server). I added the resources manually to the server to fix that problem, but the EAR still would not work.</p>
  
  <p>I removed the <code>glassfish-resources.xml</code>files from my three persistent unit modules and combined the contents into one <code>glassfish-resources.xml</code> file with application scope. This solved the problem with the EAR, but now when I deploy either the EAR or WAR, I am getting:</p>
  
  <pre><code>Severe:   Exception while preparing the app
  java.lang.NullPointerException
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.preInitializeCanonicalMetamodel(EntityManagerSetupImpl.java:3777)
  at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:381)
  at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:313)
  </code></pre>
  
  <p>I have no clue as to why.</p>