camel-core as jboss 7 module leads to NoClassDefFoundError
labo32_delaboe May 31, 2012 7:32 AMselect camel dependencies as mentioned in
http://camel.apache.org/what-are-the-dependencies.html
and create JBoss AS 7 module xml
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="org.apache.camel.core"> <resources> <resource-root path="camel-core-2.9.2.jar"></resource-root> </resources> <dependencies> <module name="org.slf4j"></module> </dependencies> </module>
add dependency in MANIFEST.MF during maven build in my war
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>${war.plugin.version}</version> <configuration> <archive> <manifestEntries> <Dependencies>org.apache.camel.core</Dependencies> </manifestEntries> </archive> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>
during deployment I got an exception
13:13:56,503 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."camel -cdi-1.0.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."camel-cdi-1.0.war".POST_MODULE: Faile d to process phase POST_MODULE of deployment "camel-cdi-1.0.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1. Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar: 1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29] Caused by: java.lang.RuntimeException: Error getting reflective information for class net.larbig.camel.BootStrap with ClassLoader Modul eClassLoader for Module "deployment.camel-cdi-1.0.war:main" from Service Module Loader at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as- server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.jav a:70) at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1. Final.jar:7.1.1.Final] ... 5 more Caused by: java.lang.NoClassDefFoundError: org/apache/camel/RoutesBuilder at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_29] at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_29] at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_29] at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Fina l.jar:7.1.1.Final] at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as- server-7.1.1.Final.jar:7.1.1.Final] ... 10 more Caused by: java.lang.ClassNotFoundException: org.apache.camel.RoutesBuilder from [Module "deployment.camel-cdi-1.0.war:main" from Servi ce 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.performLoadClassChecked(ConcurrentClassLoader.java:423) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) ... 15 more
What is wrong with this setup ?
Thanks in advance
labo