2017-06-03 7 views
0

J'utilise la version grails 2.4.2. Lorsque je lance la commande run-app, l'application s'exécute correctement, pas d'erreur dans la console Intellij. Lorsque j'exécute la commande prod run-app, cela fonctionne aussi sans erreur. Mais quand je lance la commande run-war, l'erreur suivante est donnée. Je l'ai cherché mais aucune solution ne fonctionne pour mon cas ou je ne comprends pas. Quelqu'un peut-il m'aider s'il vous plaît s'il vous plaît pour mon cas? Je dois vraiment télécharger la guerre dans les 2 jours. Voici mon erreur ci-dessous dans la console Intellij >>>grails run-war provoquant SLF4J: Le chemin de classe contient plusieurs bindings SLF4J

|Done creating WAR target\alhikmah-0.1.war 
|Running Grails application 
Error | 
SLF4J: Class path contains multiple SLF4J bindings. 
Error | 
SLF4J: Found binding in [jar:file:/C:/Users/aina/.m2/repository/org/grails/grails-plugin-log4j/2.4.2/grails-plugin-log4j-2.4.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
Error | 
SLF4J: Found binding in [jar:file:/D:/projects/alhikmah/target/work/tomcat/webapps/alhikmah/WEB-INF/lib/grails-plugin-log4j-2.4.2.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] 
Error | 
log4j:WARN No appenders could be found for logger (org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener). 
Error | 
log4j:WARN Please initialize the log4j system properly. 
Error | 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 
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.reflect.MalformedParameterizedTypeException 
    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: java.lang.reflect.MalformedParameterizedTypeException 
    at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387) 
    at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114) 
    at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72) 
    at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56) 
    at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1131) 
    at java.beans.Introspector.getBeanInfo(Introspector.java:414) 
    at java.beans.Introspector.getBeanInfo(Introspector.java:161) 
    ... 5 more 
Error listenerStart 
Context [/alhikmah] startup failed due to previous errors 
The web application [/alhikmah] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 
The web application [/alhikmah] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 
The web application [/alhikmah] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. 
|Server running. Browse to http://localhost:8080/alhikmah 
|Server running. Browse to http://localhost:8080/alhikmah 

Répondre

0

Mise à niveau votre version Grails peut résoudre votre problème. Procédure de mise à niveau

  1. Project -> Clean

  2. application.properties -> Modifier app.grails.version = (Nouvelle version)

  3. Votre projet -> Propriétés -> Grails - > Changez l'installation des grails en une nouvelle version de gravier.

  4. Votre projet -> Outils Grails -> Actualiser dépendances

  5. Lancez votre projet

Ou un coup d'oeil sur elle Grails Upgrade

0

Ajouter ce code dans buildConfig.groovy

inherits("global") { 
     excludes 'grails-plugin-log4j' 
    }