Bug 412295 - java.lang.ClassFormatError when weaving with aspectj 1.7.3
Summary: java.lang.ClassFormatError when weaving with aspectj 1.7.3
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.7.3   Edit
Hardware: Other Windows 7
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 07:03 EDT by krishna jasty CLA
Modified: 2013-07-09 00:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description krishna jasty CLA 2013-07-04 07:03:32 EDT
When i run my batch with latest aspectj i.e 1.7.3 release i am getting the following exception.

  [java] [AppClassLoader@df6ccd] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
     [java] [AppClassLoader@df6ccd] error at com\ibm\db2\jcc\b\kc.java::0 problem generating method com.ibm.db2.jcc.b.kc.<clinit> : Code size too big: 94185
     [java] Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file com/ibm/db2/jcc/b/kc
     [java] 	at java.lang.ClassLoader.defineClass1(Native Method)
     [java] 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
     [java] 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
     [java] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
     [java] 	at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
     [java] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
     [java] 	at java.security.AccessController.doPrivileged(Native Method)
     [java] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     [java] 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     [java] 	at java.lang.Class.forName0(Native Method)
     [java] 	at java.lang.Class.forName(Class.java:247)
     [java] 	at org.aspectj.runtime.reflect.Factory.makeClass(Factory.java:70)
     [java] 	at org.aspectj.runtime.reflect.Factory.makeConstructorSig(Factory.java:235)
     [java] 	at com.ibm.db2.jcc.b.b.ajc$preClinit(b.java:1)
     [java] 	at com.ibm.db2.jcc.b.b.<clinit>(b.java)
     [java] 	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:165)
     [java] 	at java.sql.DriverManager.getConnection(DriverManager.java:582)
     [java] 	at java.sql.DriverManager.getConnection(DriverManager.java:185)
     [java] 	at com.tcs.mastercraft.mctype.ThreadSpecificContext.<init>(ThreadSpecificContext.java:617)
     [java] 	at com.tcs.mastercraft.mctype.ServerContext.getServerContextObject(ServerContext.java:121)
     [java] 	at com.tcs.bfsarch.batch.common.BatchUtils.loadMCPropFile(BatchUtils.java:1539)
     [java] 	at com.tcs.bfsarch.batch.common.BatchUtils.initConfig(BatchUtils.java:1590)
     [java] 	at com.tcs.bfsarch.batch.BatchDriver.main(BatchDriver.java:180)
     [java] Java Result: 1
Comment 1 Andrew Clement CLA 2013-07-08 19:25:25 EDT
code size too big indicates you are doing enough weaving to blow the 64k bytecode limit for a method.  Unfortunately AspectJ does not yet support splitting the method when this happens.  Given that it is the clinit method that is getting too big it might be a proliferation of static joinpoint objects - is that likely?
Comment 2 krishna jasty CLA 2013-07-09 00:52:29 EDT
Andrew,

The advice is very small, with only inclusion of a sysout statement.
For a quick resolution i eliminated weaving perticularly on this jar.