Grails 3.3.0.RC Tomcat部署问题

时间:2017-07-05 09:34:38

标签: tomcat grails spring-boot asset-pipeline grails3

当我尝试在从3.2.9升级到3.3.0.RC1(在我的本地环境中正常工作)之后部署我的应用程序时,我发生以下错误消息。 我试过tomcat 8.0.20,8.0.28和8.5.16。有人知道可能出了什么问题吗?

随时询问更多信息。

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
}

3 个答案:

答案 0 :(得分:2)

仅供参考:与Grails 3.3.2有同样的问题 我的解决方案是:

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

因为quartz-monitor插件里面有旧版本的资产管道依赖。

答案 1 :(得分:0)

问题肯定是

BadgedIconDrawable

资产管道插件。我相对肯定插件已更新以解决此问题。

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

在2.13.2中看起来已修复

答案 2 :(得分:0)

我在build.gradle中调整了资产块并添加了minifyOptions。这就是它的样子

assets {
minifyJs = true
minifyCss = true

minifyOptions = [
        languageMode: 'ES6'
]

}