本文介绍了Tomcat 6上的Grails 2.3.5 - 兼容性问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人将Tomcat6的Grails 2.3.5部署好了



在BuildConfig中我有 grails.servlet.version = 2.5



插件块如下所示:

  plugins {
build:release:3.0.1
uild:tomcat:7.0.50

compile:scaffolding:2.0.1
compile':cache:1.1.1'

runtime':hibernate:3.6.10.7
runtime:database-migration:1.3.8
runtime :jquery:1.10.2.2
runtime:resources:1.2.1

在启动时我收到以下异常:

lockquote
ERROR context.ContextLoader上下文初始化失败
org.springframework .beans.factory.BeanCreationException:错误
在ServletContext中定义了名称为'grailsApplication'的Bean
资源[/WEB-INF/applicationContext.xml]:调用init方法
失败;嵌套异常是java.lang.NoClassDefFoundError:
javax / servlet / AsyncContext

它在Tomcat7上启动得很好。我怀疑hibernate插件是否拖拽了对Servlet 3的依赖关系,但这只是对此阶段的猜测而已。

我升级到最新的小版本解决了这个问题。




  • 确保您升级到最新版本的Grails 2.3.x(当前为2.3。 11)。
    和更改application.properties中的值一样简单
  • 在您的BuildConfig.groovy中,确保设置
    grails.servlet.version =2.5



在这些更改之后,Grails up可以部署到Tomcat 6.0.x容器中。



希望它有助于
爱德华多


I was wondering if anyone had a luck deploying Grails 2.3.5 to Tomcat6

In BuildConfig I have grails.servlet.version = "2.5"

Plugins block looks like following:

plugins {
    build ":release:3.0.1"
    build ":tomcat:7.0.50"

    compile ":scaffolding:2.0.1"
    compile ':cache:1.1.1'

    runtime ":hibernate:3.6.10.7"
    runtime ":database-migration:1.3.8"
    runtime ":jquery:1.10.2.2"
    runtime ":resources:1.2.1"
}

On the startup I get following exception:

It starts up perfectly fine on Tomcat7. I have a suspicion that hibernate plugin is dragging hard dependency on Servlet 3, but that's just a guess at this stage.

解决方案

For me upgrading to latest minor version solve this issue.

  • Make sure you upgrade to the latest version of the Grails 2.3.x (currently 2.3.11).It is as easy as changing the value in the application.properties
  • In your BuildConfig.groovy make sure to setgrails.servlet.version = "2.5"

After these changes the Grails up could be deployed into Tomcat 6.0.x container.

Hope it helpsEduardo

这篇关于Tomcat 6上的Grails 2.3.5 - 兼容性问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:01