Community
Participate
Working Groups
Created attachment 230773 [details] Sources, logs and aop.xml. I've written an @AspectJ aspect tracing execution times of JDBC queries in web application running on Tomcat. After adding the executeSqlAdvice advice the application startup fails with VerifyError on com.informix.jdbc.IfxStatement.executeQuery("select site from informix.systables where tabname = ' GL_COLLATE'"). Unfortunately I cannot tell you details about the VerifyError, because my Eclipse (Juno) doesn't show it though it should (yes, I checked the "Open popus when suspended on exception" and restarted the IDE). I tried various changes, including specifying com.informix.. clases instead their java.sql ancestors, explicit pointcuts, not using wildcard in method names among others. Then I tried to rewrite the aspect not to use specific advice for methods with execute*() and execute*(String, ..) signatures - and this solution works. JdbcDriverMonitor_VerifyError.java - the failing aspect. JdbcDriverMonitor.java - the working aspect.
Oh, I forgot: I observe the behavior on versions 1.6.7 and 1.7.2 of AspectJ obtained via Maven.
just to be sure: 1) have you controlled that the libraries at compile time nad runtime are the same ( duplicate libraries in classpath with different versions ). 2 ) Did you clear the work directory of Tomcat ? 3 ) Try with -noverify in JVM parameter
4) replace throws Throwable by throws java.sql.SQLException when needed
ad 1) Though I've found several "conflicting" jars, I don't think this is the problem. The verify error occurs very early, during preparing JDBC datasource, before the actual web application ever starts. And the "conflicting" jars are used by app's business. Tomcat is started with this VM arguments: -Dcatalina.base="C:\develop\icz\amishd\tomcat_deploy" -Dcatalina.home="C:\Develop\tomcat\apache-tomcat-7.0.39" -Dwtp.deploy="C:\develop\icz\amishd\tomcat_deploy\wtpwebapps" -Djava.endorsed.dirs="C:\Develop\tomcat\apache-tomcat-7.0.39\endorsed" -Damishd.run.profileXXX=localhost -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF8 -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -javaagent:"C:\Users\roztocil\.m2\repository\org\aspectj\aspectjweaver\1.6.7\aspectjweaver-1.6.7.jar" In wtp.deploy.txt and catalina.home.lib.txt attachments you can see the the content of the respective folder. The endorsed folder doesn't exist at all. ad 2) Yes, behaviour unchanged. ad 3) With -noverify JVM crashes like this: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d90e92f, pid=1368, tid=5380 # # JRE version: 6.0_43-b01 # Java VM: Java HotSpot(TM) Client VM (20.14-b01 mixed mode windows-x86 ) # Problematic frame: # V [jvm.dll+0x4e92f] # # An error report file with more information is saved as: # C:\develop\icz\amishd\amishd_web\src\main\webapp\hs_err_pid1368.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # ad 4) I can't cacth your proposal. If I change Throwable for SQLException, I can't call aPjp.proceed() in @Around advices. And there are no other possible places for such change.
Created attachment 230928 [details] Content of the %CATALINA_HOME%\lib folder.
Created attachment 230929 [details] Content of the wtp.deploy folder. "conflicting" jars marked with '###' at the end of the line.
About the severity of this issue: I don't need this issue resolved, because I've found a workaround. But I've reported it to let you know about a problem, which for someone other could be blocking.
Sorry, another possibility of conflicting jars is : C:\Develop\tomcat\apache-tomcat-7.0.39\lib\tomcat-dbcp.jar vs C:\develop\icz\amishd\tomcat_deploy\wtpwebapps\amishd_web\WEB-INF\lib\commons-dbcp-1.4.jar try to delete/rename one of them. Also try to run JVM in server mode -server ( needs JDK)
I see also that a version 1.7.2 of aspectJ is used in WEB-INF/lib. Try to use the same version for your aspectj agent ( in case of overweaving/reweaving ). Experts should be more clear than me.