[jboss-jira] [JBoss JIRA] Commented: (JASSIST-125) Compilation fails with "javassist.bytecode.BadBytecode: jsr at 406" WebLogic 10.3 JTA data source class
Shigeru Chiba (JIRA)
jira-events at lists.jboss.org
Sat Jul 10 01:37:46 EDT 2010
[ https://jira.jboss.org/browse/JASSIST-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12538669#action_12538669 ]
Shigeru Chiba commented on JASSIST-125:
---------------------------------------
You are right. But weblogic.jdbc.jta.DataSource.class is in Java 6 (version 50). This confuses me.
My understanding is a class file can use either jsr or StackMapTable. So Javassist can generate a
StackMapTable only if a class file does not contain jsr. That's why Javassist fails to run your test code
(DataSource.class uses both jsr and StackMapTable).
Anyway, what I would like to discuss is how to fix this problem. One idea is not to generate a StackMapTable
if a class file contains jsr. Another idea is to try to generate a StackMapTable as long as it is possible (this
means Javassist may fail but normally should succeed)
Any comments are welcome.
> 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