LinkageError on startup
-----------------------

                 Key: GERONIMO-2866
                 URL: https://issues.apache.org/jira/browse/GERONIMO-2866
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
    Affects Versions: 2.0-M1
         Environment: Win XP 1.5.0_10 
Linux 1.5.0_10
Mac OS X 1.5.0_06
            Reporter: Vitaly Pimenov


Hello, I'm a YourKit Java Profiler developer. Our customer have reported that 
Geronimo 2.0 doesn't start with our profiler agent.
There is a LinkageError on server startup:
java.lang.LinkageError: loader (instance of  
org/apache/geronimo/kernel/classloader/JarFileClassLoader): attempted  
duplicate class definition for name: 
"$javax/naming/Context$$EnhancerByCGLIB$$79faf44d$$FastClassByCGLIB$$e18c505c"
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        ... 34 more

Looking into this, I have found that the problem is caused by dynamic byte-code 
instrumentation: we add a special 'static transient boolean' field in some 
classes and 
"$javax/naming/Context$$EnhancerByCGLIB$$79faf44d$$FastClassByCGLIB$$e18c505c" 
is one of them.
It looks like CGLIB somehow watches the classfile changes and tries to reload 
class, modified by our instrumentation. 
The problem arises because the names are identical. 
Maybe it can be solved by customizing NamingPolicy used in CGLIB.

You can reproduce the problem with YourKit Java Profiler 6.0.11 
http://yourkit.com/download/index.jsp
To run server with profiler you can just add 2 following lines at the beginning 
or geronimo startup.bat
set PATH=<path to YourKit Java Profiler install dir>/bin/win32;%PATH%
set JAVA_TOOL_OPTIONS=-agentlib:yjpagent %JAVA_TOOL_OPTIONS%

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to