0

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:

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.<init>(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)

This exception occurs whether I deploy using NetBeans 8.2 or I use the Glassfish web administration console.

This error is meaningless to me and the path it shows:

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

looks odd to me. This portion:

\DHWbean-1.0.jarMETA-INF\

appears as if something was parsed incorrectly. It seems to me it should be:

\DHWbean-1.0.jar\META-INF\

Looking into the archive, I see that the path

\DHWear-1.0\DHWweb-1.0_war\WEB-INF\lib\DHWbean-1.0.jar\META-INF\glassfish-resources.xml

does exist.

Regardless, has anyone come across this, and if so how do I fix it?

UPDATE

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.

I removed the glassfish-resources.xmlfiles from my three persistent unit modules and combined the contents into one glassfish-resources.xml file with application scope. This solved the problem with the EAR, but now when I deploy either the EAR or WAR, I am getting:

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)

I have no clue as to why.

Paul Allen
  • 11
  • 1
  • 6

1 Answers1

0

As it turns out, the answer is that for various reasons Glassfish may not correctly connect to a data source. The reasons may vary due to network connection lost to the DB server, authentication failure, etc. The result is a meaningless exception instead of a clear message stating that there is some problem with the data source. I consider this a bug in either Eclipselink as, at the very least, it should not throw an exception without giving some kind of a clue as to why, or ideally stating specifically what happened.

Paul Allen
  • 11
  • 1
  • 6