2014-04-23 28 views
1

我需要將我的應用程序從2.2.1 grails升級到2.3.6(2.3.7在MongoDB中有一些錯誤)。 升級我喜歡後錯誤:升級後的Grails run-app錯誤2.2.1至2.3.6

java.lang.NoClassDefFoundError: org/springframework/jmx/support/RegistrationPolicy 
    at java.lang.Class.getDeclaredMethods0(Native Method) 
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531) 
    at java.lang.Class.getDeclaredMethods(Class.java:1855) 
    at org.springframework.core.type.StandardAnnotationMetadata.hasAnnotatedMethods(StandardAnnotationMetadata.java:161) 
    at org.springframework.context.annotation.ConfigurationClassUtils.isLiteConfigurationCandidate(ConfigurationClassUtils.java:106) 
    at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:87) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:233) 
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) 
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451) 
    at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:156) 
    at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:169) 
    at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127) 
    at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:122) 
    at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:108) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    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:745) 
Caused by: java.lang.ClassNotFoundException: org.springframework.jmx.support.RegistrationPolicy 
    at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:175) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) 
    at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:147) 
    at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:51) 
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358) 

我BuildConfig.groovy樣子:

dependencies { 
     // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg. 
     compile "org.jadira.usertype:usertype.jodatime:1.9" 
     compile "org.im4java:im4java:1.2.0" 
     compile "org.apache.commons:commons-lang3:3.3.2" 
     compile "com.googlecode.json-simple:json-simple:1.1.1" 
     compile "com.rabbitmq:amqp-client:3.1.3" 
     compile ("org.springframework.amqp:spring-rabbit:1.2.1.RELEASE") { 
      excludes "amqp-client" 
     } 
     compile 'org.activiti:activiti-engine:5.12.1' 
     compile 'org.activiti:activiti-spring:5.12.1' 
     compile ('org.activiti:activiti-rest:5.12.1'){ 
      excludes 'slf4j-api' 
      excludes 'slf4j-log4j' 
      excludes 'slf4j-log4j12' 
     } 
     compile 'org.activiti:activiti-modeler:5.12.1' 
     compile 'org.activiti:activiti-bpmn-converter:5.12.1' 
     compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13' 
     compile 'org.elasticsearch:elasticsearch-lang-groovy:2.0.0' 
     compile 'com.itextpdf:itextpdf:5.0.6' 
     compile 'org.springframework.integration:spring-integration-http:2.2.1.RELEASE' 
     compile 'pl.fissst:fis-bps-api:1.0.0' 
     compile "net.sf.ehcache:ehcache-core:2.4.6" 

     //-------------------- 

     runtime 'org.postgresql:postgresql:9.3-1101-jdbc41' 
     runtime "org.apache.pdfbox:pdfbox:1.8.4" 
     runtime 'org.elasticsearch:elasticsearch:1.0.0' 
     runtime 'com.vividsolutions:jts:1.13' 
     runtime 'org.apache.httpcomponents:httpclient:4.3.3' 
     runtime 'org.jsoup:jsoup:1.7.3' 

     //--------------------- 

     test "xmlunit:xmlunit:1.4" 
     test "org.spockframework:spock-grails-support:0.7-groovy-2.0" 
     test "org.gebish:geb-spock:$gebVersion" 
     test "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" 

     //--------------------- 

     //provided 'cglib:cglib:3.1' // uncomment to enable java-melody support 
    } 

    plugins { 
     build ":tomcat:7.0.52.1" 
     build ':release:3.0.1' 
     build (':rest-client-builder:2.0.1'){ 
      export = false 
     } 

     //------------------ 

     compile ':jmx:0.9' 
     compile (":mail:1.0.4") { 
      excludes 'spring-test' 
     } 
     compile ":joda-time:1.4" 
     compile ":csv:0.3.1" 
     compile ':mongodb:2.0.1' 
     compile ':fixtures:1.2' 
     compile ':build-test-data:2.1.2' 
     compile ':teamcity:1.0.3' 
     compile ':transaction-handling:0.1.3' 
     compile ':plugin-config:0.2.0' 
     compile ":rest:0.8" 
     compile(':excel-export:0.2.1') { 
      excludes "xercesImpl" 
     } 
     compile ':spring-security-core:2.0-RC2' 
     compile ":spring-security-oauth2-provider:1.0.5.2" 
     compile ':webxml:1.4.1' 

     //---------------- 

     runtime ":hibernate:3.6.10.10" 
     runtime ':executor:0.3' 
     //runtime ':hibernate4:4.3.4.2' 
     runtime ':database-migration:1.4.0' 
     runtime ':quartz:1.0.1' 
     runtime ":resources:1.2.7" 
     runtime (":activiti:5.12.1") { 
      excludes 'org.activiti:activiti-engine:5.12.1' 
      excludes 'org.activiti:activiti-spring:5.12.1' 
     } 
//  runtime ':grails-melody:1.48.0-fis' 

     //----------------- 

     test ':code-coverage:1.2.7' 
     test ":geb:$gebVersion" 
     test ":cucumber:0.9.0" 
    } 

任何人有任何想法來解決這個問題?

+2

你有沒有看過'依賴報告'的任何衝突的依賴? – dmahapatro

回答

0

Grails 2.2.1基於Spring 3.1.2,而Grails 2.3.6基於Spring 3.2.8。無法找到的課程是org.springframework.jmx.support.RegistrationPolicy,自3.2開始就是Spring的一部分。
這可能意味着您的一個依賴或插件取決於Spring的舊版本,它與Grails提供的版本衝突。找到它的最好方法是運行一個dependency report,找到這個依賴並排除它。有關更多詳細信息,請參閱關於dependency resolution的Grails文檔部分。

+1

謝謝,實際上它是來自活動的老春依賴問題:) – lukisp

相關問題