I'm not sure if the JBoss7 support the OSGi out of box.
Maybe you need to ask the question in the JBoss7 community to find out
if you need to any addition work.
On Thu Feb 16 02:07:14 2012, dvsridhar wrote:
I am experiencing similar problem here.
I am using Camel 2.9.0 and Latest Jboss (jboss-as-7.1.0.CR1b). I am trying
to deploy one of camel examples "camel-example-cxf-tomcat". Using maven
package i created the war and when i tried deploying it gives the same error
what the other user has described. I tried some other examples as well which
gave the same error, which lead me try the camel 2.9.0 samples. Here i am
trying to deploy as a war file but not as a osgi module. Any pointers for
solving this problem. Do I need to put any jars in the JBOSS
standalone/lib/ext directory?
Thanks,
Sridhar
12:28:10,034 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,034
[vice thread 1-3] INFO ContextLoader - Root
WebApplicationContext: initialization started
12:28:10,050 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,050
[vice thread 1-3] INFO XmlWebApplicationContext - Refreshing Root
WebApplicationContext: startup date [Wed Feb 15 12:28:10 EST 2012]; root of
context hierarchy
12:28:10,066 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,066
[vice thread 1-3] INFO XmlBeanDefinitionReader - Loading XML bean
definitions from class path resource [camel-config.xml]
12:28:10,144 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,144
[vice thread 1-3] INFO XmlBeanDefinitionReader - Loading XML bean
definitions from class path resource [META-INF/cxf/cxf.xml]
12:28:10,175 WARN [org.jboss.modules] (MSC service thread 1-3) Failed to
define class org.apache.camel.osgi.Activator in Module
"deployment.camel-example-cxf-tomcat.war:main" from Service Module Loader:
java.lang.LinkageError: Failed to link org/apache/camel/osgi/Activator
(Module "deployment.camel-example-cxf-tomcat.war:main" from Service Module
Loader)
at
org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)
at
org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at
org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:505)
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method) [:1.7.0_02]
at java.lang.Class.forName(Class.java:186) [:1.7.0_02]
at
org.apache.camel.spring.handler.CamelNamespaceHandler.init(CamelNamespaceHandler.java:129)
[camel-spring-2.9.0.jar:]
at
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:130)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1333)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
[spring-beans-3.0.6.RELEASE.jar:]
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
[spring-web-3.0.6.RELEASE.jar:]
at
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
[spring-web-3.0.6.RELEASE.jar:]
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
[spring-context-3.0.6.RELEASE.jar:]
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
[spring-context-3.0.6.RELEASE.jar:]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
[spring-context-3.0.6.RELEASE.jar:]
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
[spring-web-3.0.6.RELEASE.jar:]
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
[spring-web-3.0.6.RELEASE.jar:]
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
[spring-web-3.0.6.RELEASE.jar:]
at
org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)
[jbossweb-7.0.7.Final.jar:]
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)
[jbossweb-7.0.7.Final.jar:]
at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:77)
[jboss-as-web-7.1.0.CR1b.jar:7.1.0.CR1b]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[:1.7.0_02]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[:1.7.0_02]
at java.lang.Thread.run(Thread.java:722) [:1.7.0_02]
Caused by: java.lang.NoClassDefFoundError:
org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method) [:1.7.0_02]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [:1.7.0_02]
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[:1.7.0_02]
at
org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at
org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
... 39 more
Caused by: java.lang.ClassNotFoundException:
org.osgi.framework.BundleActivator from [Module
"deployment.camel-example-cxf-tomcat.war:main" from Service Module Loader]
at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 44 more
12:28:10,175 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,175
[vice thread 1-3] INFO CamelNamespaceHandler - OSGi environment
not detected.
12:28:10,784 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,784
[vice thread 1-3] INFO XmlWebApplicationContext - Bean 'cxf' of type
[class org.apache.cxf.bus.spring.SpringBus] is not eligible for getting
processed by all BeanPostProcessors (for example: not eligible for
auto-proxying)
12:28:10,800 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,800
[vice thread 1-3] INFO DefaultListableBeanFactory - Pre-instantiating
singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@167503a:
defining beans
[cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,myRoutes,template,consumerTemplate,camel-1:beanPostProcessor,camel-1];
root of factory hierarchy
12:28:10,972 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,972
[vice thread 1-3] INFO SpringCamelContext - Apache Camel 2.9.0
(CamelContext: camel-1) is starting
12:28:10,972 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,972
[vice thread 1-3] INFO ManagementStrategyFactory - JMX enabled. Using
ManagedManagementStrategy.
12:28:10,987 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:10,972
[vice thread 1-3] INFO ultManagementLifecycleStrategy - StatisticsLevel at
All so enabling load performance statistics
12:28:11,019 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,019
[vice thread 1-3] INFO AnnotationTypeConverterLoader - Found 3 packages
with 15 @Converter classes to load
12:28:11,034 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,034
[vice thread 1-3] INFO DefaultTypeConverter - Loaded 168 core
type converters (total 168 type converters)
12:28:11,034 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,034
[vice thread 1-3] INFO AnnotationTypeConverterLoader - Loaded 4 @Converter
classes
12:28:11,050 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,034
[vice thread 1-3] INFO DefaultTypeConverter - Loaded additional
22 type converters (total 190 type converters) in 0.000 seconds
12:28:11,191 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,191
[vice thread 1-3] INFO BusApplicationContext - Refreshing
org.apache.cxf.bus.spring.BusApplicationContext@1b545b2: startup date [Wed
Feb 15 12:28:11 EST 2012]; parent: Root WebApplicationContext
12:28:11,206 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,206
[vice thread 1-3] INFO DefaultListableBeanFactory - Pre-instantiating
singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@136a611:
defining beans []; parent:
org.springframework.beans.factory.support.DefaultListableBeanFactory@167503a
12:28:11,206 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,206
[vice thread 1-3] INFO SpringCamelContext - No spring-event
endpoint enabled to handle event:
org.springframework.context.event.ContextRefreshedEvent[source=org.apache.cxf.bus.spring.BusApplicationContext@1b545b2:
startup date [Wed Feb 15 12:28:11 EST 2012]; parent: Root
WebApplicationContext]
12:28:11,222 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,222
[vice thread 1-3] INFO ReflectionServiceFactoryBean - Creating Service
{http://incident.cxf.example.camel.apache.org/}IncidentService from class
org.apache.camel.example.cxf.incident.IncidentService
12:28:11,425 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,425
[vice thread 1-3] INFO ServerImpl - Setting the
server's publish address to be /incident
12:28:11,503 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,503
[vice thread 1-3] INFO SpringCamelContext - Route: route1
started and consuming from:
Endpoint[cxf:///incident?serviceClass=org.apache.camel.example.cxf.incident.IncidentService]
12:28:11,503 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,503
[vice thread 1-3] INFO SpringCamelContext - Route: route2
started and consuming from: Endpoint[direct://reportIncident]
12:28:11,503 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,503
[vice thread 1-3] INFO SpringCamelContext - Route: route3
started and consuming from: Endpoint[direct://statusIncident]
12:28:11,503 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,503
[vice thread 1-3] INFO SpringCamelContext - Total 3 routes, of
which 3 is started.
12:28:11,503 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,503
[vice thread 1-3] INFO SpringCamelContext - Apache Camel 2.9.0
(CamelContext: camel-1) started in 0.531 seconds
12:28:11,519 INFO [stdout] (MSC service thread 1-3) 2012-02-15 12:28:11,519
[vice thread 1-3] INFO ContextLoader - Root
WebApplicationContext: initialization completed in 1485 ms
12:28:11,519 INFO [org.jboss.web] (MSC service thread 1-3) registering web
context: /camel-example-cxf-tomcat
12:28:11,550 INFO [org.jboss.as.server] (HttpManagementService-threads - 4)
JBAS018559: Deployed "camel-example-cxf-tomcat.war"
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-2-9-0-startup-error-message-ClassNotFoundException-org-osgi-framework-BundleActivator-tp5133932p5486884.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