使用 Java 8 和 Spring AOP 4.0.6 我收到以下错误
java.lang.RuntimeException: Error scanning file MonitorAroundPerformance.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:705)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:531)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)
Caused by:
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:970)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:700)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:686)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:821)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:531)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
at java.lang.Thread.run(Thread.java:745)
但是,当我将 Java Source 和 target 更改为 1.7 时,此错误就会消失。
POM.xml 设置 -
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.0.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Eclipse Kepler 中构建路径中的 jar - spring-aop-4.0.6 、aspectjrt-1.8.2.jar、aopalliance-1.0.jar、jetty-maven-plugin:9.1.1.v20140108
Config:
<bean id="performanceAdvice"
class="com.util.MonitorAroundPerformance" />
<bean id="performanceAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"
depends-on="propertyOverrideConfigurer">
<property name="advice" ref="performanceAdvice" />
</bean>
<bean
class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
<property name="proxyTargetClass" value="true" />
</bean>
Jetty 9.2.0是Jetty第一个支持JDK8的注解和类扫描的版本.
我们使用的 asm 库进行了更新,同时还进行了一些 api 更改以支持新的 JDK8 字节码扫描。
你会想要升级。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)