Hi,
I've just started exploring OpenEJB to see if we can use it to run
JUNIT
test cases, in an embedded configuration.
I went through the examples and tried to create a very simple JUNIT
test
case using Junit 4.5 and Maven 2.
I just wanted to make sure that I can run OpenEJB within Eclipse. A
very
very simple test case I wrote simply creates an initial context :
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.openejb.client.LocalInitialContextFactory");
properties.setProperty("openejb.deployments.classpath",
"true");
InitialContext ic = new InitialContext(properties);
However, I cannot successfully run this test case, it throws
XMLRegistryException immediately after I run the test case and
OpenEJB fails to configuring service, see the stack trace below. In
the
test case, I printed out the classpath to make sure that
the jar containing this XMLRegistryException class is indeed in the
classpath.
Has anyone seen this problem before ?
Thanks,
Gul
Apache OpenEJB 3.1.1 build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home =
C:\MyPerforceWorkspaces\469\Cardhu\ProvisioningREQ469\prv\common\jar
INFO - openejb.base =
C:\MyPerforceWorkspaces\469\Cardhu\ProvisioningREQ469\prv\common\jar
FATAL - Failed Configuring Service(id=null)
java.lang.NoClassDefFoundError:
weblogic/xml/registry/XMLRegistryException :
weblogic/utils/NestedException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at
javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:100)
at
javax
.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.jav
a:278)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
107
)
at
org
.apache.openejb.config.sys.JaxbOpenejb.parseServicesJar(JaxbOpenejb.j
ava:151)
at
org
.apache.openejb.config.sys.JaxbOpenejb.readServicesJar(JaxbOpenejb.ja
va:130)
at
org
.apache.openejb.config.ServiceUtils.getServiceProviders(ServiceUtils.
java:206)
at
org
.apache.openejb.config.ServiceUtils.getServiceProvidersByServiceType(
ServiceUtils.java:132)
at
org
.apache.openejb.config.ServiceUtils.getServiceProviderByType(ServiceU
tils.java:188)
at
org
.apache.openejb.config.ConfigurationFactory.resolveServiceProvider(Co
nfigurationFactory.java:804)
at
org
.apache.openejb.config.ConfigurationFactory.configureService(Configur
ationFactory.java:676)
at
org
.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(C
onfigurationFactory.java:308)
at
org
.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(A
ssembler.java:292)
at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
271)
FATAL - OpenEJB has encountered a fatal error and cannot be started:
Assembler failed to build the container system.
org.apache.openejb.OpenEJBException: Failed Configuring
Service(id=null): weblogic/xml/registry/XMLRegistryException :
weblogic/utils/NestedException
at
org
.apache.openejb.config.ConfigurationFactory.configureService(Configur
ationFactory.java:772)
at
org
.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(C
onfigurationFactory.java:308)
at
org
.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(A
ssembler.java:292)
at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
271)
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.jav
a:39)
at
sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:
36)
at
org
.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialCo
ntextFactory.java:71)
at
org
.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialCo
ntextFactory.java:53)
at
org
.apache.openejb.client.LocalInitialContextFactory.getInitialContext(L
ocalInitialContextFactory.java:42)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:
667)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at
provision.common.sql.DBCommandTest.setUp(DBCommandTest.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.junit.runners.model.FrameworkMethod
$1.runReflectiveCall(FrameworkMet
hod.java:44)
at
org
.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallab
le.java:15)
at
org
.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMetho
d.java:41)
at
org
.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.jav
a:27)
at
org
.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
31)
at
org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:73)
at
org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner
.java:46)
at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at
org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org
.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.jav
a:28)
at
org
.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org
.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.jav
a:62)
at
org
.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSe
t(AbstractDirectoryTestSuite.java:140)
at
org
.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Abstr
actDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org
.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Suref
ireBooter.java:338)
at
org
.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
:997)
Caused by: java.lang.NoClassDefFoundError:
weblogic/xml/registry/XMLRegistryException :
weblogic/utils/NestedException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at
javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:100)
at
javax
.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.jav
a:278)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
107
)
at
org
.apache.openejb.config.sys.JaxbOpenejb.parseServicesJar(JaxbOpenejb.j
ava:151)
at
org
.apache.openejb.config.sys.JaxbOpenejb.readServicesJar(JaxbOpenejb.ja
va:130)
at
org
.apache.openejb.config.ServiceUtils.getServiceProviders(ServiceUtils.
java:206)
at
org
.apache.openejb.config.ServiceUtils.getServiceProvidersByServiceType(
ServiceUtils.java:132)
at
org
.apache.openejb.config.ServiceUtils.getServiceProviderByType(ServiceU
tils.java:188)
at
org
.apache.openejb.config.ConfigurationFactory.resolveServiceProvider(Co
nfigurationFactory.java:804)
at
org
.apache.openejb.config.ConfigurationFactory.configureService(Configur
ationFactory.java:676)
at
org
.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(C
onfigurationFactory.java:308)
at
org
.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(A
ssembler.java:292)
at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:
271)
---------------------------------------------------------------------
This transmission (including any attachments) may contain
confidential information, privileged material (including material
protected by the solicitor-client or other applicable privileges),
or constitute non-public information. Any use of this information by
anyone other than the intended recipient is prohibited. If you have
received this transmission in error, please immediately reply to the
sender and delete this information from your system. Use,
dissemination, distribution, or reproduction of this transmission by
unintended recipients is not authorized and may be unlawful.