If I am not using an ActiveMQ Camel XML file where would I put that <package> statement. The Camel XML example worked, now I am just trying to get the standalone Java DSL one to work.
Justin -----Original Message----- From: Claus Ibsen [mailto:[email protected]] Sent: Monday, November 05, 2012 10:54 AM To: [email protected] Subject: Re: ServiceMix - Java DSL vs. Spring XML DSL (File IO) The Java class with the RouteBuilder must be in the package you specified <package>org.foo.bar</package> Do you have that? On Mon, Nov 5, 2012 at 4:45 PM, Davidson, Justin <[email protected]> wrote: > All, > > > > I am fairly new to ServiceMix and with that I am just testing the basic > Camel examples to move files from one directory to another. The first > one I did with Spring and ensured it was in the ActiveMQ > activemq-broker.xml and it starts and works as advertised. Then I > disable it and try to Java example. The second one in java appears to > deploy fine and shows up in the bundles list and is active in > servicemix, but does not start to do its work. > > > > ####### Spring XML Example (Works) ################ > > <beans > > xmlns="http://www.springframework.org/schema/beans" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd > > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd"> > > > > <camelContext id="camel" > xmlns="http://camel.apache.org/schema/spring"> > > <packageScan> > > <package>org.foo.bar</package> > > </packageScan> > > > > <route id="fileinout"> > > <description>Example Camel Route</description> > > <from uri="file://c:/temp/indir/"/> > > <to uri="file://c:/temp/outdir/"/> > > </route> > > </camelContext> > > </beans> > > > > ######## Java DSL Example (Does not start) ############ > > First, I deploy the JAR to this directory: > C:\Apache\apache-servicemix-4.4.2\deploy. Yes, camel-core OSGI is > installed and started. > > > > import org.apache.camel.CamelContext; > > import org.apache.camel.builder.RouteBuilder; > > import org.apache.camel.impl.DefaultCamelContext; > > > > > > public class CamelDSLFileIO { > > public static void main(String args[]) throws Exception { > > > > > RouteBuilder builder = new RouteBuilder() { > > public void configure() { > > > from("file://c:/temp/indir/?noop=false&delay=2000").to("file://C:/temp/o > utdir/"); > > } > > }; > > CamelContext context = new > DefaultCamelContext(); > > context.addRoutes(builder); > > context.start(); > > > > } > > > > } > > #################################################### > > > > What am I missing? > > > > > > Justin > > > -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
