2 Replies Latest reply on Oct 27, 2014 1:46 PM by formica

    JBoss AOP using JDK7

    srbhbajaj1411

      Hi,

       

      I am trying to use JDK 7 with JBoss AOP.

      I am using precompiled instrumentation approach.

      My code is getting compiled with JBoss AOP jars without any error but while running the server I am getting java.lang.VerifyError

       

      java.lang.VerifyError: StackMapTable error: bad offset in method com.test.DAO.ejb.TestBean.com$test$DAO$ejb$TestBean$modifyGroups$aop(Ljava/util/

      Vector;)Ljava/util/Hashtable;

              at java.lang.Class.getDeclaredMethods0(Native Method)

              at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

              at java.lang.Class.privateGetPublicMethods(Class.java:2562)

              at java.lang.Class.getMethods(Class.java:1427)

              at org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(AbstractVerifier.java:686)

              at org.jboss.verifier.strategy.EJBVerifier20.verifySessionBean(EJBVerifier20.java:848)

              at org.jboss.verifier.strategy.EJBVerifier20.checkSession(EJBVerifier20.java:78)

              at org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:181)

              at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:594)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

              at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)

              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

              at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)

              at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)

              at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)

       

      But if I compile my code without AOP precompilation and run its working fine.

       

      Also its working fine with the JDK 6 compilation.

       

      I think there is some compatibility issue here with the JDK7 or I might have to get the JBoss AOP libraries compiled with JDK7

       

      Can you please suggest me whats going wrong here.

        • 1. Re: JBoss AOP using JDK7
          stalep

          hi, without looking too closely into this, i think this change in jdk7 hotspot is the culprit:

           

          Important RFEs Addressed in JDK 7

          Area: HotSpot

          Synopsis: Classfiles with version number 51 are exclusively verified using the type-checking verifier, and thus the methods must have StackMapTable attributes when appropriate. For classfiles with version 50, the HotSpot JVM would (and continues to) failover to the type-inferencing verifier if the stackmaps in the file were missing or incorrect. This failover behavior does not occur for classfiles with version 51 (the default version for JDK7).

          Any tool that modifies bytecode in a version 51 classfile must be sure to update the stackmap information to be consistent with the bytecode in order to pass verification.

          RFE: 6693236

          there are zero development on jboss-aop atm (if not someone from the community start contributing) so your best workaround would probably be to set the compile target to version 50.

          • 2. Re: JBoss AOP using JDK7
            formica

            Thanks a lot for this old answer...I lost a couple of days on this !

            Andrea