This may be very similar to
http://openejb.markmail.org/thread/xkvzg4fvn6gjppmo#query:+page:1+mid:bl5bed
4gxkrbpens+state:results

I get the exact same problem here, the NoClassDefFoundError, and it bails
out when building the openejb-core module. So far, it's proven very
difficult to get a complete "mvn install" in the openejb root to work.


It happens when the system tries to scan the classes in the javax.annotation
package
While I don't know the exact reason for it, since I see no correlation
between PostConstruct and javax.interceptor.InvocationContext, this did
solve my problem, albeit a workaround, it gives me a working repository.
I'm not suggesting this is the correct fix, as this problem does show up in
other places in the build as well [1]

Index:
maven-plugins/spi-helper-maven-plugin/src/main/java/org/apache/openejb/maven
/plugin/spi/SpiMojo.java
===================================================================
---
maven-plugins/spi-helper-maven-plugin/src/main/java/org/apache/openejb/maven
/plugin/spi/SpiMojo.java        (revision 1306393)
+++
maven-plugins/spi-helper-maven-plugin/src/main/java/org/apache/openejb/maven
/plugin/spi/SpiMojo.java        (working copy)
@@ -192,6 +192,7 @@
                             getLog().warn("can't find " + annotation);
                             continue;
                         }
+                        if
(annClazz.getName().indexOf("javax.annotation")==0) continue;

                         if (!useMeta) {
                             for (Class<?> clazz :
finder.findAnnotatedClasses(annClazz)) {



This basically bypasses all annotation checks for classes in the
javax.annotation package

There was one module that seemed to be missing a dependency, not sure if the
parent already includes this.

Index: openejb/arquillian-tomee/arquillian-tomee-remote/pom.xml
===================================================================
--- openejb/arquillian-tomee/arquillian-tomee-remote/pom.xml    (revision
1306627)
+++ openejb/arquillian-tomee/arquillian-tomee-remote/pom.xml    (working
copy)
@@ -80,6 +80,12 @@
     </dependency>

     <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-impl</artifactId>
+      <version>${org.apache.openwebbeans.version}</version>
+    </dependency>
+
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>test</scope>

[1] - When the system inspects javax.ws.rs.Path during the build of 
[INFO] Building OpenEJB :: Web Examples :: REST Example
[INFO]    task-segment: [compile]

It throws this error:

java.lang.NoClassDefFoundError:
org/apache/openjpa/enhance/PersistenceCapable
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at
org.apache.xbean.finder.AnnotationFinder.findAnnotatedMethods(AnnotationFind
er.java:584)
        at
org.apache.openejb.maven.plugin.spi.SpiMojo.execute(SpiMojo.java:219)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:694)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        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.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)
Caused by: java.lang.ClassNotFoundException:
org.apache.openjpa.enhance.PersistenceCapable
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 35 more


Reply via email to