-
1. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
ffang Apr 13, 2012 7:00 PM (in response to barryr)Hi,
Did you camel router bundle already import org.apache.activemq.xbean package?
Freeman
-
2. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 14, 2012 3:49 AM (in response to ffang)Hi Freeman, thanks for replying.
No my bundle does not have org.apache.activemq.xbean in its dependencies - it runs fine in the Eclipse IDE - its only when I deploy it to servicemix that I see this dependency?
-
3. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 14, 2012 4:03 AM (in response to barryr)OK , ISWYM
I added the dependency that contains the XBeanBrokerService class:
But I'm still getting exactly the same ClassNotFound exception in Servicemix?
-
4. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
ffang Apr 14, 2012 6:17 AM (in response to barryr)Hi,
You need import org.apache.activemq.xbean package in maven-bundle-plugin, add the dependency doesn't mean it will import such package.
Freeman
-
5. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 15, 2012 4:28 AM (in response to ffang)Hi Freeman, many thanks your post; it was a great help and much appreciated.
I added the following configuration:
<configuration>
<instructions>
<Export-Package>org.apache.activemq.xbean</Export-Package>
<Include-Resource>{maven-resources}, {maven-dependencies}</Include-Resource>
</instructions>
</configuration>
Which solved the XBeanBrokerService issue.
But then I was getting message exchange errors due to:
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Appender
So I added log4j to the Exported Packages:
<Export-Package>org.apache.log4j,org.apache.log4j.config,org.apache.log4j.helpers,
* org.apache.log4j.or,org.apache.log4j.pattern</Export-Package>*
But I'm now getting:
karaf@root> osgi:start 295
Error executing command: Unable to resolve module xxx.CamelTestJMS because it is exposed to package 'org.apache.log4j' f
rom xxx.CamelTestJMS and org.ops4j.pax.logging.pax-logging-api via two dependency chains.
Chain 1:
import: (&(package=org.apache.log4j)(version>=0.0.0)(!(version>=1.0.0)))
|
export: package=org.apache.log4j
Chain 2:
import: (package=org.apache.log4j.spi)
|
export: package=org.apache.log4j.spi; uses:=org.apache.log4j
export: package=org.apache.log4j
org.ops4j.pax.logging.pax-logging-api
I Have these dependencies in my pom.xml:
<dependency>
* *
Any ideas ?
Many thanks.
Barry.
-
6. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
ffang Apr 15, 2012 4:48 AM (in response to barryr)You need Import-Package but not Export-Package for log4j packages
Freeman
-
7. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 15, 2012 6:03 AM (in response to ffang) -
8. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 15, 2012 6:14 AM (in response to barryr)Got it, default behaviour is * so I need ,* after log4j packages.
-
9. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 15, 2012 6:16 AM (in response to ffang)Hi Freeman,
When I use Import-Package for log4j I now get:
org.osgi.framework.BundleException: Unresolved constraint in bundle xxx.CamelTestJMS : Unable to resolve 311.1: missing req
uirement package; (&(package=org.apache.log4j)(version>=0.0.0)(!(version>=1.0.0)))
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1168)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
at java.lang.Thread.run(Thread.java:662)
-
10. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
ffang Apr 15, 2012 7:09 PM (in response to barryr) -
11. Re: ClassNotFoundException: org.apache.activemq.xbean.XBeanBrokerService
barryr Apr 16, 2012 12:58 PM (in response to ffang)Hi Freeman,
I tried:
<Import-Package>org.apache.activemq.xbean,org.apache.log4j,org.apache.activemq.broker,
org.apache.log4j.config; org.apache.log4j.helpers; org.apache.log4j.or; org.apache.log4j.pattern; version="1.2.15", *</Import-Package>
But still get this error when I start the bundle:
karaf@root> osgi:start 366
Error executing command: Unresolved constraint in bundle xxx.CamelTestJMS : Unable to resolve 366.0: missing requirement [3
66.0] package; (&(package=org.apache.log4j.config)(version>=1.2.15))
Is my syntax incorrect for Import-Package ?
thanks,
Barry.