Unexpected ClassnotFoundException on reflective Class#getMethod

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 7 10:46:15 UTC 2016


On 07/04/2016 10:40, Dawid Weiss wrote:
> I just hit the same issue with JBoss RestEasy. We have an embedded
> server (not EE class, a simple servlet with some web services
> exposed), but RestEasy relies on annotations in jaxrs
> (javax.annotation.*, javax.ws.rs.*). I tried to somehow make it work,
> but failed so far. Please correct me if I'm wrong, but from my
> investigation of this list archives it seems that it's impossible to
> simply "add" the JAR with the missing annotations to classpath? I need
> to compile those annotations to a module and then add the module,
> right?
>
Right, no splitting of package javax.annotation between the class path 
and module java.annotations.common (the Java SE subset of the JSR-250 
defined "Common Annotations"). To upgrade/override this to the EE 
version means requires deploying the EE version as a module 
-upgrademodulepath.

As you've read in the various threads, we are trying to get to the point 
where the 6 modules shared with Java EE are not resolved by default. 
When we get there then you should be able to put a JAR file on the class 
path with javax.annotation.* types and it should work as there will be 
no overlapping with packages in modules. Alternatively, deploy the EE 
version of module java.annotations.common on the module path, that will 
work too.

-Alan


More information about the jigsaw-dev mailing list