4 Replies Latest reply on May 24, 2005 7:04 PM by chlabreu

    ArrayIndexOutOfBoundsException during field interception

    hengels

      jboss-aop 1.1.2, jdk 1.4.2_03-b02, standalone, instrumentation on classloading

      the xml:

      <aspect class="wilken.lib.log.aop.Trace" scope="PER_VM"/>
      
       <bind pointcut="execution(* wilken.cst.gui.*->*(..))">
       <advice name="trace" aspect="wilken.lib.log.aop.Trace"/>
       </bind>
      
       <bind pointcut="field(* wilken.cst.gui.*->*)">
       <advice name="trace" aspect="wilken.lib.log.aop.Trace"/>
       </bind>


      the exceptions are looking like this:

      java.lang.ArrayIndexOutOfBoundsException: 12
       at wilken.cst.gui.basics.kernel.KernelAbstract.state_r_$aop(KernelAbstract.java)
       at wilken.cst.gui.basics.kernel.KernelAbstract.wilken$cst$gui$basics$kernel$KernelAbstract$initialize$aop(KernelAbstract.java:202)

      and:
      java.lang.ArrayIndexOutOfBoundsException: 11
       at wilken.cst.gui.basics.kernel.KernelOptionsDefault.use2Tier_w_$aop(KernelOptionsDefault.java)
       at wilken.cst.gui.basics.kernel.KernelOptionsDefault.<init>(KernelOptionsDefault.java:121)


      not all field interceptions fail. only some read accesses and some write accesses. the array index differs from field to field. method interception is working perfectly.

      any ideas, what am I doing wrong?

      Regards,

      Holger

        • 1. Re: ArrayIndexOutOfBoundsException during field interception
          kabirkhan

          Can you post your KernelAbstract and KernelOptionsDefault classes?

          • 2. Re: ArrayIndexOutOfBoundsException during field interception
            hengels

            KernelOptionsDefault is more or less a plain java bean:

            public class KernelOptionsDefault
             implements KernelOptions, KernelConstants {
            
             public static String _ARVERSION_ = "_AV_ KernelOptionsDefault 3103 029470 pflaum 02.05.2005-18:53 _AV_";
            
             protected int processType = ProcessManagementConstants.PROCESSTYPE_JAVACLIENT;
             protected boolean simulateApplication = false;
             protected boolean mdi = false;
             protected boolean exitVMAfterStop = true;
             protected boolean use2Tier = false; // this was line 121 before comment stripping
             protected boolean skipIntro = false;
             protected char purpose = PURPOSE_PRODUCTIVE;
             protected AppConfigurationEntry[] entries = null;
             protected WProject project = GUIProject.getInstance();
             protected String loginContextName = null;
             protected GraphicConfiguration graphicConfiguration = null;
            
             public AppConfigurationEntry[] getEntries() {
             return entries;
             }
            
             public void setEntries( AppConfigurationEntry[] newEntries ) {
             entries = newEntries;
             }
            
             public GraphicConfiguration getGraphicConfiguration() {
             return graphicConfiguration;
             }
            
             public boolean isExitVMAfterStop() {
             return exitVMAfterStop;
             }
            
             // ...
            }




            • 3. Re: ArrayIndexOutOfBoundsException during field interception
              kabirkhan

              Hi,

              I had a very brief look (using my own class) but could not reproduce the error. If you have the time, could you please put together a simple test case that reproduces the problem and send it to me?

              Thanks

              • 4. Re: ArrayIndexOutOfBoundsException during field interception
                chlabreu

                O don´t know why, but it happens to me when I name a field begining with "_" character in the interceptor class to prevent recursive behaviour (interceptor trying to intercept its own fields)

                --
                minduim