2 Replies Latest reply on Feb 4, 2009 10:37 AM by jamie archibald

    Annotation Type Converter Loader can't find my classes

    jamie archibald Apprentice

      I have created my own type converter as follows


      package my.converter;



      public class MyConverter {





      public static ProprietaryMessage toProprietaryMessage(ActiveMQStreamMessage msg) {


             /// do something





      I then added META-INF/services/org/apache/camel/TypeConverter to my classpath in eclipse and added the my.converter package.


      I then built my message router which pulls messages from ActiveMQ from one topic and routers them to another.


      context.addRoutes(new RouteBuilder() {






         public void configure() throws Exception {








      The problem is that the Annotation Type Converter Loader isn't finding my MyConverter class.


      I've confirmed this by running the following code:


      DefaultTypeConverter tc = (DefaultTypeConverter)context.getTypeConverter();

      List<TypeConverterLoader> loaders = tc.getTypeConverterLoaders();




      TypeConverter type = tc.getTypeConverter(ProprietaryMessage.class, ActiveMQStreamMessage.class);


      // type is null!!!!





      The only difference I can see here is that I am not packaging my code into a jar. Instead I am running it in eclipse, however I still have the META-INF/... folder in my classpath.


      Edited by: jamie3 on Feb 3, 2009 12:16 PM


      Edited by: jamie3 on Feb 3, 2009 12:22 PM