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

    NPE with Fuse Camel Validator Component

    Newbie

      Hi,

       

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

       

      {code:xml}

      <route id="validator">

         <from uri="activemq:inboundQueue" />

         <doTry>

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

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

            <to uri="direct:myEndpoint" />

            <doCatch>

               <exception>org.apache.camel.ValidationException</exception>

               <to ref="invalid-message" />

            </doCatch>

         </doTry>

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

      </route>

      {code}

       

       

      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:

       

       

      {code:xml}

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

      {code}

       

      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.

       

      Darren.