how to adjust classpath - version 3.1.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

how to adjust classpath - version 3.1.2

Yu, Xiaohui
Hi,
 
I've downloaded version 3.1.2 to use for testing within Eclipse/MyEclipse. I copied a few jar files to my build classpath and I don't have any more ClassNotFound errors. However, I'm getting Out of Space error when running junit and it appears maybe openejb is trying to load too many ClientModules (my guess).
 
I tried multiple regexp but so far nothing worked for me. Essentially I only want to load my customized EJBModule, and nothing else. Something similar to the following:
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");

p.put("openejb.deployments.classpath.include", ".*DataServiceEJB/classes.*");

p.put("openejb.deployments.classpath.exclude", ".*");

What should be the proper way to configure?

Thanks,

- John

Reply | Threaded
Open this post in threaded view
|

Re: how to adjust classpath - version 3.1.2

dblevins
Administrator

On Oct 14, 2010, at 9:31 AM, Yu, Xiaohui wrote:

> Hi,
>
> I've downloaded version 3.1.2 to use for testing within Eclipse/MyEclipse. I copied a few jar files to my build classpath and I don't have any more ClassNotFound errors. However, I'm getting Out of Space error when running junit and it appears maybe openejb is trying to load too many ClientModules (my guess).
>
> I tried multiple regexp but so far nothing worked for me. Essentially I only want to load my customized EJBModule, and nothing else. Something similar to the following:
> p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
>
> p.put("openejb.deployments.classpath.include", ".*DataServiceEJB/classes.*");
>
> p.put("openejb.deployments.classpath.exclude", ".*");
>
> What should be the proper way to configure?

The above should be good.  I'm not familiar with what exception you mention.  Is it possible you can post the log output and exception?


-David

Reply | Threaded
Open this post in threaded view
|

RE: how to adjust classpath - version 3.1.2

Yu, Xiaohui
David,
 
I guess I wrote too quick. It should be OutOfMemory: java heap space.
 
After I removed weblogic related libs from classpath for Junit, it did run. However, I thought the include/exclude could take care of that no matter what other libraries I might have.
 
Thanks,
- John
 
== output info ==
Apache OpenEJB 3.1.2 build: 20091010-03:11

http://openejb.apache.org/

INFO - openejb.home = C:\DEV\DataServices30\DataServiceEJB

INFO - openejb.base = C:\DEV\DataServices30\DataServiceEJB

INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)

INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)

INFO - Using 'openejb.deployments.classpath.include=.*DataServiceEJB/classes/.*'

INFO - Using 'openejb.deployments.classpath.exclude=.*'

INFO - Found EjbModule in classpath: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Beginning load: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Beginning load: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Beginning load: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Beginning load: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Configuring enterprise application: classpath.ear

FATAL - OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.

java.lang.OutOfMemoryError: Java heap space

at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:71)

at java.util.zip.ZipFile$1.<init>(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)

at java.util.jar.JarFile.getInputStream(JarFile.java:383)

at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:144)

at java.net.URL.openStream(URL.java:1009)

at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:726)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:113)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:315)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:261)

at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:188)

at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)

at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)

at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

javax.naming.NamingException: Attempted to load OpenEJB. OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space [Root exception is org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space]

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:55)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

at javax.naming.InitialContext.init(InitialContext.java:223)

at javax.naming.InitialContext.<init>(InitialContext.java:197)

at com.onstar.asd.dataservices.businessservices.junit.SubscriberBusinessServiceTest.setUp(SubscriberBusinessServiceTest.java:57)

at junit.framework.TestCase.runBare(TestCase.java:128)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:120)

at junit.framework.TestSuite.runTest(TestSuite.java:230)

at junit.framework.TestSuite.run(TestSuite.java:225)

at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)

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)

Caused by: org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

... 19 more

Caused by: java.lang.OutOfMemoryError: Java heap space

at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:71)

at java.util.zip.ZipFile$1.<init>(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)

