AspectJ / Jetty / Java-8:错误扫描条目UpdateParserFiles.class

时间:2018-08-30 21:36:47

标签: intellij-idea java-8 jetty aop aspectj

我正在使用Aspectj(在sprint框架中不是)

使用码头9.4时,在运行时出现以下错误

Error scanning entry org/aspectj/org/eclipse/jdt/internal/compiler/parser/UpdateParserFiles.class from jar file:///C:/Users/<<user>>/IdeaProjects//<<my_app>>/<<my_module>>/build/libs/exploded/<<my_module>>.war/WEB-INF/lib/aspectjtools-1.8.13.jar

我的项目中的gradle部门是:

compile group: 'org.aspectj', name: 'aspectjrt', version: '1.8.13'
compile group: 'org.aspectj', name: 'aspectjtools', version: '1.8.13'

当我将Gradle Deps更改为:

compile group: 'org.aspectj', name: 'aspectjrt', version: '1.8.13'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.13'

记录不会发生(即调用代码未被截获)

我的代码段:

@Aspect
public class LoggerAspect {
  private static org.slf4j.Logger log = LoggerFactory.getLogger(LoggerAspect.class);

  @Around("execution(* *(..)) && @annotation(LogStats)")
  public Object around(ProceedingJoinPoint point) throws Throwable {
    long start = System.currentTimeMillis();
    Object result = point.proceed();
    log.info(
        "#%s(%s): %s in %[msec]s",
        MethodSignature.class.cast(point.getSignature()).getMethod().getName(),
        point.getArgs(),
        result,
        System.currentTimeMillis() - start
    );
    return result;
  }
}



@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface LogStats {

}

有什么想法会导致运行时异常,或者根本不会导致Aspectj代码被调用?

编辑

完整日志跟踪

java.lang.RuntimeException: Error scanning entry org/aspectj/org/eclipse/jdt/internal/compiler/parser/UpdateParserFiles.class from jar file:///C:/Users/ramchandanil/IdeaProjects/webcnh_aop/cnhmaster/build/libs/exploded/cnhmaster.war/WEB-INF/lib/aspectjtools-1.8.13.jar
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:880)
    at java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2897)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:872)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:836)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:471)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
    at java.lang.Thread.run(Thread.java:745)
Caused by: 
java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:230)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:158)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:146)
    at org.objectweb.asm.ClassReader.<init>(ClassReader.java:273)
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:932)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:917)
    at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:876)
    at java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2897)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:872)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:836)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:471)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
    at java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案