Project: AspectJ
Bug 147801 java.lang.ClassFormatError: Repetitive method name/signature
Reported: 2006-06-19 18:07:26 | Status: resolved fixed

I get a ClassFormatError trying to perform runtime-weaving on a DB2 class. The class being woven is COM.ibm.db2.jdbc.app.DB2PreparedStatement. The full message exception is: java.lang.ClassFormatError: Repetitive method name/signature in class file COM/ibm/db2/jdbc/app/DB2PreparedStatement. In examining the post-weave class file, it looks as if Aspectj is defining a duplicate method within the class called getParameterMetaData(). Here are the messages from the weaver: 04:21:13,640 INFO [STDOUT] info weaving 'COM.ibm.db2.jdbc.app.DB2CallableStatement' 04:21:13,640 INFO [STDOUT] info weaver operating in reweavable mode. Need to verify any required types exist. 04:21:13,671 INFO [STDOUT] info weaving 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' 04:21:13,671 INFO [STDOUT] info weaver operating in reweavable mode. Need to verify any required types exist. 04:21:13,703 INFO [STDOUT] weaveinfo Join point 'method-execution(java.sql.ResultSet COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery())' in Type 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' (DB2PreparedStatement.java:1679) advised by before advice from 'com.ibm.tivoli.itcam.toolkit.ai.aspectj.captureJDBC.CaptureSQLStatement' (CaptureSQLStatement.aj:747) [with runtime test] 04:21:13,703 INFO [STDOUT] weaveinfo Join point 'method-execution(java.sql.ResultSet COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery())' in Type 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' (DB2PreparedStatement.java:1679) advised by afterReturning advice from 'com.ibm.tivoli.itcam.toolkit.ai.aspectj.captureJDBC.CaptureSQLStatement' (CaptureSQLStatement.aj:946) [with runtime test] 04:21:13,718 INFO [STDOUT] weaveinfo Join point 'method-execution(java.sql.ResultSet COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery())' in Type 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' (DB2PreparedStatement.java:1679) advised by afterThrowing advice from 'com.ibm.tivoli.itcam.toolkit.ai.aspectj.captureJDBC.CaptureSQLStatement' (CaptureSQLStatement.aj:971) [with runtime test] 04:21:13,718 INFO [STDOUT] weaveinfo Join point 'method-execution(boolean COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute())' in Type 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' (DB2PreparedStatement.java:3971) advised by before advice from 'com.ibm.tivoli.itcam.toolkit.ai.aspectj.captureJDBC.CaptureSQLStatement' (CaptureSQLStatement.aj:833) [with runtime test] 04:21:13,718 INFO [STDOUT] weaveinfo Join point 'method-execution(boolean COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute())' in Type 'COM.ibm.db2.jdbc.app.DB2PreparedStatement' (DB2PreparedStatement.java:3971) advised by afterReturning advice from 'com.ibm.tivoli.itcam.toolkit.ai.aspectj.captureJDBC.CaptureSQLStatement' (CaptureSQLStatement.aj:946) [with runtime test]

Files changed in fix:
tests/bugs152/pr147801/Foo.java tests/bugs152/pr147801/PreparedStatement.java tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java weaver/src/org/aspectj/weaver/World.java weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java