2017-07-05 95 views
1

當我從3.2.9升級到3.3.0.RC1(在本地環境中正常工作)後嘗試部署我的應用程序時,出現以下錯誤消息。 我在tomcat 8.0.20,8.0.28和8.5.16中試過。有沒有人有一個想法可能出錯?Grails 3.3.0.RC Tomcat上的部署問題

請隨時索取更多信息。

2017-07-05 11:28:52.960 INFO --- [ost-startStop-2] fnx1.ApplicationLoader     : Starting ApplicationLoade 
r on krake08.fzi.de with PID 2015 (/usr/lib/apache-tomcat-8.5.16/webapps/ROOT/WEB-INF/classes started by root in /usr/li 
b/apache-tomcat-8.5.16) 
2017-07-05 11:28:52.966 DEBUG --- [ost-startStop-2] fnx1.ApplicationLoader     : Running with Spring Boot 
v1.5.4.RELEASE, Spring v4.3.9.RELEASE 
2017-07-05 11:28:52.966 INFO --- [ost-startStop-2] fnx1.ApplicationLoader     : The following profiles ar 
e active: production 
2017-07-05 11:28:57.013 ERROR --- [ost-startStop-2] o.s.boot.SpringApplication    : Application startup faile 
d 

java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean 
     at asset.pipeline.AssetPipelineGrailsPlugin$_doWithSpring_closure1.doCall(AssetPipelineGrailsPlugin.groovy:104) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:498) 
     at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) 
     at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) 
     at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) 
     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022) 
     at groovy.lang.Closure.call(Closure.java:414) 
     at groovy.lang.Closure.call(Closure.java:408) 
     at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:759) 
     at grails.spring.BeanBuilder.beans(BeanBuilder.java:588) 
     at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:531) 
     at org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:559) 
     at org.grails.plugins.AbstractGrailsPluginManager.doRuntimeConfiguration(AbstractGrailsPluginManager.java:167) 
     at grails.boot.config.GrailsApplicationPostProcessor.postProcessBeanDefinitionRegistry(GrailsApplicationPostProc 
essor.groovy:171) 
     at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostPro 
cessorRegistrationDelegate.java:118) 
     at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplic 
ationContext.java:687) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext 
.java:122) 
     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) 
     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) 
     at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) 
     at grails.boot.GrailsApp.run(GrailsApp.groovy:83) 
     at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) 
     at org.grails.boot.context.web.GrailsAppServletInitializer.createRootApplicationContext(GrailsAppServletInitiali 
zer.groovy:57) 

... 

非常感謝!

編輯:我追加我的build.gradle文件。也許這有助於解決問題。

buildscript { 
    ext { 
     grailsVersion = project.grailsVersion 
    } 
    repositories { 
     mavenLocal() 
     maven { url "https://repo.grails.org/grails/core" } 

     maven { url "http://dl.bintray.com/grails/plugins" } 
     maven { url "http://dl.bintray.com/zyro/maven" } //Websocket 
     maven { url "http://dl.bintray.com/jamescookie/plugins" } //Quartz Monitor 
     maven { url "http://download.java.net/maven/2/" } 
     maven { url "http://repo.spring.io/milestone/" } 
     maven { url "http://mvnrepository.com/artifact/" } 
     maven { url "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3" } //StringEscapeUtils 
    } 
    dependencies {   
     classpath "org.grails:grails-gradle-plugin:$grailsVersion" 
     classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" 
//  classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0' 
//  classpath 'org.grails.plugins:asset-pipeline:3.2.1' 
     classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2" 
     classpath "org.grails.plugins:hibernate4:5.0.0" //hibernate:4.3.10.7 
    } 
} 

//plugins { 
// id "io.spring.dependency-management" version "0.5.2.RELEASE" 
//} 

version "1.0.0" 
group "fnx1" 

apply plugin: "org.springframework.boot" 
apply plugin: "war" 
apply plugin: "asset-pipeline" 
apply plugin: 'eclipse' 
apply plugin: 'idea' 
apply plugin: "org.grails.grails-web" 
apply plugin: "org.grails.grails-gsp" 

ext { 
    grailsVersion = project.grailsVersion 
    gradleWrapperVersion = project.gradleWrapperVersion 

    set "tomcat.version", "8.5.5" 
} 

assets { 
    minifyJs = true 
    minifyCss = true 
} 

repositories { 
    mavenLocal() 
    maven { url "https://repo.grails.org/grails/core" } 
} 

dependencyManagement { 
    imports { 
     mavenBom "org.grails:grails-bom:$grailsVersion" 
    } 
    applyMavenExclusions false 
} 

