tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <quin...@last.za.net>
Subject Problem when scanning for applications in a Manifest Classpath
Date Mon, 07 Sep 2009 21:45:56 GMT
Hey,

I have an odd problem when doing unit tests.

In production we have a bunch of EJB JAR files and a bunch of app
library dependencies.

The one library specifically causes a cyclic dependency.  Which is
fine, since it's a runtime dependency and doesn't need to have it
compiled against. So everything compiles fine.

When in production it all works fine, because everything is on the
classpath only once. When i do unit tests in netbeans though, I have
dependencies configured, and this causes the following.

KMSPlatform-ejb contains persistence unit "KMSPlatform-PU", and
depends on app library X. It also has a special persistence.xml when
doing unit tests, since they transaction manager is different.
App library X depends on KMSPlatform-ejb

So when I run the application I have the test classpath for the EJB
project, and X added onto this classpath. The problem is that

Initial Context Properties - Start
-- listing properties --
java.naming.factory.initial=net.kunye.platform.appclient.context....
testPool.UserName=kms
testPool=new://Resource?type=DataSource
net.kunye.platform.tests.appclient.auth.admin.pass=kmsTESTpassword
net.kunye.platform.tests.appclient.auth.admin.username=testuser-admin
testPool.Password=kms
testPool.JdbcUrl=jdbc:postgresql://localhost:5432/test...
hibernate.hbm2ddl.auto=
net.kunye.platform.tests.appclient.auth.lamp-room.username=testuser-lamproom
hibernate.show_sql=true
net.kunye.platform.tests.appclient.auth.lamp-room.pass=kmsTESTpassword
testPool.JdbcDriver=org.postgresql.Driver
Initial Context Properties - End
Apache OpenEJB 3.0    build: 20080408-04:13
http://openejb.apache.org/
INFO - openejb.home = /home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb
INFO - openejb.base = /home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb
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 - Configuring Service(id=testPool, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory,
type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
INFO - Found EjbModule in classpath:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
INFO - Found EjbModule in classpath:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Configuring app:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
INFO - Configuring Service(id=Default Stateless Container,
type=Container, provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean SiteBean:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring PersistenceUnit(name=KMSPlatform-PU,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Auto-creating a Resource with id 'testPoolNonJta' of type
'DataSource for 'KMSPlatform-PU'.
INFO - Configuring Service(id=testPoolNonJta, type=Resource,
provider-id=testPool)
INFO - Adjusting KMSPlatform-PU <jta-data-source> to 'testPool'
INFO - Adjusting KMSPlatform-PU <non-jta-data-source> to 'testPoolNonJta'
INFO - Loaded Module:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
INFO - Configuring app:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Configuring PersistenceUnit(name=KMSPlatform-TestPU,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Adjusting KMSPlatform-TestPU <non-jta-data-source> to 'testPoolNonJta'
INFO - Loaded Module:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Assembling app:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
INFO - PersistenceUnit(name=KMSPlatform-PU,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Undeploying app:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
ERROR - Application could not be deployed:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
org.apache.openejb.OpenEJBException: createApplication.failed
[/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar]:
org/apache/geronimo/kernel/KernelRegistry
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:592)
        at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:338)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:250)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
        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:62)
        at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
        at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
        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 net.kunye.platform.appclient.test.LocalTestFramework.<init>(LocalTestFramework.java:42)
        at net.kunye.platform.personnel.PersonnelBeanTest.setUpClass(PersonnelBeanTest.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.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.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
        at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
Caused by: java.lang.NoClassDefFoundError:
org/apache/geronimo/kernel/KernelRegistry
        at net.kunye.persistence.GeronimoTransactionManagerLookup.getTransactionManager(GeronimoTransactionManagerLookup.java:24)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:367)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
        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:183)
        at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:454)
        ... 33 more
Caused by: java.lang.ClassNotFoundException:
org.apache.geronimo.kernel.KernelRegistry
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 41 more
INFO - Assembling app:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - PersistenceUnit(name=KMSPlatform-TestPU,
provider=org.hibernate.ejb.HibernatePersistence)


