部署到weblogic时出现SLF4J异常

时间:2014-05-23 20:56:59

标签: grails weblogic slf4j

部署到Weblogic时,我们开始收到以下异常:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
    'alertService': Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailService': Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailMessageBuilderFactory': Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailMessageContentRenderer': Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'groovyPagesTemplateEngine': Cannot resolve reference to bean 'gspTagLibraryLookup' while setting bean property 'tagLibraryLookup'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grails.plugin.springsecurity.SecurityTagLib': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webInvocationPrivilegeEvaluator': Cannot resolve reference to bean 'filterInvocationInterceptor' while setting constructor argument; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterInvocationInterceptor': Invocation of init method failed; nested exception is
 java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;
[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;

我试过从我耳边取出slf4j罐子。我还尝试将以下内容放在我的weblogic-appliction.xml中:

<prefer-application-packages>
    <package-name>org.slf4j.*</package-name>
</prefer-application-packages>

<prefer-application-resources>
    <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
</prefer-application-resources>

到目前为止,没有任何工作。基本上,我已经尝试过我在网上找到的所有不同的东西。通常,当我与我自己提供的jar冲突并且Weblogic也提供时,只需使用prefer-application-packages即可。

我使用Grails 2.3.6和Weblogic 10.3.6。

1 个答案:

答案 0 :(得分:0)

如果有人遇到这个问题,这就是我的问题最终:

发生的事情是我们为JMS的东西包含了activemq-all工件,而这个工件就是他们所说的&#34; uber&#34;罐。它作为大量的依赖关系融入其中,无法通过maven排除 - 其中一个依赖关系是slf4j的旧版本。所以,即使我有&#34; prefer-application-packages&#34;在Weblogic中为slf4j设置,它没有使用Grails提供的版本,而是使用了activemq版本。我没有使用activemq-all依赖,而是转而使用activemq中的各个组件,并且能够在那时排除slf4j。这解决了我的问题。