2016-04-18 10 views
0

Hibernate5プラグインでのGrails 3.1.5では、JBoss EAP 6.4.0.GAにはデプロイできません。Grails 3.1.5、JBossでのHibernate 5のスローNoSuchMethodError org.jboss.logging.Logger.debugf

私が取得:

NoSuchMethodError: org.jboss.logging.Logger.debugf(Ljava/lang/String;I)V 

私はときに私は、Hibernate 5は、JBoss-ログイン3に依存しているため、問題があると私は私のbuild.gradleファイルにあるjboss-ログ3を含めたにも関わらず、信じていますJBossにデプロイする前に、新しい "f"メソッドを含まないjboss-loggingの以前のバージョン、つまりdebugf()を使っていると思います。

Grails 3およびHibernate 5アプリケーションをJBoss EAP 6.4.0に正しくデプロイするにはどうすればよいですか?

私のbuild.gradleファイルには、次のとおりです。

buildscript { 
    ext { 
     grailsVersion = project.grailsVersion 
    } 
    repositories { 
     mavenLocal() 
     maven { url "https://repo.grails.org/grails/core" } 
    } 
    dependencies { 
     classpath "org.grails:grails-gradle-plugin:$grailsVersion" 
     classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0" 
     classpath "org.grails.plugins:hibernate5:5.0.4" 
     classpath "org.grails.plugins:views-gradle:1.0.4" 
     classpath "org.jboss.logging:jboss-logging:3.3.0.Final" 
    } 
} 

version ... 
group ... 

apply plugin:"eclipse" 
apply plugin:"idea" 
apply plugin: "war" 
apply plugin: "org.grails.grails-web" 
apply plugin: "org.grails.grails-gsp" 
apply plugin:"asset-pipeline" 
apply plugin: "org.grails.plugins.views-json" 

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

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" 
    testCompile "org.springframework.boot:spring-boot-starter-tomcat" 
    compile "org.grails:grails-dependencies" 
    compile "org.grails:grails-web-boot" 
    compile "org.grails.plugins:cache" 
    compile "org.grails.plugins:scaffolding" 
    compile "org.grails.plugins:views-json" 

    compile "org.grails.plugins:hibernate5" 
    testCompile "org.grails.plugins:hibernate5" 
    compile "org.hibernate:hibernate-core:5.1.0.Final" 
    compile "org.hibernate:hibernate-ehcache:5.1.0.Final" 

    console "org.grails:grails-console" 
    profile "org.grails.profiles:web:3.1.5" 
    runtime "org.grails.plugins:asset-pipeline" 
    runtime "com.h2database:h2" 

    runtime files('grails-app/lib/ojdbc7.jar', 'grails-app/lib/xdb6.jar') 
    compile files('grails/src/java') 

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

    testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:2.52.0" 
    testRuntime "org.seleniumhq.selenium:selenium-support:2.52.0" 

    console "org.grails:grails-console" 

    runtime "org.jboss.logging:jboss-logging:3.3.0.Final" 
} 

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

assets { 
    minifyJs = false // This will probably break dependency injection in our AngularJs artifacts that use DI. 
    minifyCss = true 
} 

答えて

1

のJBoss EAP 6.4は、Hibernate 4.xを使用していますJPAプロバイダのバージョンを混在させることはお勧めしません。 Hibernate 4の依存関係が確実に含まれないように、JPAサブシステムをデプロイメントから除外する必要があります。 EAP 6はJava EE 6コンテナであり、Hibernate 5はJava EE 7の一部であるJPA 2.1用であるため、JPA APIの依存関係も明示的に除外する必要があります。

これらの問題を分類しておけば、また、jboss-loggingの依存関係がデプロイメントに追加されないようにする必要があります。 EAP 6.4を使用すると、すべての展開に影響を及ぼすログサブシステムの属性を設定できます。 add-logging-api-dependencies属性をfalseに変更し、展開に必要なjboss-loggingのバージョンを含めます。

/subsystem=logging:write-attribute(name=add-logging-api-dependencies, value=false) 

あなたが依存関係を無視するだけで、単一の展開をしたい場合は、依存関係またはロギングサブシステムを除外するためにjboss-deployment-structure.xmlを使用することができます。

関連する問題