Hi James,
thanks for your reply.
I thought my RouteBuilder class should be inside the src/main/java folder of
the servicemix-camel-serviceunit project, as the archetype suggests. Anyway
I tried to do as you suggest, I created a new maven project for my
RouteBuilder class and put my SismedRouter class into it. It compiles and
installs well, I can see the jar inside the local maven repository. Then I
added the dependency on the pom.xml of the servicemix-camel-serviceunit
project to this jar. Compiled and installed the serviceunit, and I can see,
inside the lib folder of generated installer zip, the jar included. Compiled
and installed the service-assembly as well, and deployed too, but I get the
same result.
It seems that camel cannot find my class or doesn't search for it.
I post serviceunit pom.xml:

<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>codin.sismed</groupId>
  <artifactId>camel-routes-su</artifactId>
  <packaging>jbi-service-unit</packaging>
  <name>Sismed servicemix-camel serviceunit</name>
  <version>1.0-SNAPSHOT</version>
  <url>http://www.myorganization.org</url>
  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.servicemix.tooling</groupId>
        <artifactId>jbi-maven-plugin</artifactId>
        <version>${servicemix-version}</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${camel-version}</version>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.servicemix</groupId>
      <artifactId>servicemix-camel</artifactId>
      <version>${servicemix-version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix</groupId>
      <artifactId>servicemix-core</artifactId>
      <version>${servicemix-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>codin.sismed</groupId>
      <artifactId>sismed-camel-routing</artifactId>
      <version>0.0.1</version>
    </dependency>
  </dependencies>
  <properties>
    <servicemix-version>3.2-incubating-SNAPSHOT</servicemix-version>
    <camel-version>1.1.0</camel-version>
  </properties>
</project>

Any other suggestions...thanks for your help


James.Strachan wrote:
> 
> On 8/23/07, dellekappa <[EMAIL PROTECTED]> wrote:
>>
>> Hi everybody,
>> I had correctly configured servicemix-camel component inside servicemix,
>> and
>> I had created a new servicemix-camel-serviceunit as well, based on the
>> corrensonding archetype.
>> The problem is that if I configure my routes inside camel-context.xml it
>> works fine, but if I try java based routing...nothing happens. It seems
>> that
>> my RouteBuilder class won't be read.
>> I put my RouteBuilder class inside a package named codin.sismed:
>>
>> -------------------------------
>> package codin.sismed;
>>
>> import org.apache.camel.Exchange;
>> import org.apache.camel.Processor;
>> import org.apache.camel.builder.RouteBuilder;
>> import org.apache.camel.spring.Main;
>>
>> public class SismedRouter extends RouteBuilder {
>>
>>         public static void main(String[] args) {
>>         new Main().run(args);
>>     }
>>
>>     public void configure() {
>>         System.out.println("Configuring routes");
>>
>> from("jbi:service:http://sismed/services/Anagrafica/AnagraficaJBI";).to("jbi:service:http://sismed/services/Anagrafica/Anagrafica_bb1";);
>>         System.out.println("Routes configured");
>>     }
>> }
>> -----------------------------
>>
>> and this is how appear my camel-context.xml
>>
>> -----------------------------
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <!-- START SNIPPET: camel -->
>> <beans xmlns="http://www.springframework.org/schema/beans";
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>>         http://www.springframework.org/schema/beans/spring-beans.xsd
>>         http://activemq.apache.org/camel/schema/spring
>>         http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>
>>
>>   <camelContext id="camel"
>> xmlns="http://activemq.apache.org/camel/schema/spring";>
>>         <package>codin.sismed</package>
>>   </camelContext>
>>
>> </beans>
>> <!-- END SNIPPET: camel -->
>>
>> ---------------------------
>>
>> the service-unit and the service-assembly compiles and deployes
>> well...but
>> no routes are created.
>> Any suggestion?
> 
> Hmm - it should work. Are you sure your class is inside a jar on the
> claspath? e.g. your jar is in the pom.xml of the camel-service-unit's
> pom.xml so its added to the dependency list & classloader?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/servicemix-camel---Java-based-routing-tf4318255s12049.html#a12309519
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to