我已将Grails战争部署到我已安装Apache Tomcat 7的服务器中,但它没有启动。 这是堆栈跟踪,在catalina.out中给出:
2014-07-05 12:07:55,875 [http-bio-8080-exec-53] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invo
cation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
... 5 more
2014-07-05 12:07:55,883 [http-bio-8080-exec-53] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'pluginManager' defined in
ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on
null object
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invo
cation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
... 5 more
2014-07-05 12:07:55,886 [http-bio-8080-exec-53] ERROR context.GrailsContextLoader - Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletC
ontext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null obj
ect
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invo
cation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.j ava:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Cannot invoke method getAt() on null object
... 5 more
有关它的任何建议吗?
编辑: 战争不起作用的tomcat版本是7.0.54。我曾经在另一台机器上使用过早期版本(7.0.26)和战争开始。
答案 0 :(得分:2)
我尝试在Ubuntu 16.04测试版上运行我的Grails 2.2.4项目时遇到了同样的问题,并且正如评论中提到的Tomasz一样,它似乎是旧Grails版本,Java 8和更新版本的tomcat的组合。 tomcat 7和tomcat 8都有同样的问题。 我通过将我的Grails项目升级到Grails 2.3.11 解决了这个问题,这是我没有大规模重构代码所能做到的。切换到较旧的tomcat或Java 7不是我的选择。