Hi everybody
I am trying to get a simple test project (one jpa2 entity and one ejb) running on the latest builds (b19 as we speak).
I initialize the container like this:
---
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(EJBContainer.MODULES, new File("target/classes"));
properties.put("org.glassfish.ejb.embedded.glassfish.instance.root", "./src/test/glassfish");
properties.put(EJBContainer.APP_NAME, "myapp");
container = EJBContainer.createEJBContainer(properties);
---
And ./src/test/glassfish contains config/ which contains domain.xml. This structure worked with 3.0. The domain.xml is copied from a 3.1 installation.
The first problem I encounter is this error message:
13.sep.2010 14:14:50 com.sun.enterprise.v3.services.impl.LogManagerService postConstruct
WARNING: C:\Dev\workspace-admin\simple\gfembed2376540396315183300tmp\config\logging.properties not found, creating new file from template.
FAILED CONFIGURATION: @BeforeSuite setUp
javax.ejb.EJBException: No EJBContainer provider available
Provider named org.glassfish.ejb.embedded.EJBContainerProviderImpl threw unexpected exception at create EJBContainer:
java.lang.RuntimeException
java.lang.RuntimeException: java.lang.RuntimeException: org.jvnet.hk2.component.ComponentException: problem initializing: null
at org.glassfish.api.embedded.Server.<init>(Server.java:290)
at org.glassfish.api.embedded.Server.<init>(Server.java:68)
at org.glassfish.api.embedded.Server$Builder.build(Server.java:178)
at org.glassfish.api.embedded.Server$Builder.build(Server.java:160)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.init(EJBContainerProviderImpl.java:163)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:120)
at no.evote.SimpleServiceTest.setUp(SimpleServiceTest.java:50)
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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:640)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:503)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:193)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:123)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:258)
at org.testng.SuiteRunner.run(SuiteRunner.java:221)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:40)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:83)
at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:151)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: org.jvnet.hk2.component.ComponentException: problem initializing: null
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at org.glassfish.api.embedded.Server.<init>(Server.java:270)
... 23 more
I have tried putting logging.properties all around the workspace without that changing anything. However, after looking at the source I managed to get around it by specifying:
System.setProperty("java.util.logging.config.file", "C:\\logging.properties");
Now I get a different exception:
SEVERE: Unable to start v3. Closing all ports
org.jvnet.hk2.component.UnsatisfiedDependencyException: Unsatisfied dependency exception : org.glassfish.admin.rest.RestService org.glassfish.admin.rest.RestAdapter.restService
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:157)
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:86)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:105)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:92)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:136)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:66)
at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:687)
at java.util.AbstractList$Itr.next(AbstractList.java:345)
at com.sun.enterprise.v3.services.impl.GrizzlyService.registerNetworkProxy(GrizzlyService.java:492)
at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:390)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:109)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:92)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:136)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:66)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:239)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:131)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:75)
at org.glassfish.api.embedded.Server.<init>(Server.java:270)
at org.glassfish.api.embedded.Server.<init>(Server.java:68)
at org.glassfish.api.embedded.Server$Builder.build(Server.java:178)
at org.glassfish.api.embedded.Server$Builder.build(Server.java:160)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.init(EJBContainerProviderImpl.java:163)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:122)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:120)
at no.evote.SimpleServiceTest.setUp(SimpleServiceTest.java:50)
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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:640)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:503)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:193)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:123)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:258)
at org.testng.SuiteRunner.run(SuiteRunner.java:221)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:40)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:83)
at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:151)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jvnet.hk2.component.UnsatisfiedDependencyException: Unsatisfied dependency exception : org.glassfish.admin.rest.RestService org.glassfish.admin.rest.RestAdapter.restService
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:152)
... 42 more
And this is where I'm at. Any suggestions? Is embedded even supposed to work in the latest builds?
Regards,
Anders
[Message sent by forum member 'andersaab']
http://forums.java.net/jive/thread.jspa?messageID=482514