at java.util.jar.JarFile.getInputStream(JarFile.java:383)

at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:144)

at java.net.URL.openStream(URL.java:1009)

at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:726)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:113)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:315)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:261)

at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:188)

at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)

at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)

at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)


________________________________

From: David Blevins [mailto:[hidden email]]
Sent: Thu 10/14/2010 6:11 PM
To: [hidden email]
Subject: Re: how to adjust classpath - version 3.1.2




On Oct 14, 2010, at 9:31 AM, Yu, Xiaohui wrote:

> Hi,
>
> I've downloaded version 3.1.2 to use for testing within Eclipse/MyEclipse. I copied a few jar files to my build classpath and I don't have any more ClassNotFound errors. However, I'm getting Out of Space error when running junit and it appears maybe openejb is trying to load too many ClientModules (my guess).
>
> I tried multiple regexp but so far nothing worked for me. Essentially I only want to load my customized EJBModule, and nothing else. Something similar to the following:
> p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
>
> p.put("openejb.deployments.classpath.include", ".*DataServiceEJB/classes.*");
>
> p.put("openejb.deployments.classpath.exclude", ".*");
>
> What should be the proper way to configure?
The above should be good.  I'm not familiar with what exception you mention.  Is it possible you can post the log output and exception?


-David



Reply | Threaded
Open this post in threaded view
|

RE: how to adjust classpath - version 3.1.2

Yu, Xiaohui
Was anyone able to see if the log openejb generated is normal according to the include/exclude I configured? I'm concerned about all this loadings. I started to get OOM again with slightly newer code base.
 
Here's the new output:
Apache OpenEJB 3.1.2 build: 20091010-03:11

http://openejb.apache.org/

INFO - openejb.home = C:\DEV\DataServices30\DataServiceEJB

INFO - openejb.base = C:\DEV\DataServices30\DataServiceEJB

INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)

INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)

INFO - Using 'openejb.deployments.classpath.include=.*DataServiceEJB/classes/.*'

INFO - Using 'openejb.deployments.classpath.exclude=.*'

INFO - Found EjbModule in classpath: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Beginning load: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Beginning load: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Beginning load: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Beginning load: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Configuring enterprise application: classpath.ear

FATAL - OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.

java.lang.OutOfMemoryError: Java heap space

at org.apache.xbean.asm.ClassReader.a(Unknown Source)

at org.apache.xbean.asm.ClassReader.<init>(Unknown Source)

at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:728)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:113)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:315)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:261)

at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:188)

at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)

at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)

at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

at javax.naming.InitialContext.init(InitialContext.java:223)

at javax.naming.InitialContext.<init>(InitialContext.java:197)

at com.onstar.asd.dataservices.businessservices.junit.SubscriberBusinessServiceTest.setUp(SubscriberBusinessServiceTest.java:29)

at junit.framework.TestCase.runBare(TestCase.java:128)

at junit.framework.TestResult$1.protect(TestResult.java:106)

 
Thanks,
- John

________________________________

From: Yu, Xiaohui [mailto:[hidden email]]
Sent: Fri 10/15/2010 10:56 AM
To: [hidden email]
Subject: RE: how to adjust classpath - version 3.1.2



David,

I guess I wrote too quick. It should be OutOfMemory: java heap space.

After I removed weblogic related libs from classpath for Junit, it did run. However, I thought the include/exclude could take care of that no matter what other libraries I might have.

Thanks,
- John

== output info ==
Apache OpenEJB 3.1.2 build: 20091010-03:11

http://openejb.apache.org/

INFO - openejb.home = C:\DEV\DataServices30\DataServiceEJB

INFO - openejb.base = C:\DEV\DataServices30\DataServiceEJB

INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)

INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)

INFO - Using 'openejb.deployments.classpath.include=.*DataServiceEJB/classes/.*'

INFO - Using 'openejb.deployments.classpath.exclude=.*'

INFO - Found EjbModule in classpath: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Found ClientModule in classpath: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Found ClientModule in classpath: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Found ClientModule in classpath: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Found ClientModule in classpath: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Beginning load: C:\DEV\DataServices30\DataServiceEJB\classes

INFO - Beginning load: C:\bea103\modules\com.bea.core.kodo_1.0.0.0_4-2-0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.openjpa_2.2.0.0_1-1-0.jar

INFO - Beginning load: C:\bea103\modules\monfox.dsnmp.agent_1.0.0.0_4-6-5.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-launcher.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\weblogic.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxb.xjc_2.1.6.jar

INFO - Beginning load: C:\bea103\modules\glassfish.jaxws.tools_1.0.0.0_2-1-3.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\ojdbc6.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\common\lib\pdev.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\freemarker.jar

INFO - Beginning load: C:\DEV\DataServices30\DataService\lib\javassist.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\xml-resolver-1.2.jar

INFO - Beginning load: C:\Tools\openejb-3.1.2\lib\serializer-2.7.1.jar

INFO - Beginning load: C:\bea103\wlserver_10.3\server\lib\jconn2.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant-all.jar

INFO - Beginning load: C:\bea103\modules\com.bea.core.i18n.tools_1.1.0.0.jar

INFO - Beginning load: C:\bea103\modules\org.apache.ant_1.6.5\lib\ant.jar

INFO - Configuring enterprise application: classpath.ear

FATAL - OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.

java.lang.OutOfMemoryError: Java heap space

at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:71)

at java.util.zip.ZipFile$1.<init>(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)

at java.util.jar.JarFile.getInputStream(JarFile.java:383)

at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:144)

at java.net.URL.openStream(URL.java:1009)

at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:726)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:113)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:315)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:261)

at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:188)

at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)

at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)

at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

javax.naming.NamingException: Attempted to load OpenEJB. OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space [Root exception is org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space]

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:55)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

at javax.naming.InitialContext.init(InitialContext.java:223)

at javax.naming.InitialContext.<init>(InitialContext.java:197)

at com.onstar.asd.dataservices.businessservices.junit.SubscriberBusinessServiceTest.setUp(SubscriberBusinessServiceTest.java:57)

at junit.framework.TestCase.runBare(TestCase.java:128)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:120)

at junit.framework.TestSuite.runTest(TestSuite.java:230)

at junit.framework.TestSuite.run(TestSuite.java:225)

at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)

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)

Caused by: org.apache.openejb.OpenEJBException: OpenEJB has encountered a fatal error and cannot be started: The Assembler encountered an unexpected error while attempting to build the container system.: Java heap space

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

... 19 more

Caused by: java.lang.OutOfMemoryError: Java heap space

at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:71)

at java.util.zip.ZipFile$1.<init>(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:212)

at java.util.zip.ZipFile.getInputStream(ZipFile.java:180)

at java.util.jar.JarFile.getInputStream(JarFile.java:383)

at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:144)

at java.net.URL.openStream(URL.java:1009)

at org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:726)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)

at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:113)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:315)

at org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:261)

at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:188)

at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)

at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)

at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)

at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)


________________________________

From: David Blevins [mailto:[hidden email]]
Sent: Thu 10/14/2010 6:11 PM
To: [hidden email]
Subject: Re: how to adjust classpath - version 3.1.2




On Oct 14, 2010, at 9:31 AM, Yu, Xiaohui wrote:

> Hi,
>
> I've downloaded version 3.1.2 to use for testing within Eclipse/MyEclipse. I copied a few jar files to my build classpath and I don't have any more ClassNotFound errors. However, I'm getting Out of Space error when running junit and it appears maybe openejb is trying to load too many ClientModules (my guess).
>
> I tried multiple regexp but so far nothing worked for me. Essentially I only want to load my customized EJBModule, and nothing else. Something similar to the following:
> p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
>
> p.put("openejb.deployments.classpath.include", ".*DataServiceEJB/classes.*");
>
> p.put("openejb.deployments.classpath.exclude", ".*");
>
> What should be the proper way to configure?
The above should be good.  I'm not familiar with what exception you mention.  Is it possible you can post the log output and exception?