dependencies { 

    compile "org.springframework.boot:spring-boot-starter-logging" 
    compile "org.springframework.boot:spring-boot-autoconfigure" 
    compile "org.grails:grails-core" 
    compile "org.springframework.boot:spring-boot-starter-actuator" 
    provided "org.springframework.boot:spring-boot-starter-tomcat" 
// compile "org.grails:grails-dependencies" 
    compile "org.grails:grails-logging" 
    compile "org.grails:grails-plugin-rest" 
    compile "org.grails:grails-plugin-databinding" 
    compile "org.grails:grails-plugin-i18n" 
    compile "org.grails:grails-plugin-services" 
    compile "org.grails:grails-plugin-url-mappings" 
    compile "org.grails:grails-plugin-interceptors" 
    compile "org.grails:grails-web-boot" 
    compile "org.grails.plugins:cache" 
    compile "org.grails.plugins:scaffolding" //runtime 
    compile "org.grails.plugins:hibernate5" 
    compile "org.grails.plugins:async" 
    compile "org.grails.plugins:scaffolding" 
    compile "org.grails.plugins:events" 
    compile "org.hibernate:hibernate-ehcache" 
    compile "org.hibernate:hibernate-core:5.1.5.Final" 
    compile "org.grails.plugins:gsp" 
    console "org.grails:grails-console" 

    console "org.grails:grails-console" 
    profile "org.grails.profiles:web:3.1.0" //new 
    compile "javax.xml.soap:saaj-api:1.3.4" 
    compile "com.sun.xml.messaging.saaj:saaj-impl:1.3" 

// compile "org.grails.plugins:asset-pipeline:3.2.1" //:3.2.1 
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.2" 

    testCompile "org.grails:grails-plugin-testing" 
    testCompile "org.grails.plugins:geb" 

    // Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.) 
    testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1' 
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" 


    //Own dependencies - Start 

// compile 'org.grails.plugins:spring-security-core:3.1.1' 
    compile 'org.grails.plugins:spring-security-core:3.2.0.M1' 
// compile 'org.grails.plugins:spring-security-appinfo:3.0.0' 
    compile 'org.grails.plugins:quartz:2.0.12' 
// compile 'org.grails.plugins:quartz-monitor:1.3' 
// compile 'org.grails.plugins:mail:2.0.0.RC6' 
    compile 'org.grails.plugins:grails-spring-websocket:2.3.0' 

// compile 'org.grails.plugins:database-migration:2.0.0.RC1' 
// compile 'org.liquibase:liquibase-core:3.3.2' 

// compile 'org.apache.commons:commons-lang3:3.1' 
// compile "org.grails.plugins:cookie-session:3.0.0" 

    runtime "org.postgresql:postgresql:9.4-1204-jdbc42" 

    //Own dependencies - End 
} 

task wrapper(type: Wrapper) { 
    gradleVersion = gradleWrapperVersion 
} 
+0

我已經檢查過這個帖子,但是,我的spring-security-core版本是3.2.0.M1,因此這不應該是問題:https://stackoverflow.com/questions/44246993/error-on-running -grails-project – Kloker

+0

好的,我發現插件quartz-monitor:1.3似乎是這裏問題的一部分。有沒有辦法配置不同的東西,還是需要等待新的插件版本? – Kloker

回答

1

FYI:曾與同樣的問題Grails的3.3.2 我的解決辦法的解決辦法是:

compile ('org.grails.plugins:quartz-monitor:1.3'){ 
    exclude group: 'org.grails.plugins', module: 'asset-pipeline' 
} 

由於石英監控插件有一個老版本中的資產管道依賴關係。

+0

謝謝!似乎在開發環境中工作!只要我能夠在生產環境中進行測試,我就會正式接受答案。 – Kloker

0

問題肯定

at asset.pipeline.AssetPipelineGrailsPlugin$_doWithSpring_closure1.doCall(AssetPipelineGrailsPlugin.groovy:104) 

是資產流水線插件。我相對確定插件已更新以解決此問題。

https://github.com/bertramdev/asset-pipeline/issues/145

看起來像固定在2.13.2

+0

感謝您的回答。我正在使用「com.bertramlabs.plugins:asset-pipeline-grails:2.14.2」;這是我知道的最新的,因此不應該是問題。 – Kloker

+0

@Kloker類路徑上的版本不可能是您列出的版本。 –

+0

感謝您的快速反饋。我附加了我的build.gradle文件,其中顯示了我使用的插件版本。該應用程序像這樣運行(已經在生產環境中)。如果我提供的版本沒有加載到類路徑中,我可能需要改變什麼? – Kloker

0

我調整資產內的build.gradle並加入minifyOptions阻塞。下面是它看起來像

assets { 
minifyJs = true 
minifyCss = true 

minifyOptions = [ 
     languageMode: 'ES6' 
] 

}