You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Don Doffe <fo...@gmail.com> on 2011/06/17 14:34:27 UTC
JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Thank you for the help I got before.
I'm still having trouble deploying the camel .war into JBoss.
This time it is JBoss Logging binding for slf4j.
When deployed with the default dependencies provided by the archetype it
fails with duplicate binding for SLF4J.
If the bindings are reconfigured to use the JBoss logging it complains about
the version mismatch. It look like the JAR bundled with JBoss uses 1.5.5
binding and the one Camel depends on requires 1.6.1.
Is there a solution to that problem?
The exception I get is:
22:16:22,466 INFO [AbstractCamelContextFactoryBean] Using custom
PackageScanClassResolver:
org.apache.camel.jboss.JBossPackageScanClassResolver@429f7
7c9
22:16:22,613 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'template': Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'camel-1': Invocation of init method failed; nested exception i
s java.lang.NoSuchFieldError: log
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
Thanks.
--
View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4498593.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Richard Kettelerij <ri...@gmail.com>.
Oscar,
Your WAR probably contains JAXB libs that are incompatible with the JAXB
implementation used by JBoss AS 5.1.0. Can you check the contents of your
WEB-INF/lib directory and possibly delete the following jars:
- jaxb-api
- jaxb-impl
Regards,
Richard
On Sun, Jun 19, 2011 at 9:42 PM, Oscar Picasso <os...@gmail.com>wrote:
> No, I am not deploying the web console. It's just the war generated with
> the
> camel-archetype-war maven plugin.
>
> On Sat, Jun 18, 2011 at 8:20 PM, Don Doffe <fo...@gmail.com> wrote:
>
> > I have seen this too. Though I have tried so many things in the last few
> > days
> > I can not recall exactly what caused this.
> >
> > I have a feeling it might be something to do with the camel web
> console...
> >
> > Are you deploying one?
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4502353.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Oscar Picasso <os...@gmail.com>.
No, I am not deploying the web console. It's just the war generated with the
camel-archetype-war maven plugin.
On Sat, Jun 18, 2011 at 8:20 PM, Don Doffe <fo...@gmail.com> wrote:
> I have seen this too. Though I have tried so many things in the last few
> days
> I can not recall exactly what caused this.
>
> I have a feeling it might be something to do with the camel web console...
>
> Are you deploying one?
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4502353.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Don Doffe <fo...@gmail.com>.
I have seen this too. Though I have tried so many things in the last few days
I can not recall exactly what caused this.
I have a feeling it might be something to do with the camel web console...
Are you deploying one?
--
View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4502353.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Oscar Picasso <os...@gmail.com>.
Hi,
I, too, am trying to deploy on jboss-5.1.0.
I created a 2.6.0 camel war project with the camel-archetype-war and added
camel-jboss 2.6.0 in the pom.xml and
<bean id="jbossResolver"
class="org.apache.camel.jboss.JBossPackageScanClassResolver" />
in the applicationContext.xml.
When starting jboss I get :
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.lang.LinkageError: loader constraint violation: when resolving field
"DATETIME" the class loader (instance of
org/jboss/classloader/spi/base/BaseClassLoader) of the referring class,
javax/xml/datatype/DatatypeConstants, and the class loader (instance of
<bootloader>) for the field's resolved type, javax/xml/namespace/QName, have
different Class objects for that type
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)[jar:file:/D:/programs/
jboss-5.1.0.GA/server/default/deploy/camel.war!/WEB-INF/lib/spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE
]
Any idea?
Oscar Picasso
On Sat, Jun 18, 2011 at 4:07 AM, Claus Ibsen <cl...@gmail.com> wrote:
> I think you either have to stick with Camel 2.6 or get JBoss to
> provide a version that supports SLF4j 1.6.x
>
> On Sat, Jun 18, 2011 at 3:39 AM, Don Doffe <fo...@gmail.com> wrote:
> > Yes, Maven.
> >
> > The issue is that camel is compiled expecting SLF4J api v 1.6.1.
> > The one provided with JBoss is 1.5.8.
> >
> > So when Camel runs it detects a mismatch between expected class version
> and
> > provided and fails.
> >
> > So excluding the dependency is not an option unless I recompile the
> Camel.
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4500382.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Claus Ibsen <cl...@gmail.com>.
I think you either have to stick with Camel 2.6 or get JBoss to
provide a version that supports SLF4j 1.6.x
On Sat, Jun 18, 2011 at 3:39 AM, Don Doffe <fo...@gmail.com> wrote:
> Yes, Maven.
>
> The issue is that camel is compiled expecting SLF4J api v 1.6.1.
> The one provided with JBoss is 1.5.8.
>
> So when Camel runs it detects a mismatch between expected class version and
> provided and fails.
>
> So excluding the dependency is not an option unless I recompile the Camel.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4500382.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Don Doffe <fo...@gmail.com>.
Yes, Maven.
The issue is that camel is compiled expecting SLF4J api v 1.6.1.
The one provided with JBoss is 1.5.8.
So when Camel runs it detects a mismatch between expected class version and
provided and fails.
So excluding the dependency is not an option unless I recompile the Camel.
--
View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4500382.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Willem Jiang <wi...@gmail.com>.
How did you create the WAR?
If you are using maven, it's easy to exclude the SLF4J api dependency
from camel.
On 6/17/11 8:44 PM, Don Doffe wrote:
> At this moment I'm playing with WAR.
>
> Would you be so kind to point to instruction how to define this for WAR?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4498620.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Don Doffe <fo...@gmail.com>.
At this moment I'm playing with WAR.
Would you be so kind to point to instruction how to define this for WAR?
--
View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4498620.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Don,
did you try to define the isolated classloader (in the
deploy/ear-deployer.xml if you package your war into an ear) and use
JBossWebloader (in deploy/jboss-web.deployer/META-INF/jboss-service.xml) ?
Regards
JB
On 06/17/2011 02:34 PM, Don Doffe wrote:
> Thank you for the help I got before.
>
> I'm still having trouble deploying the camel .war into JBoss.
> This time it is JBoss Logging binding for slf4j.
>
> When deployed with the default dependencies provided by the archetype it
> fails with duplicate binding for SLF4J.
>
> If the bindings are reconfigured to use the JBoss logging it complains about
> the version mismatch. It look like the JAR bundled with JBoss uses 1.5.5
> binding and the one Camel depends on requires 1.6.1.
>
> Is there a solution to that problem?
>
> The exception I get is:
>
> 22:16:22,466 INFO [AbstractCamelContextFactoryBean] Using custom
> PackageScanClassResolver:
> org.apache.camel.jboss.JBossPackageScanClassResolver@429f7
> 7c9
> 22:16:22,613 ERROR [ContextLoader] Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'template': Initialization of bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'camel-1': Invocation of init method failed; nested exception i
> s java.lang.NoSuchFieldError: log
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>
> Thanks.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4498593.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Don Doffe <fo...@gmail.com>.
It seems not to work, as the camel has been compiled with a different class
version, thus when supplied with the older library it simply fails:
Caused by: java.lang.LinkageError: loader constraint violation: when
resolving method
"org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;"
the class loader (instance of
org/jboss/classloader/spi/base/BaseClassLoader) of the current class,
org/slf4j/LoggerFactory, and the class loader (instance of
org/jboss/classloader/spi/base/BaseClassLoader) for resolved class,
org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type
org/slf4j/ILoggerFactory used in the signature
My feeling is that the class loader isolation is the way to go.
I just need to understand how to do it.
--
View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-Camel-2-7-0-SLF4J-version-difference-tp4498593p4498675.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JBoss 5.1.0 & Camel 2.7.0 - SLF4J version difference?
Posted by Willem Jiang <wi...@gmail.com>.
You can exclude the dependency of SLF4j from camel-core, and override
the version with JBoss one.
On 6/17/11 8:34 PM, Don Doffe wrote:
> When deployed with the default dependencies provided by the archetype it
> fails with duplicate binding for SLF4J.
>
> If the bindings are reconfigured to use the JBoss logging it complains about
> the version mismatch. It look like the JAR bundled with JBoss uses 1.5.5
> binding and the one Camel depends on requires 1.6.1.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang