我想知道是否有人有幸将 Grails 2.3.5 部署到 Tomcat6
在 BuildConfig 中我有 grails.servlet.version = "2.5"
插件 block 如下所示:
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"
}
启动时出现以下异常:
ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is 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 容器中。
希望对你有帮助 爱德华多
关于tomcat - Tomcat 6 上的 Grails 2.3.5 - 兼容性问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21693496/