我正在尝试将我的应用程序从2.6.1升级到2.7并且我正在执行以下异常执行目标org.codehaus.mojo:gwt-maven-plugin:2.7.0:在我的项目上编译(默认):< / p>
[INFO] Compiling module cern.edms.ui.Application
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.IllegalArgumentException
[INFO] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[INFO] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor.<init>(BytecodeSignatureMaker.java:59)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
我发现信息可能是因为我的类路径中的ASM版本错误(Strange error during running GWT 2.7 in DevMode),因此我检查了它。实际上在我的classpath中有两个版本的ASM:4.2和5.0.3。这是因为其中一个依赖项依赖于依赖于ASM 4.2的cglib。 GWT依赖于ASM 5.0.3。
这是我的完整类路径:
[DEBUG] GWT SDK execution classpath :
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\edms-ui-6.1.0-SNAPSHOT\WEB-INF\classes
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\src\main\java
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\generated-sources\gwt
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\generated-sources\gwt\**
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-procedures\target\edms-procedures-6.1.0-SNAPSHOT.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\oracle\ojdbc6\11.2.0.3.0\ojdbc6-11.2.0.3.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-context\4.0.9.RELEASE\spring-context-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-expression\4.0.9.RELEASE\spring-expression-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-core\4.0.9.RELEASE\spring-core-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-jdbc\4.0.9.RELEASE\spring-jdbc-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-tx\4.0.9.RELEASE\spring-tx-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\sun\mail\javax.mail\1.5.4\javax.mail-1.5.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-shared\target\edms-shared.jar
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-search\target\edms-search.jar
[DEBUG] C:\Users\kpater\.m2\repository\cglib\cglib\3.1\cglib-3.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm\4.2\asm-4.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\ws\spring-ws-core\2.1.4.RELEASE\spring-ws-core-2.1.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\ws\spring-xml\2.1.4.RELEASE\spring-xml-2.1.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-oxm\3.2.4.RELEASE\spring-oxm-3.2.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-webmvc\3.2.4.RELEASE\spring-webmvc-3.2.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\wsdl4j\wsdl4j\1.6.1\wsdl4j-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\apache\httpcomponents\httpclient\4.3.1\httpclient-4.3.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\apache\httpcomponents\httpcore\4.3\httpcore-4.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-codec\commons-codec\1.6\commons-codec-1.6.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\weblogic\wls-api\12.1.1\wls-api-12.1.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\ch\cern\sso\wlsAttributeNameMapper\1.9\wlsAttributeNameMapper-1.9.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwt-user\2.7.0\gwt-user-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\web\bindery\requestfactory-server\2.7.0\requestfactory-server-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\extjs\gxt\2.3.1a-gwt22\gxt-2.3.1a-gwt22.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\sencha\gxt\gxt\3.1.4\gxt-3.1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\googlecode\mvp4g\mvp4g\1.4.0\mvp4g-1.4.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\inject\gin\1.5.0\gin-1.5.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\inject\guice\3.0-rc2\guice-3.0-rc2.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\inject\extensions\guice-assistedinject\3.0-rc2\guice-assistedinject-3.0-rc2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-web\4.0.9.RELEASE\spring-web-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-beans\4.0.9.RELEASE\spring-beans-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-aop\4.0.9.RELEASE\spring-aop-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\aspectj\aspectjrt\1.8.2\aspectjrt-1.8.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\aspectj\aspectjweaver\1.8.2\aspectjweaver-1.8.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\persistence\persistence-api\1.0\persistence-api-1.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-aspects\4.0.9.RELEASE\spring-aspects-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\hibernate\hibernate-validator\4.1.0.Final\hibernate-validator-4.1.0.Final.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\hibernate\hibernate-validator\4.1.0.Final\hibernate-validator-4.1.0.Final-sources.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\slf4j\slf4j-log4j12\1.6.1\slf4j-log4j12-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\slf4j\slf4j-api\1.6.1\slf4j-api-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwtmockito\gwtmockito\1.1.5\gwtmockito-1.1.5.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwt-dev\2.7.0\gwt-dev-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-util\5.0.3\asm-util-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-tree\5.0.3\asm-tree-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-commons\5.0.3\asm-commons-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\javassist\javassist\3.17.1-GA\javassist-3.17.1-GA.jar
如何从类路径中排除4.2版中的ASM?
感谢您的帮助!
答案 0 :(得分:0)
理想情况下,您只需将项目拆分为单独的客户端和服务器代码模块,这样就可以避免像这样的类路径冲突。您可以从这些原型中汲取灵感:https://github.com/tbroyer/gwt-maven-archetypes
但是,鉴于ASM 4+保证了向后兼容性,您也可以使用ASM 5代替ASM 4:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-parent</artifactId>
<version>5.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
答案 1 :(得分:0)
我终于通过在cglib依赖项中排除ASM来设法构建项目。这是我的代码:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.1</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
答案 2 :(得分:0)
假设gwt-maven-plugin文档,您可以设置runClasspathExclude属性,以便在运行dev模式时从classPath中排除jars(并且仅在DEV模式下):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<runClasspathExcludes>
<runClasspathExclude>jetty-webapp-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-xml-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-util-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-servlet-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-security-9.2.4.v20141103.jar</runClasspathExclude>
</runClasspathExcludes>
</configuration>
</plugin>
请注意,此配置由&#34;运行&#34;仅限目标:mvn gwt:run