Spring AOP gives IllegalArgumentException with Java 8

后端 未结 3 1359
孤街浪徒
孤街浪徒 2021-01-20 06:48

With Java 8 and Spring AOP 4.0.6 I am getting following error

    java.lang.RuntimeException: Error scanning file MonitorAroundPerformance.class
    at org.e         


        
相关标签:
3条回答
  • 2021-01-20 07:00

    If just upgrading to asm 5.* doesn't work for you, exclude all asm jars from jetty as well. This configuration worked for me:

            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.6.v20170531</version>
                <configuration>
                    <webApp>
                        <webInfIncludeJarPattern>.*/^(asm-all-repackaged)[^/]*\.jar$</webInfIncludeJarPattern>
                    </webApp>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>5.2</version>
                    </dependency>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm-commons</artifactId>
                        <version>5.2</version>
                    </dependency>
                </dependencies>
            </plugin>
    
    0 讨论(0)
  • 2021-01-20 07:02

    Jetty 9.2.0 is the first version of Jetty to support annotation and class scanning for JDK8.

    There was an update to the asm library we use, along with some api changes to support the new JDK8 bytecode scanning.

    You'll want to upgrade.

    0 讨论(0)
  • 2021-01-20 07:18

    I had similiar problem with GWT 2.8 web project (eclipse plugin, JAVA 8).

    My simple solution was to create GWT web project in a new eclipse workspace.

    0 讨论(0)
提交回复
热议问题