【问题标题】:Drools make conflict with spring-security-oauth2-providerDrools 与 spring-security-oauth2-provider 发生冲突
【发布时间】:2015-06-14 09:18:20
【问题描述】:

我尝试添加drools插件: https://grails.org/plugin/drools 到我在 grails 中的 webapp,只需将其添加到 BuildConfig.groovy 中:

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.55"

    // plugins for the compile step
    compile ":scaffolding:2.1.2"
    compile ':cache:1.1.8'
    compile "org.grails.plugins:mail:1.0.7"
    compile ":rest-client-builder:2.0.3"
    compile ":spring-security-core:2.0-RC3"
    compile ":spring-security-oauth2-provider:1.0.5.2"
    compile ":browser-detection:0.4.3"
    compile ":asset-pipeline:2.1.5"
    compile ":remote-pagination:0.4.8"
    compile ":drools:1.1.0"

    // plugins needed at runtime but not for compilation
    runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"
    runtime ':twitter-bootstrap:3.3.1'
}

,但我收到了一个错误:

Configuring Spring Security OAuth2 provider ...
... done configuring Spring Security OAuth2 provider Running Common
Auth Plugin... | Error 2015-05-25 13:25:09,499 [localhost-startStop-1]
ERROR context.GrailsContextLoaderListener  - Error initializing the
application: Error creating bean with name 'oauth2ProviderFilter':
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError:
com/sun/xml/bind/v2/model/annotation/AnnotationReader Message: Error
creating bean with name 'oauth2ProviderFilter': Instantiation of bean
failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError:
com/sun/xml/bind/v2/model/annotation/AnnotationReader
    Line | Method
->>  262 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor |    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^   
745 | run       in java.lang.Thread Caused by
BeanInstantiationException: Could not instantiate bean class
[org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError:
com/sun/xml/bind/v2/model/annotation/AnnotationReader
->>  262 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  |   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor |    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker ^   
745 | run       in java.lang.Thread Caused by NoClassDefFoundError:
com/sun/xml/bind/v2/model/annotation/AnnotationReader
->>  800 | defineClass in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  |    142 | defineClass in java.security.SecureClassLoader |    449 | defineClass in java.net.URLClassLoader |     71 | access$100 in    
'' |    361 | run . . . in java.net.URLClassLoader$1 |    355 | run   
in     '' |    354 | findClass in java.net.URLClassLoader |    425 |
loadClass in java.lang.ClassLoader |   2615 |
privateGetDeclaredMethods in java.lang.Class |   2856 | getMethod0 in 
'' |   1668 | getMethod in     '' |    243 | newInstance in
javax.xml.bind.ContextFinder |    235 | newInstance in     '' |    432
| find      in     '' |    637 | newInstance in
javax.xml.bind.JAXBContext |    584 | newInstance in     '' |    262 |
run . . . in java.util.concurrent.FutureTask |   1145 | runWorker in
java.util.concurrent.ThreadPoolExecutor |    615 | run . . . in
java.util.concurrent.ThreadPoolExecutor$Worker ^    745 | run       in
java.lang.Thread Caused by ClassNotFoundException:
com.sun.xml.bind.v2.model.annotation.AnnotationReader
->>  366 | run       in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  |    355 | run       in     '' |    354 | findClass in java.net.URLClassLoader |    425 | loadClass in java.lang.ClassLoader
|    800 | defineClass in     '' |    142 | defineClass in
java.security.SecureClassLoader |    449 | defineClass in
java.net.URLClassLoader |     71 | access$100 in     '' |    361 | run
. . . in java.net.URLClassLoader$1 |    355 | run       in     '' |   
354 | findClass in java.net.URLClassLoader |    425 | loadClass in
java.lang.ClassLoader |   2615 | privateGetDeclaredMethods in
java.lang.Class |   2856 | getMethod0 in     '' |   1668 | getMethod
in     '' |    243 | newInstance in javax.xml.bind.ContextFinder |   
235 | newInstance in     '' |    432 | find      in     '' |    637 |
newInstance in javax.xml.bind.JAXBContext |    584 | newInstance in   
'' |    262 | run . . . in java.util.concurrent.FutureTask |   1145 |
runWorker in java.util.concurrent.ThreadPoolExecutor |    615 | run .
. . in java.util.concurrent.ThreadPoolExecutor$Worker ^    745 | run  
in java.lang.Thread Error | Forked Grails VM exited with error

Drools 和 spring-security-oauth2-provider 之间似乎存在冲突。

【问题讨论】:

    标签: grails drools spring-security-oauth2


    【解决方案1】:

    好的,我通过添加解决了这个问题:

    compile ":cxf:2.1.1"
    

    到 BuildConfig 插件。

    您可以在 Ken 的评论中找到更多详细信息:https://github.com/kensiprell/grails-drools/issues/8#issuecomment-105252639

    【讨论】:

      猜你喜欢
      • 2019-09-25
      • 1970-01-01
      • 2017-03-31
      • 1970-01-01
      • 2011-05-01
      • 2013-12-31
      • 2012-06-27
      • 2020-06-22
      • 2013-08-07
      相关资源
      最近更新 更多