You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Eric-AWL <er...@atosorigin.com> on 2011/03/04 09:42:06 UTC
Camel-2.6-0 . Own component development :
java.lang.ClassNotFoundException: org.apache.camel.Routes
Hi
I'm new on Camel but I know ActiveMQ well.
We programmed our own middleware above ActiveMQ, and I now try to create my
own Camel Component above this middleware (that is called "SIB" => scheme
"sib:").
I only use the camel-core-2.6.0.jar and when I launched my "server" part of
my test program I get
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/camel/Routes
Caused by: java.lang.ClassNotFoundException: org.apache.camel.Routes
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
I'm very surprised since I read that "Routes" were replaces by RoutesBuilder
on 2.0.0 version.
My classpath is
/SIB/distrib/erdfAmm-0.5.jar:./cameltest.jar:./chargebus/serveur/conf:/SIB/distrib/sib-0.86-5.jar:/SIB/distrib/atosbus-0.86-5.jar:/SIB/distrib/atosbus-activeMQ5-0.86-5.jar:/SIB/distrib/jmxremote_optional.jar:/SIB/activemq-all-5.4.2-eric.jar:/SIB/activemq-release/lib/commons-logging-1.1.jar:/SIB/activemq-release/lib/optional/xbean-spring-3.7.jar:/SIB/activemq-release/lib/optional/log4j-1.2.14.jar:/SIB/activemq-release/lib/optional/spring-beans-3.0.3.RELEASE.jar:/SIB/activemq-release/lib/optional/spring-context-3.0.3.RELEASE.jar:/SIB/activemq-release/lib/optional/spring-core-3.0.3.RELEASE.jar:/SIB/activemq-release/lib/optional/spring-jms-3.0.3.RELEASE.jar:/SIB/activemq-release/lib/optional/spring-asm-3.0.3.RELEASE.jar:/SIB/activemq-release/lib/optional/spring-expression-3.0.3.RELEASE.jar:/SIB/distrib/camel-sib-0.1.jar:/usr/local/camel/lib/camel-core-2.6.0.jar
the camel-sib-0.1.jar contains my new Camel Component.
Eric-AWL
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-6-0-Own-component-development-java-lang-ClassNotFoundException-org-apache-camel-Routes-tp3409104p3409104.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: Camel-2.6-0 . Own component development :
java.lang.ClassNotFoundException: org.apache.camel.Routes
Posted by Eric-AWL <er...@atosorigin.com>.
It's OK. I compiled with a ActiveMQ Classpath which contains old Camel jars
....
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-6-0-Own-component-development-java-lang-ClassNotFoundException-org-apache-camel-Routes-tp3409104p3409282.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: Camel-2.6-0 . Own component development :
java.lang.ClassNotFoundException: org.apache.camel.Routes
Posted by Eric-AWL <er...@atosorigin.com>.
It's not a problem on my component
The main class :
package serveur;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
public class SibCamelServeur {
private static SibRoute sibroute = new SibRoute();
public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(sibroute);
context.start();
boolean notInterrupted = false;
while (!notInterrupted) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
notInterrupted = true;
Thread.currentThread().interrupt();
}
}
context.stop();
}
}
The route class :
package serveur;
import org.apache.camel.Processor;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
public class SibRoute extends RouteBuilder {
public void configure() {
}
}
I obtain this exception when I only use 2.6.0 jars
As soon as I add
/usr/local/activemq/release/lib/camel-core-2.0-20090306.204442-136.jar to my
classpath from ActiveMQ librairies, this small program work doesn't throw
any exception (java.lang.ClassNotFoundException: org.apache.camel.Routes)
Eric-AWL
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-6-0-Own-component-development-java-lang-ClassNotFoundException-org-apache-camel-Routes-tp3409104p3409250.html
Sent from the Camel Development mailing list archive at Nabble.com.