Though, this is my classpath. I got this from "ps -C java f | cat", so
it's really what is being supplied to the VM:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/ApplicationClientLib.jar
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/test/classes
/home/quintin/dev/kms/libs/hibernate/annotations-3.4.jar
/home/quintin/dev/kms/libs/hibernate/antlr-2.7.6.jar
/home/quintin/dev/kms/libs/hibernate/commons-annotations-3.4.jar
/home/quintin/dev/kms/libs/hibernate/commons-collections-3.1.jar
/home/quintin/dev/kms/libs/hibernate/core-3.3.jar
/home/quintin/dev/kms/libs/hibernate/dom4j-1.6.1.jar
/home/quintin/dev/kms/libs/hibernate/entitymanager-3.4.jar
/home/quintin/dev/kms/libs/hibernate/GeronimoTransactionManager-1.0.jar
/home/quintin/dev/kms/libs/hibernate/javassist-3.9.0.GA.jar
/home/quintin/dev/kms/libs/hibernate/jpa-3.0.jar
/home/quintin/dev/kms/libs/hibernate/jta-1.1.jar
/home/quintin/dev/kms/libs/jdbc/jdbc-8.3.jdbc3.jar
/home/quintin/dev/kunye/KunyeLib/dist/KunyeLib.jar
/home/quintin/dev/kms/libs/junit-openejb/activeio-core-3.0.0-incubator.jar
/home/quintin/dev/kms/libs/junit-openejb/activemq-core-4.1.1.jar
/home/quintin/dev/kms/libs/junit-openejb/activemq-ra-4.1.1.jar
/home/quintin/dev/kms/libs/junit-openejb/asm-2.2.3.jar
/home/quintin/dev/kms/libs/junit-openejb/asm-commons-2.2.3.jar
/home/quintin/dev/kms/libs/junit-openejb/asm-tree-2.2.3.jar
/home/quintin/dev/kms/libs/junit-openejb/backport-util-concurrent-2.1.jar
/home/quintin/dev/kms/libs/junit-openejb/commons-cli-1.1.jar
/home/quintin/dev/kms/libs/junit-openejb/commons-collections-3.2.jar
/home/quintin/dev/kms/libs/junit-openejb/commons-dbcp-all-1.3.jar
/home/quintin/dev/kms/libs/junit-openejb/commons-lang-2.1.jar
/home/quintin/dev/kms/libs/junit-openejb/commons-logging-1.1.jar
/home/quintin/dev/kms/libs/junit-openejb/cxf-bundle-2.0.4-incubator.jar
/home/quintin/dev/kms/libs/junit-openejb/geronimo-connector-2.1.jar
/home/quintin/dev/kms/libs/junit-openejb/geronimo-javamail_1.4_mail-1.2.jar
/home/quintin/dev/kms/libs/junit-openejb/geronimo-transaction-2.1.jar
/home/quintin/dev/kms/libs/junit-openejb/howl-1.0.1-1.jar
/home/quintin/dev/kms/libs/junit-openejb/hsqldb-1.8.0.7.jar
/home/quintin/dev/kms/libs/junit-openejb/javaee-api-5.0-1.jar
/home/quintin/dev/kms/libs/junit-openejb/jaxb-impl-2.0.5.jar
/home/quintin/dev/kms/libs/junit-openejb/junit-4.5.jar
/home/quintin/dev/kms/libs/junit-openejb/log4j-1.2.12.jar
/home/quintin/dev/kms/libs/junit-openejb/neethi-2.0.2.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-client-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-core-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-cxf-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-ejbd-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-hsql-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-http-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-javaagent-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-jee-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-loader-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-server-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-telnet-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openejb-webservices-3.0.jar
/home/quintin/dev/kms/libs/junit-openejb/openjpa-1.0.1.jar
/home/quintin/dev/kms/libs/junit-openejb/saaj-impl-1.3.jar
/home/quintin/dev/kms/libs/junit-openejb/serp-1.13.1.jar
/home/quintin/dev/kms/libs/junit-openejb/slf4j-api-1.4.3.jar
/home/quintin/dev/kms/libs/junit-openejb/slf4j-jcl-1.4.3.jar
/home/quintin/dev/kms/libs/junit-openejb/swizzle-stream-1.0.1.jar
/home/quintin/dev/kms/libs/junit-openejb/wsdl4j-1.6.1.jar
/home/quintin/dev/kms/libs/junit-openejb/wstx-asl-3.2.1.jar
/home/quintin/dev/kms/libs/junit-openejb/xbean-finder-3.4-r636442.jar
/home/quintin/dev/kms/libs/junit-openejb/xbean-naming-3.3.jar
/home/quintin/dev/kms/libs/junit-openejb/xbean-reflect-3.4-r636442.jar
/home/quintin/dev/kms/libs/junit-openejb/xml-resolver-1.2.jar
/home/quintin/dev/kms/libs/junit-openejb/XmlSchema-1.3.2.jar
/opt/glassfish/lib/endorsed/webservices-api.jar
/opt/glassfish

As you can see /home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/lib/KMSPlatform-ejb.jar
is no where in the classpath. It gets it from the classpath entry in
the manifest of:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/ApplicationClientLib.jar

Is there a way I can disable this?

If not and I would have to modify the source, can someone please point
me toward where I would remove this, and where to find the OpenEJB
source for the version included in Geronimo 2.1.4. I know Geronimo has
some plugs/customizations, but if I'm to do this, I'm just looking for
the exact version they based their plugin on. Since I would only have
this problem when using OpenEJB in the unit tests, I am willing to
modify the source to disable this, and have 2 different OpenEJB
versions, one for production (Geronimo distribution) and unit tests
(the full OpenEJB 3.0.x I would modify). Which is basically what I
have now, except the later is unmodified, and not the exact version.

And even if I don't have to move in the "Source Mod" direction, I am
still looking for the same version as used in Geronimo, as well as
it's source. Where can I find these?

Thanks
-- 
Quintin Beukes

Mime
View raw message