-David





Reply | Threaded
Open this post in threaded view
|

Re: how to adjust classpath - version 3.1.2

dblevins
Administrator

On Oct 22, 2010, at 2:40 PM, Yu, Xiaohui wrote:

> Was anyone able to see if the log openejb generated is normal according to the include/exclude I configured? I'm concerned about all this loadings. I started to get OOM again with slightly newer code base.
>
> Here's the new output:
> Apache OpenEJB 3.1.2 build: 20091010-03:11
>

The latest 3.1.3 has this change which should eliminate all those ClientModules:

  https://issues.apache.org/jira/browse/OPENEJB-1130

If you can confirm that you still get that behavior in 3.1.3 we can get a fix in for 3.1.4

-David

Reply | Threaded
Open this post in threaded view
|

RE: how to adjust classpath - version 3.1.2

Yu, Xiaohui
After I tried 3.1.3, here're my findings:
 
1. it's no longer loading ClientModules, and so far I'm not getting memory issue, but I wasn't able to complete my testing (see below)
2. it doesn't detect one of my EJBs; this happened with 3.1.2 before, but this morning I can run multiple tests just fine before getting OOM
3. I get an additional error: does it require this additional jar file? Where should I get it? I copied all jars from the zip file I downloaded.
 
Thanks,
- John
 
INFO - Undeploying app: classpath.ear

ERROR - Application could not be deployed: classpath.ear

org.apache.openejb.OpenEJBException: Creating application failed: classpath.ear: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue

at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:679)

at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:450)

at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:368)

at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:125)

at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:60)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:271)

at org.apache.openejb.OpenEJB.init(OpenEJB.java:250)

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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)

at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)

at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

at javax.naming.InitialContext.init(InitialContext.java:223)

at javax.naming.InitialContext.<init>(InitialContext.java:197)

at com.onstar.asd.dataservices.businessservices.junit.SubscriberBusinessServiceTest.setUp(SubscriberBusinessServiceTest.java:31)

at junit.framework.TestCase.runBare(TestCase.java:128)

at junit.framework.TestResult$1.protect(TestResult.java:106)

at junit.framework.TestResult.runProtected(TestResult.java:124)

at junit.framework.TestResult.run(TestResult.java:109)

at junit.framework.TestCase.run(TestCase.java:120)

at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)

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)

Caused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue

at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:401)

at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)

at net.sf.ehcache.CacheManager.configure(CacheManager.java:293)

at net.sf.ehcache.CacheManager.init(CacheManager.java:225)

at net.sf.ehcache.CacheManager.<init>(CacheManager.java:212)

at net.sf.ehcache.CacheManager.create(CacheManager.java:381)

at net.sf.ehcache.hibernate.SingletonEhCacheProvider.start(SingletonEhCacheProvider.java:123)

at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)

at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)

at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)

at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:185)

at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:490)

... 31 more


________________________________

From: David Blevins [mailto:[hidden email]]
Sent: Fri 10/22/2010 9:13 PM
To: [hidden email]
Subject: Re: how to adjust classpath - version 3.1.2




On Oct 22, 2010, at 2:40 PM, Yu, Xiaohui wrote:

> Was anyone able to see if the log openejb generated is normal according to the include/exclude I configured? I'm concerned about all this loadings. I started to get OOM again with slightly newer code base.
>
> Here's the new output:
> Apache OpenEJB 3.1.2 build: 20091010-03:11
>

The latest 3.1.3 has this change which should eliminate all those ClientModules:

  https://issues.apache.org/jira/browse/OPENEJB-1130

If you can confirm that you still get that behavior in 3.1.3 we can get a fix in for 3.1.4

-David



Reply | Threaded
Open this post in threaded view
|

Re: how to adjust classpath - version 3.1.2

