我可以在STS中構建war文件,但我無法部署! Grails版本2.1.1。我已經跑了乾淨,更新,編譯,運行應用程序(運行正常),升級Java,更改了db-drivers(postgresql:postgresql:9.3-1100.jdbc41),刪除了測試從源路徑,將grails.servlet.version
更改爲3.0,僅舉幾例。無法在Tomcat上運行Grails war-file
我的設置目前很漂亮,所以沒有神祕的插件。
當我嘗試使用Tomcat部署或運行grails run-war
我得到以下錯誤:
Dec 23, 2013 11:39:10 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 23, 2013 11:39:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 23, 2013 11:39:17 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass 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:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: java.lang.NoClassDefFoundError: Lgrails/test/mixin/domain/DomainClassUnitTestMixin;
at java.lang.Class.privateGetDeclaredFields(Class.java:2397)
at java.lang.Class.getDeclaredFields(Class.java:1806)
... 5 more
Caused by: java.lang.ClassNotFoundException: grails.test.mixin.domain.DomainClassUnitTestMixin
... 7 more
看看下面的堆棧:http://stackoverflow.com/questions/19410995/groovy-grails-tool-suite-noclassdeffounderror-on-war-deployment。看起來這是一個STS的bug,不包括他們所在的DomainClassUnitTest mixins/jar文件。希望有幫助。 – bschipp
我看到那篇文章,試了一下......沒有骰子! – marko
這是令人討厭的,是否有可能根本升級grails並查看是否可以修復它?我想這也可能是一個想法,可以刪除已創建的單元測試,如果你想看看它是否只是混搭破壞你的構建。 – bschipp