2 Replies Latest reply on May 7, 2013 7:30 AM by reality

    NPE with Fuse Camel Validator Component




      I have a Camel route that works fine in Fuse 7.1.0, but fails in JBoss Fuse 6.  This route looks like:



      <route id="validator">

         <from uri="activemq:inboundQueue" />


            <to uri="validator:my_message_v1.xsd" />

            <log message="Validated message ${body}" />

            <to uri="direct:myEndpoint" />



               <to ref="invalid-message" />



         <log message="Response ${body}" />





      When the resource loader tries to load the XSD, I get a null pointer exception thrown as there is no path before the file name and the DefaultLSResourceResolver trying to call intern() on a null value.  Changing the validator declaration to:




            <to uri="validator:claspath:/my_message_v1.xsd" />



      solves this particular problem, but introduces another.  The XSD is located in the root of the deployed jar, but not in the same location during development time leading to issues with running unit tests and causing the overall build to fail.  Due to various reasons, having a consistent location for build and deploy isn't possible at present.


      The version of the camel-core jar being used is that included with Fuse 6 - camel-core-2.10.0.redhat-60024.jar.  I've attached the pertinent chunk of the exception stacktrace.


      Is this a bug in the way the resource loader is loading the resource or am I doing something wrong?


      Many thanks for any help.