Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AspectJ class format error

aspectj-users,

Can anyone shed any light on the following stack trace:

Exception class: java.lang.ClassFormatErrorjava.lang.ClassFormatError: Code
attribute in native or abstract methods in class file com/snip3/SnipClass
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at com.snip2.CCDBMarshaller.setSnip(CCDBMarshaller.java:361)

    <...snip...>

    at 
com.snip1.subsnip1.CEReportRunner.processSnip(CEReportRunner.java:166)
    at 
com.snip1.subsnip1.CEReportRunner.run_aroundBody0(CEReportRunner.java:117)
    at 
com.snip1.subsnip1.CEReportRunner$AjcClosure1.run(CEReportRunner.java:1)
    at 
org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:101)
    at 
com.snip1.aspect.ReportTimingAspect.retAdvice(ReportTimingAspect.java:91)
    at com.snip1.subsnip1.CEReportRunner.run(CEReportRunner.java:91)
    at com.snip1.RunReport.runReport_aroundBody0(RunReport.java:154)
    at com.snip1.RunReport$AjcClosure1.run(RunReport.java:1)
    at 
org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:101)
    at 
com.snip1.aspect.ReportTimingAspect.tetAdvice(ReportTimingAspect.java:63)
    at com.snip1.RunReport.runReport(RunReport.java:148)
    at com.snip1.RunReport.main(RunReport.java:108)
 (com.snip1.subsnip1.CEReportRunner.run_aroundBody0)


Is this a bug in the AspectJ compiler?

The above was obtained using load-time weaving with the following aspect:

@Aspect
public class ReportTimingAspect
{
  /**
   *  Pointcut definition for the RunReport entry point
   */
  @Pointcut("execution(* com.snip1.RunReport+.runReport(..)) &&
!within(ReportTimingAspect)")
  public void totalPointcut()
  {
  }

  /**
   *  Pointcut definition for the ReportRunner.run() method
   */
  @Pointcut("execution(* com.snip1.ReportRunner+.run(..)) &&
!within(ReportTimingAspect)")
  public void runnerPointcut()
  {
  }

  /**
   * 
   * @param jp_
   */
  @Around("totalPointcut()")
  public Object tetAdvice(ProceedingJoinPoint jp_) throws Throwable
  {
    <...some code...>

    try
    {
    <...some code...>
      return jp_.proceed();
    }
    catch (Throwable t)
    {
      t.printStackTrace();
      throw t;
    }
    finally
    {
    <...some code...>
    }
  }

  /**
   * 
   * @param jp_
   */
  @Around("runnerPointcut()")
  public Object retAdvice(ProceedingJoinPoint jp_) throws Throwable
  {
    <...some code...>
    try
    {
    <...some code...>
      return jp_.proceed();
    }
    finally
    {
    <...some code...>
    }
  }

Any help is much appreciated.

Regards,

Jeff




Back to the top