Hi All,
   I am in the process of approving OPENEJB-357.  I wanted to get the
examples tests passing before applying the tests but I'm running into some
issues with Maven.  When I run "mvn test" in "trunk/openejb3/examples", I
run into the following error:

12:49:21,436 INFO  [startup] Found EjbModule in classpath:
/Users/jwhitlock/dev/java/openejb/openejb3/examples/helloworld-stateful-pojo/target/classes
12:49:22,675 FATAL [startup] OpenEJB has encountered a fatal error and
cannot be started: The Assembler encountered an unexpected error while
attempting to initialize.
java.lang.LinkageError: loader constraints violated when linking
javax/xml/namespace/QName class
       at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
.<clinit>(RuntimeBuiltinLeafInfoImpl.java:186)
       at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(
RuntimeTypeInfoSetImpl.java:25)
       at
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(
RuntimeModelBuilder.java:77)
       at
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(
RuntimeModelBuilder.java:40)
       at com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(
ModelBuilder.java:97)
       at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(
RuntimeModelBuilder.java:43)
       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(
JAXBContextImpl.java:345)
       at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(
JAXBContextImpl.java:217)
       at com.sun.xml.bind.v2.ContextFactory.createContext(
ContextFactory.java:76)
       at com.sun.xml.bind.v2.ContextFactory.createContext(
ContextFactory.java:55)
       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:585)
       at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
       at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
       at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
       at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
       at org.apache.openejb.alt.config.JaxbUnmarshaller.<init>(
JaxbUnmarshaller.java:56)
       at org.apache.openejb.alt.config.JaxbUnmarshaller.unmarshal(
JaxbUnmarshaller.java:64)
       at org.apache.openejb.alt.config.EjbJarUtils.readEjbJar(
EjbJarUtils.java:91)
       at org.apache.openejb.alt.config.EjbJarUtils.<init>(EjbJarUtils.java
:63)
       at
org.apache.openejb.alt.config.DeploymentLoader.loadDeploymentsList(
DeploymentLoader.java:243)
       at
org.apache.openejb.alt.config.ConfigurationFactory.getOpenEjbConfiguration(
ConfigurationFactory.java:146)
       at org.apache.openejb.assembler.classic.Assembler.init(
Assembler.java:99)
       at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:136)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:275)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:260)
       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:585)
       at org.apache.openejb.loader.OpenEJBInstance.init(
OpenEJBInstance.java:36)
       at org.apache.openejb.client.LocalInitialContextFactory.init(
LocalInitialContextFactory.java:53)
       at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(
LocalInitialContextFactory.java:39)
       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 org.acme.FriendlyPersonTest.setUp(FriendlyPersonTest.java:41)
       at junit.framework.TestCase.runBare(TestCase.java:125)
       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:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       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:585)
       at org.codehaus.surefire.battery.JUnitBattery.executeJUnit(
JUnitBattery.java:246)
       at org.codehaus.surefire.battery.JUnitBattery.execute(
JUnitBattery.java:220)
       at org.codehaus.surefire.Surefire.executeBattery(Surefire.java:204)
       at org.codehaus.surefire.Surefire.run(Surefire.java:153)
       at org.codehaus.surefire.Surefire.run(Surefire.java:77)
       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:585)
       at org.codehaus.surefire.SurefireBooter.run(SurefireBooter.java:104)
       at org.apache.maven.test.SurefirePlugin.execute(SurefirePlugin.java
:303)
       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:412)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:534)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:475)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:454)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:306)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:140)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
       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:585)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

I then decide to try a pristine local Maven repository and get the
following:  (Created by running "mvn clean && mvn test -
Dmaven.repo.local=temp")

org.apache.maven.surefire.booter.SurefireExecutionException:
junit/framework/TestCase; nested exception is java.lang.NoClassDefFoundError:
junit/framework/TestCase
java.lang.NoClassDefFoundError: junit/framework/TestCase
       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.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(
IsolatedClassLoader.java:100)
       at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(
AbstractDirectoryTestSuite.java:84)
       at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(
Surefire.java:147)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
       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:585)
       at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
SurefireBooter.java:225)
       at org.apache.maven.surefire.booter.SurefireBooter.main(
SurefireBooter.java:747)

Something is hokey.  Surefire cannot find JUnit but JUnit is a dependency
and should be on the classpath.  Why do running tests against my regular
repo and a pristine temporary repository fail differently?  What is
preventing either of these from running properly?  David has reproduced
these behaviors as well and suggested posting this here to get some Maven
folk involved.

Take care,

Jeremy

Reply via email to