muh6mm3d / jannocessor

Automatically exported from code.google.com/p/jannocessor
Other
3 stars 1 forks source link

java.lang.LinkageError: loader constraint violation #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying your annotation processing on a test project. 
I've been following the tutorial by creating the 
org.jannocessor.config.Processors class in the same project as the annotated 
classes to process.

It keeps on failing by throwing following exception:

[INFO] diagnostic Note: Starting processing iteration...
[INFO] diagnostic Note: Total 1 elements were annotated with @Test

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
[ERROR] error on execute: error during compilation
java.lang.LinkageError: loader constraint violation: loader (instance of 
com/sun/tools/javac/util/CloseableURLClassLoader) previously initiated loading 
for a different type with name "org/jannocessor/config/Processors"
    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.getDeclaringClass(Native Method)
    at java.lang.Class.getEnclosingClass(Class.java:1085)
    at java.lang.Class.getCanonicalName(Class.java:1169)
    at org.jannocessor.processor.JannocessorProcessor.processElements(JannocessorProcessor.java:187)
    at ...

I've enclosed the project's pom file... There's probably something to exclude 
at some point to avoid the evil twin... I'm trying to get my hand on in the 
meantime.

It would be much appreciated If you have any idea where the problem might come 
from..

Thanks for your help,
Sallah

Original issue reported on code.google.com by sallah.k...@gmail.com on 9 Nov 2012 at 10:07

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It's solved, the issue was due to the generator class being an inline class of 
the Processors' one. Moving it outside did clear it.

Original comment by sallah.k...@gmail.com on 9 Nov 2012 at 10:37