0

我有带有渲染插件 0.44 的 grails 2.0.4 应用程序。它在开发环境中工作正常,但是在生产中失败并出现 IncompatibleClassChangeError。

查看罐子以查看是否有任何重复或不兼容的地方,无法追踪任何可疑之处。尝试过干净的战争(grails clean,war)但没有帮助。

生产和开发测试都运行类似的设置,除了 java 次要版本 - java 1.6.0_65 (dev test/mac os) 和 java 1.6.0_30 (production/cent os)。

非常感谢任何帮助,谢谢!

这是我的 BuildConfig.groovy:

plugins{

------

compile ":qrcode:0.3"
compile ":rendering:0.4.4"
}

这是堆栈跟踪:

    org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [our function] of controller [com.x.ourcontroller]  caused exception: Runtime error executing action
        at org.grails.jaxrs.web.JaxrsFilter.doFilterInternal(JaxrsFilter.java:46)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        at java.lang.Thread.run(Thread.java:701)
Caused by: org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Runtime error executing action
        ... 7 more
Caused by: java.lang.reflect.InvocationTargetException
        ... 7 more
Caused by: java.lang.IncompatibleClassChangeError
        at grails.plugin.rendering.document.RenderEnvironment.init(RenderEnvironment.groovy:37)
        at grails.plugin.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:75)
        at grails.plugin.rendering.document.RenderEnvironment.with(RenderEnvironment.groovy:67)
        at grails.plugin.rendering.document.XhtmlDocumentService.generateXhtml(XhtmlDocumentService.groovy:64)
        at grails.plugin.rendering.document.XhtmlDocumentService.createDocument(XhtmlDocumentService.groovy:34)
        at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:36)
        at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:35)
        at grails.plugin.rendering.RenderingService.render(RenderingService.groovy:65)
        at RenderingGrailsPlugin$_closure3.doCall(RenderingGrailsPlugin.groovy:59)
        at com.xx.yy..
        ... 7 more
2014-03-19 20:55:52,025 [TP-Processor16] ERROR servlet.GrailsDispatcherServlet  - HandlerInterceptor.afterCompletion threw exception
java.lang.IncompatibleClassChangeError
        at org.grails.jaxrs.web.JaxrsFilter.doFilterInternal(JaxrsFilter.java:46)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        at java.lang.Thread.run(Thread.java:701)
2014-03-19 20:55:52,026 [TP-Processor16] ERROR servlet.GrailsDispatcherServlet  - HandlerInterceptor.afterCompletion threw exception
java.lang.IncompatibleClassChangeError
        at org.grails.jaxrs.web.JaxrsFilter.doFilterInternal(JaxrsFilter.java:46)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)        at java.lang.Thread.run(Thread.java:701)
4

1 回答 1

0

java.lang.IncompatibleClassChangeError 是由于不同插件之间的类之间的冲突而发生的,这些冲突是针对 jax-rs 插件的 MockHttpServletRequest 和 MockHttpServletResponse 类。尝试了最新的 jax-rs 插件(2.0.x grails 为 0.9),该插件在发行说明中提到这些已被删除。但是,这个版本的插件并没有解决问题。从战争中手动删除了 jax-rs 插件下的模拟目录,并将其重新打包为现在的解决方法。删除 mock/* 文件解决了这个问题。

于 2014-03-27T00:56:08.380 回答