[jboss-jira] [JBoss JIRA] Created: (JASSIST-125) Compilation fails with "javassist.bytecode.BadBytecode: jsr at 406" WebLogic 10.3 JTA data source class

Adam Honen (JIRA) jira-events at lists.jboss.org
Sun Jul 4 08:04:46 EDT 2010


Compilation fails with "javassist.bytecode.BadBytecode: jsr at 406" WebLogic 10.3 JTA data source class
-------------------------------------------------------------------------------------------------------

                 Key: JASSIST-125
                 URL: https://jira.jboss.org/browse/JASSIST-125
             Project: Javassist
          Issue Type: Bug
    Affects Versions: 3.12.0.GA
         Environment: Reproduced on Linux x86 and Windows XP (x86).
            Reporter: Adam Honen
            Assignee: Shigeru Chiba


Trying to add code at the beginning of the method getConnection in the class weblogic.jdbc.jta.DataSource I got the following error:

Exception in thread "main" javassist.CannotCompileException: by javassist.bytecode.BadBytecode: jsr at 399
        at javassist.CtBehavior.insertBefore(CtBehavior.java:728)
        at javassist.CtBehavior.insertBefore(CtBehavior.java:685)
        at Test.main(Test.java:26)
Caused by: javassist.bytecode.BadBytecode: jsr at 399
        at javassist.bytecode.stackmap.Tracer.throwBadBytecode(Tracer.java:144)
        at javassist.bytecode.stackmap.Tracer.visitJSR(Tracer.java:133)
        at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:563)
        at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:101)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
        at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:213)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:175)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:141)
        at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
        at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:416)
        at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:398)
        at javassist.CtBehavior.insertBefore(CtBehavior.java:719)
        ... 2 more

I've created a small program that simulates this problem outside the Weblogic container.
The class can be found inside <Weblogic home>\modules\com.bea.core.datasource6_1.4.0.0.jar.
And additional dependency which is required in order to load this class (although it is not needed in order to modify the byte codes) is <Weblogic home>\modules\com.bea.core.transaction_2.5.0.0.jar.

Both of these files are available when installing Weblogic 10.3.

I suspect this might be some sort of collision with WebLogic's Diagnostic framework. I'm not sure how calls to WLDF are added, but it is possible they were added by some other tool for manipulating byte codes (at compile time), in which case this issue is a bit more interesting (could indicate collisions with certain other AOP tools).

Just for the sake of pin pointing the source of the problem, I also used AspectJ to add code to the method. It worked fine with no errors.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list