Discussion:
Grails SLF4J issue with Weblogic 10.3.6
cloudwalker84
2014-05-27 18:55:40 UTC
Permalink
I posted this on stackoverflow, but figured I'd post it here as well since
I'm really stuck on this one.

We've started getting the following exception when deploying to 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;

I've tried removing the slf4j jar from my ear. I've also tried putting the
following in my 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>

Nothing has worked thus far. Basically, I've tried all of the different
things that I've found online. Usually, when I have a conflict with a jar
that I'm providing myself and that Weblogic is also providing, just using
the prefer-application-packages does the trick.

I'm using Grails 2.3.6 with Weblogic 10.3.6.



--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-SLF4J-issue-with-Weblogic-10-3-6-tp4657025.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Graeme Rocher
2014-05-27 21:37:39 UTC
Permalink
It may be 'grails-plugin-logging' conflicting, as that references some
slf4j classes

Cheers
Post by cloudwalker84
I posted this on stackoverflow, but figured I'd post it here as well since
I'm really stuck on this one.
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
org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;
[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
I've tried removing the slf4j jar from my ear. I've also tried putting the
<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>
Nothing has worked thus far. Basically, I've tried all of the different
things that I've found online. Usually, when I have a conflict with a jar
that I'm providing myself and that Weblogic is also providing, just using
the prefer-application-packages does the trick.
I'm using Grails 2.3.6 with Weblogic 10.3.6.
--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-SLF4J-issue-with-Weblogic-10-3-6-tp4657025.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Graeme Rocher
Grails Project Lead
SpringSource

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
cloudwalker84
2014-05-27 21:47:18 UTC
Permalink
Yeah, I think that is what is causing the conflict. That plugin can't be
removed or altered though, can it? I thought it was required for Grails to
start up?



--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-SLF4J-issue-with-Weblogic-10-3-6-tp4657025p4657029.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Graeme Rocher
2014-05-28 07:04:22 UTC
Permalink
It can be removed, just exclude it from your inherited dependencies

inherits('globals') { excludes 'grails-plugin-logging' }
Post by cloudwalker84
Yeah, I think that is what is causing the conflict. That plugin can't be
removed or altered though, can it? I thought it was required for Grails to
start up?
--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-SLF4J-issue-with-Weblogic-10-3-6-tp4657025p4657029.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Graeme Rocher
Grails Project Lead
SpringSource

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
cloudwalker84
2014-05-29 13:07:45 UTC
Permalink
In case anyone comes across this issue, this is what my problem ended up
being:

What was happening is that we were including the activemq-all artifact for
JMS stuff, and this artifact is what they call an "uber" jar. It as a ton of
dependencies baked into it that cannot be excluded via maven – one of those
dependencies was an old version of slf4j. So, even though I had the
"prefer-application-packages" set in Weblogic for slf4j, it wasn't using the
Grails provided version, but rather the activemq one. Rather than using the
activemq-all dependency, I switched to use individual components from
activemq and was able to at that point exclude slf4j. This solved my issue.



--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-SLF4J-issue-with-Weblogic-10-3-6-tp4657025p4657038.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...