2013-05-28 19 views
5

Please help me, sto ricevendo errori mentre eseguo la mia app Grails.Grails 2.3 - run-app non funzionante

La mia applicazione funziona in Grails 2.1.4.

Sto usando

Groovy 2.1.* 
Java 1.7 
Tomcat 7.0.37 

ho aggiornato il mio applicazione dal Grails 2.1.4 a 2.3.0.M1. Dopo ho ricevuto un errore come questo:

| Loading Grails 2.3.0.M1 
| Configuring classpath 
| Error SLF4J: Class path contains multiple SLF4J bindings. 
| Error SLF4J: Found binding in [jar:file:/home/testuser/.m2/repository/org/grails/grails-plugin-log4j/2.3.0.M1/grails-plugin-log4j-2.3.0.M1.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
| Error SLF4J: Found binding in [jar:file:/home/testuser/.m2/repository/org/slf4j/slf4j-log4j12/1.6.6/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
| Error SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
| Error SLF4J: Actual binding is of type [org.slf4j.impl.GrailsSlf4jLoggerFactory] 
| Configuring classpath. 
| Environment set to development..... 
| Packaging Grails application..... 
| Compiling 143 source files. 
Copying properties file... 
| Compiling 143 source files..... 
Updated web.xml for session information 
| Running Grails application 
/mycompany/dev/testuser/ws2/myapp\..\sub-app\deploy\dev\log4j.xml 
| Running Grails application. 
| Error SLF4J: Class path contains multiple SLF4J bindings. 
| Error SLF4J: Found binding in [jar:file:/home/testuser/.m2/repository/org/grails/grails-plugin-log4j/2.3.0.M1/grails-plugin-log4j-2.3.0.M1.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
| Error SLF4J: Found binding in [jar:file:/home/testuser/.m2/repository/org/slf4j/slf4j-log4j12/1.6.6/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
| Error SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
| Error SLF4J: Actual binding is of type [org.slf4j.impl.GrailsSlf4jLoggerFactory] 
| Server running. Browse to http://localhost:8080/myapp 
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 org.codehaus.groovy.grails.exceptions.GrailsConfigurationException: Class not found loading Grails application: myapp.RefreshCustomerMatrixJob 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 
Caused by: org.codehaus.groovy.grails.exceptions.GrailsConfigurationException: Class not found loading Grails application: myapp.RefreshCustomerMatrixJob 
    ... 5 more 
Caused by: java.lang.ClassNotFoundException: myapp.RefreshCustomerMatrixJob 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423) 
    ... 5 more 
Error initializing the application: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsConfigurationException: Class not found loading Grails application: myapp.RefreshCustomerMatrixJob 
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 org.codehaus.groovy.grails.exceptions.GrailsConfigurationException: Class not found loading Grails application: myapp.RefreshCustomerMatrixJob 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 
Caused by: org.codehaus.groovy.grails.exceptions.GrailsConfigurationException: Class not found loading Grails application: myapp.RefreshCustomerMatrixJob 
    ... 5 more 
Caused by: java.lang.ClassNotFoundException: myapp.RefreshCustomerMatrixJob 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423) 
    ... 5 more 
| Error Exception in thread "Thread-7" 
| Error java.lang.RuntimeException: Forked Grails VM exited with error 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_attachOutputListener_closure5.doCall(ForkedGrailsProcess.groovy:220) 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_attachOutputListener_closure5.doCall(ForkedGrailsProcess.groovy) 
| Error  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
| Error  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
| Error  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
| Error  at java.lang.reflect.Method.invoke(Method.java:601) 
| Error  at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243) 
| Error  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) 
| Error  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) 
| Error  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085) 
| Error  at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) 
| Error  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) 
| Error  at groovy.lang.Closure.call(Closure.java:411) 
| Error  at groovy.lang.Closure.call(Closure.java:405) 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.attachOutputListener(ForkedGrailsProcess.groovy:228) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer.attachOutputListener(ForkedTomcatServer.groovy) 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.attachOutputListener(ForkedGrailsProcess.groovy) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer.attachOutputListener(ForkedTomcatServer.groovy) 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.fork(ForkedGrailsProcess.groovy:172) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer.fork(ForkedTomcatServer.groovy) 
| Error  at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.fork(ForkedGrailsProcess.groovy:141) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer.fork(ForkedTomcatServer.groovy) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure1.doCall(ForkedTomcatServer.groovy:122) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure1.doCall(ForkedTomcatServer.groovy) 
| Error  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
| Error  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
| Error  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
| Error  at java.lang.reflect.Method.invoke(Method.java:601) 
| Error  at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243) 
| Error  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) 
| Error  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) 
| Error  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085) 
| Error  at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) 
| Error  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) 
| Error  at groovy.lang.Closure.call(Closure.java:411) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure1.call(ForkedTomcatServer.groovy) 
| Error  at groovy.lang.Closure.call(Closure.java:405) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure1.call(ForkedTomcatServer.groovy) 
| Error  at groovy.lang.Closure.run(Closure.java:492) 
| Error  at org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure1.run(ForkedTomcatServer.groovy) 
| Error  at java.lang.Thread.run(Thread.java:722) 
+0

non può trovare 'myapp.RefreshCustomerMatrixJob' –

+0

Nel mio lavoro non esiste un file. Qualsiasi altro suggerimento, per favore. – Sun

+2

È causa di errore, non un suggerimento. Hai configurato l'app per utilizzare bean con questo nome classe –

risposta

4

Ho risposto a una domanda simile a How to migrate Grails 2.1 to Grails 2.3 application. In sintesi, confronta Config.groovy & BuildConfig.groovy con le versioni predefinite di una nuova app Grails 2.3. Assicurarsi che le dipendenze sono in BuildConfig.groovy invece di application.properties e che Tomcat, Hibernate e Ponteggi plugin sono versione corretta e hanno corretto la portata (costruire per Tomcat plug, runtime per Hibernate).

1

ho visto questa linea nel log degli errori:

Error Exception in thread "Thread-7" 
| Error java.lang.RuntimeException: Forked Grails VM exited with error 

Provare a commentare-out sezione grails.project.fork di BuildConfig.groovy

1

Ho avuto lo stesso errore e il problema era una differenza tra maiuscolo e minuscolo tra il nome del file e il nome della classe nel codice. Assicurati che il nome della tua classe e il nome del tuo file corrispondano esattamente.

Per esempio ho avuto il mio nome file come OAuthCallBackController.groovy e il nome della classe come OauthCallBackController (notare il minuscolo 'a')