2013-12-23 2 views
0

STS에서 war 파일을 만들 수 있지만 배포 할 수 없습니다! Grails 버전 2.1.1.Tomcat에서 Grails war-file을 실행할 수 없습니다.

나는 모든 종류의 게시물을 읽었으며, 깨끗하고, 업데이트되고, 컴파일되고, 실행되는 응용 프로그램 (잘 돌아 간다), 업그레이드 된 자바, 변경된 DB 드라이버 (postgresql : postgresql : 9.3-1100.jdbc41) 원본 경로에서 grails.servlet.version을 3.0으로 변경하여 이름을 지정하십시오.

내 설정은 현재 매우 바닐라이므로 신비한 플러그인이 필요하지 않습니다. 기록을 위해

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 
+1

다음 스택을 살펴보십시오. http://stackoverflow.com/questions/19410995/groovy-grails-tool-suite-noclassdeffounderror-on-war-deployment. 이것은 STS가 가지고있는 DomainClassUnitTest mixins/jar 파일을 포함하지 않는 버그입니다. 도움이 되길 바랍니다. – bschipp

+0

나는 그 지위를 보았고, 그것 모두를 시험해 보았다. .. 주사위 없음! – marko

+0

이 성가신 경우 grails를 전혀 업그레이드 할 수 있습니까? 믹스 인이 빌드를 무력화시키는 지 알고 싶다면 유니트 테스트를 지우는 것이 좋습니다. – bschipp

답변

1

:

나는 Tomcat을 사용하여 배포하거나 나는 다음과 같은 오류가 grails run-war를 실행하려고하면. 내가 무슨 짓을

복사했다 :

grails-plugin-testing-2.1.1.jar 
grails-test-2.1.1.jar 
grails-test-suite-base-2.1.1.jar 

내 Config.groovy 파일에 포레스트/lib에이에

(GRAILS_HOME/DIST에서 찾을 수 있습니다) :

grails.war.dependencies = [ 
    "grails-plugin-testing-2.1.1.jar", 
    "grails-test-2.1.1.jar", 
    "grails-test-suite-base-2.1.1.jar" 
] 

후 내가 깨끗하게하고, 집안을 만들고, 달리고

필자의 war-file에 테스트와 관련된 내용이 포함되지 않도록 필자는 test/prod가 분리되어있는 것처럼 보였습니다.

0

실제로 .war을 테스트해야하지만 귀하의 grails run-app 명령이 성공적으로 수행되고 응용 프로그램이 실행 중이라고 가정합니다. 그렇지 않니? 그것이라면 !! 난 당신이 다음과 같이 제안한다, 또한 위의 오류가 STS 환경 그 자체 ...에서 구성 Grails의에 대한 문제와 바람둥이 그래서 나 ... 것으로 보인다

내가 제안

1. Install `Tomcat 6` Outside for Testing the `.war` after generating using grails console and the command below 

2. Instead of running the war directly from the grails console try to generate a Test ,Development or a production environment `.war` package as follow . 

NB 당신은 ...

계속 .. Grails의 conf 폴더 아래에 당신의 config.groovy 파일 배포에 대한 환경 특정 설정이 필요

grails -Dgrails.env=development war 
,

또는, 단순히 당신이 성공적으로 위의 단계를 수행 한 So.After

grails deve war //here deve is referring to development environment u can do same for test and prod... 

... 당신이 ... 항아리에 당신에게 곡물을 수집 이렇게 생성 된 전쟁의 장소를 발견 할 때입니다 created grails application folder에있는 targets 폴더 아래에 있습니다.

그래서, startmanually 또는 automatically 먼저 Running Tomcat Server if any! .... 건배를 중지 ... webapps 서버 .goto TOmcat6/7를 시작하고 위에서 생성 된 패키지를 복사 한 후!

+0

! 누군가는 이것을 매우 유용하게 생각할 것입니다 (나는 잘 했어!). 그러나 나는이 문제에 얽매이지 않았습니다. – marko

관련 문제