Thanks for the link. I've read through this thread several times and it seems as if there is no hope of using my current installation of GlassFish with the embedded shell.jar. My application at this point is a simple jar file containing my JPA entities with a persistence.xml file. While I did make my TestCase a @Stateless JEB, my project is not and EJB project, nor is in contained within an EAR project, so it seems that there is little change that my installation of GlassFish 3.0.1 will allow me to deploy my project to it without the proper packaging structure. So it appears the only way to make things work is with the use of the glassfish-embedded-all.jar.
So I updated the META-INF/MANIFEST.MF file within the glassfish-embedded-all.jar as Marina suggested, by adding the following to the MANIFEST.MF file:
Bundle-SymbolicName: org.glassfish.embedded.all
and I tried once again to launch my JUnit Test. The container seems to load, although it does take it quite a long time, but it throws an exception after loading:
INFO: Created virtual server __asadmin
Jun 21, 2010 9:32:17 AM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules
INFO: Virtual server server loaded system default web module
Jun 21, 2010 9:32:26 AM org.glassfish.api.ActionReport failure
SEVERE: Exception while invoking class com.sun.enterprise.web.WebDeployer prepare method
java.lang.NullPointerException
at com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:567)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:264)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:79)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:131)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:129)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:197)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:206)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:232)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:129)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at com.intraxinc.survey.persistence.test.AppTest.setUpClass(AppTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Jun 21, 2010 9:32:26 AM org.glassfish.javaee.full.deployment.EarDeployer prepareBundle
The last line seems to indicate that it is attempting to perform an Ear bundle on the project:
org.glassfish.javaee.full.deployment.EarDeployer prepareBundle
but fails with a NullPointerException. But this confuses me because the first line of the stack trace indicates that it is looking for MetaData from the WebDeployer.
com.sun.enterprise.web.WebDeployer.loadMetaData(WebDeployer.java:107)
Wither way, I don't have an Ear project and I don't have a Web Project. So I'm rather stuck at this point as to where to go and how I can get this to work. The embedded glassfish server seemed like a great idea and I was very hopeful at integrating this into our projects, especially since I just managed to convice the company to switch from JBoss to GlassFish, but now I've lost so much time with this integration and things still don't work, that people are beginning to question the decision.
Any suggestions as to how to make this work are desperately needed and greatly appreciated.
Thanks...
[Message sent by forum member 'fericit_bostan']
http://forums.java.net/jive/thread.jspa?messageID=475181