Grails Release Plugin的间歇性Java链接错误

时间:2015-10-13 18:47:45

标签: java grails grails-2.3

在使用Grails Release插件时,我偶尔会遇到Java Linkage错误,并且完全不知道如何解决问题。我会很感激一些建议。错误各不相同,但区域相同。

尝试运行publish-plugin时,我看到以下类型的错误消息:

09:32:36 | Generating POM file.....
09:32:36 | Error Error executing script PublishPlugin: Class org.apache.http.message.BasicNameValuePair does not implement the requested interface org.apache.http.NameValuePair (Use --stacktrace to see the full trace)

堆栈跟踪的另一个例子是:

09:08:57 | Error java.lang.LinkageError: loader constraint violation: when resolving method "org.apache.http.impl.cookie.NetscapeDraftHeaderParser.parseHeader(Lorg/apache/http/util/CharArrayBuffer;Lorg/apache/http/message/ParserCursor;)Lorg/apache/http/HeaderElement;" the class loader (instance of groovy/lang/GroovyClassLoader) of the current class, org/apache/http/impl/cookie/BestMatchSpec, and the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) for resolved class, org/apache/http/impl/cookie/NetscapeDraftHeaderParser, have different Class objects for the type arser.parseHeader(Lorg/apache/http/util/CharArrayBuffer;Lorg/apache/http/message/ParserCursor;)Lorg/apache/http/HeaderElement; used in the signature
09:08:57 | Error    at org.apache.http.impl.cookie.BestMatchSpec.parse(BestMatchSpec.java:134)
09:08:57 | Error    at org.apache.http.client.protocol.ResponseProcessCookies.processCookies(ResponseProcessCookies.java:115)
09:08:57 | Error    at org.apache.http.client.protocol.ResponseProcessCookies.process(ResponseProcessCookies.java:96)
09:08:57 | Error    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:117)
09:08:57 | Error    at org.apache.http.protocol.HttpRequestExecutor.postProcess(HttpRequestExecutor.java:345)
09:08:57 | Error    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:528)
09:08:57 | Error    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
09:08:57 | Error    at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:137)
09:08:57 | Error    at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:294)
09:08:57 | Error    at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:250)
09:08:57 | Error    at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59)
09:08:57 | Error    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:418)
09:08:57 | Error    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:337)
09:08:57 | Error    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)

再次运行命令,之后直接成功。

我认为这个问题与捆绑一个版本的httpcore(4.2.4)的grails有关或由其引起,但我希望使用更新的版本(4.4.1)

我尝试在build config的继承('global')部分中排除httpcore:

inherits('global') {
    excludes 'httpcore'
} 

正如此回答How to exclude grails global dependency所建议的那样无效以及此答案建议的其他特定依赖关系Grails --- loader constraint violation。我还升级到了最新版本的发布插件。

错误发生在Jenkins构建过程的一部分,使用在RedHat Linux 7和JDK 1.7.0上运行的grails 2.3.8(我还尝试了许多更新版本以查看是否存在问题)

0 个答案:

没有答案