JBoss Fuse : Install a Custom Feature : ClassNotFoundException
nakshathri Apr 19, 2013 10:48 AMHello All,
I am very new to JBoss Fuse and JBoss A-MQ. I have worked in plain camel with activemq for integration. As part of the latest assignment, we are using JBoss Fuse and A-MQ for
1. Service Virtualization
2. Timer Tasks
3. Asynchronous communication using active mq
We are using JBoss-fuse-6.0.0.
Below is the sample project (tc-esb-task) code for the timer tasks and Asynchronous communication which we are trying out:
pom.xml:
{code:xml}<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.fwcms.tc</groupId>
<artifactId>tc-esb-task</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<name>tc-esb-task</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<activemq.version>5.8.0.redhat-60024</activemq.version>
<camel.version>2.10.0.redhat-60024</camel.version>
<cxf.version>2.6.0.redhat-60024</cxf.version>
<slf4j.version>1.6.6</slf4j.version>
<log4j.version>1.2.16</log4j.version>
<org.springframework.version>3.1.2.RELEASE</org.springframework.version>
</properties>
<repositories>
<repository>
<id>fusesource.releases</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>fusesource.ea</id>
<name>FuseSource Early Access</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>fusesource.releases</id>
<name>FuseSource Release Repository</name>
<url>http://repo.fusesource.com/nexus/content/repositories/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>fusesource.ea</id>
<name>FuseSource Early Access</name>
<url>http://repo.fusesource.com/nexus/content/groups/ea/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<!-- the ActiveMQ client with connection pooling -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>${activemq.version}</version>
</dependency>
<!-- the ActiveMQ broker is optional and can be removed if connecting to a remote broker only -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<showWarnings>false</showWarnings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
camel-context.xml:
{code:xml}
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring" xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<bean id="testTrigger" class="org.fwcms.tc.TestTrigger" />
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="maxConnections" value="8" />
<property name="maximumActive" value="500" />
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="pooledConnectionFactory" />
<property name="transacted" value="false" />
<property name="concurrentConsumers" value="10" />
</bean>
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="jmsConfig" />
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="timer://test?period=10000" />
<bean ref="testTrigger" method="trigger" />
</route>
<route id="sender" autoStartup="true">
<description>Example Camel Route</description>
<from uri="timer://test?period=10000" />
<bean ref="testTrigger" method="send" />
<to uri="activemq:sender" />
</route>
<route id="receiver" autoStartup="true">
<description>Example Camel Route</description>
<from uri="activemq:sender" />
<bean ref="testTrigger" method="receive" />
</route>
</camelContext>
</beans>
{code}
the features.xml is :
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<features name="fwcms-tc-features">
<feature name="fwcms-task" description="Batch And Asynchronous Process" version="1.0.0">
<feature version="${activemq.version}">activemq-camel</feature>
<feature version="${activemq.version}">activemq</feature>
<bundle>wrap:mvn:org.apache.activemq/activemq-all/5.8.0.redhat-60024</bundle>
<bundle>wrap:mvn:org.fwcms.tc/tc-esb-task/1.0.0</bundle>
</feature>
</features>
{code}
When i build the project and hot deploy the features.xml, we are getting classnotfound exception for
Caused by: java.lang.ClassNotFoundException: org.apache.activemq.ActiveMQConnectionFactory not found by wrap_mvn_org.fwcms.tc_tc-esb-task_1.0.0 [240]
According to me this is because of missing dependency. But i have added all the dependencies which are required as the project level dependency. Even i did add the activemq-all as the depedent module as part of features.
Can you please guide me on where exactly i am going wrong. Really appreciate your help.
Regards,
Manjunath