dblevins
Administrator
Trimmed down the stack trace to the 'Caused by' clause and it looks Hibernate/EHCache related.

On Oct 25, 2010, at 1:28 PM, Yu, Xiaohui wrote:

> Caused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
>
> at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:401)
>
> at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)
>
> at net.sf.ehcache.CacheManager.configure(CacheManager.java:293)
>
> at net.sf.ehcache.CacheManager.init(CacheManager.java:225)
>
> at net.sf.ehcache.CacheManager.<init>(CacheManager.java:212)
>
> at net.sf.ehcache.CacheManager.create(CacheManager.java:381)
>
> at net.sf.ehcache.hibernate.SingletonEhCacheProvider.start(SingletonEhCacheProvider.java:123)
>
> at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)
>
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
>
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
>
> at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
>
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
>
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
>
> at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:185)
>
> at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:490)
>
> ... 31 more

My guess is you need this jar: http://backport-jsr166.sourceforge.net

We used to include that in 3.1.2 as it was needed by ActiveMQ 4.  Now we use ActiveMQ 5 and that jar is no longer required for any code we ship, but it looks like Hibernate still uses it via EHCache.


-David

Reply | Threaded
Open this post in threaded view
|

RE: how to adjust classpath - version 3.1.2

Yu, Xiaohui
Thanks, I added backport jar to my testing lib, and openejb works fine. What confused me is my ear without this jar can still work fine in the Weblogic server (and I searched Weblogic and I didn't find a backport jar there). Could it be the way HibernatePersistence invoked by openejb somehow different from when it's loaded from the server that made the difference? I agree with you on Hibernate/EHCache seems to be using it of course.
 
Regards,
- John

________________________________

From: David Blevins [mailto:[hidden email]]
Sent: Mon 10/25/2010 5:22 PM
To: [hidden email]
Subject: Re: how to adjust classpath - version 3.1.2



Trimmed down the stack trace to the 'Caused by' clause and it looks Hibernate/EHCache related.

On Oct 25, 2010, at 1:28 PM, Yu, Xiaohui wrote:

> Caused by: java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
>
> at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:401)
>
> at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)
>
> at net.sf.ehcache.CacheManager.configure(CacheManager.java:293)
>
> at net.sf.ehcache.CacheManager.init(CacheManager.java:225)
>
> at net.sf.ehcache.CacheManager.<init>(CacheManager.java:212)
>
> at net.sf.ehcache.CacheManager.create(CacheManager.java:381)
>
> at net.sf.ehcache.hibernate.SingletonEhCacheProvider.start(SingletonEhCacheProvider.java:123)
>
> at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72)
>
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
>
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
>
> at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
>
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
>
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
>
> at org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:185)
>
> at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:490)
>
> ... 31 more
My guess is you need this jar: http://backport-jsr166.sourceforge.net <http://backport-jsr166.sourceforge.net/>

We used to include that in 3.1.2 as it was needed by ActiveMQ 4.  Now we use ActiveMQ 5 and that jar is no longer required for any code we ship, but it looks like Hibernate still uses it via EHCache.


-David



Reply | Threaded
Open this post in threaded view
|

Re: how to adjust classpath - version 3.1.2

dblevins
Administrator

On Oct 26, 2010, at 7:45 AM, Yu, Xiaohui wrote:

> Could it be the way HibernatePersistence invoked by openejb somehow different from when it's loaded from the server that made the difference? I agree with you on Hibernate/EHCache seems to be using it of course.

Shouldn't be.  There really isn't any flexibility in how a server boots up the persistence provider.  Basically, this is the method:

http://download.oracle.com/javaee/5/api/javax/persistence/spi/PersistenceProvider.html#createContainerEntityManagerFactory(javax.persistence.spi.PersistenceUnitInfo, java.util.Map)

Where PersistenceUnitInfo is an object that represents your persistence.xml data as-is.

Only thing I can imagine is that maybe Hibernate might be enabling some features because it sees EHCache in the classpath?


-David