3 Replies Latest reply on Sep 14, 2010 1:28 AM by Claus Ibsen

    <Simple> filter requires input stream as class path resource?

    Bruce Taylor Newbie

      Folks -

       

      I'm trying to send the (XML string) input of a route to one of three JMS topics, depending on a keyword that occurs in the body of the message. Here's the relevant section of the camelContext:

       

               

       

      This works fine in an isolated unit test, but when it's embedded in the system's context, Simple fails at runtime with the following message:

       

      "java.lang.IllegalArgumentException: Could not retrieve InputStream for class path resource cannot be opened because it does not exist."

       

      Can anyone help me understand what is going on?

       

      Edited by: brucejtaylor on Sep 9, 2010 5:20 PM

        • 1. Re: <Simple> filter requires input stream as class path resource?
          Willem Jiang Master

          I canot tell anything for the Exception.

          Can you give me more information about your system?

          Did you deploy the application into OSGi container like ServiceMix4 or other?

          Which version of Camel are you using?

          Can you show me the whole stack trace?

          • 2. Re: <Simple> filter requires input stream as class path resource?
            Bruce Taylor Newbie

            Many thanks for the help.

             

            We're running Camel version 1.6.0-fuse and ActiveMQ 2.5.6 on Linux.

            The application is not running in any container.

             

            Full stack trace follows (length XML snipped out):

             

            2010-09-13 13:49:55,232 ERROR org.apache.camel.processor.DeadLetterChannel[DefaultMessageListenerContainer-499|http://fusesource.com/forums/] Logger.java 203 - Failed delivery for exchangeId: ID-tfdmdevlap2/40945-1284399691590/0-46. On delivery attempt: 1 caught: java.lang.IllegalArgumentException: Could not retrieve InputStream for class path resource [&lt;tfdm:SurveillanceTrackUpdatesFeatureCollection gml:id="id0" xmlns:tfdm="http://www.faa.gov/tfdm/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:features="http://www.faa.gov/tfdm/2.0/features" xmlns:types="http://www.faa.gov/tfdm/2.0/types"&gt;

            &lt;features:TrackUpdateFeature gml:id="id1"&gt;

            &lt;tfdm:globalUniqueId&gt;urn:fdc:faa.gov:20081031T090600.000000000Z:DFW:tfdm:admt:camel-jupiter-asdex:0.0.3-SNAPSHOT&lt;/tfdm:globalUniqueId&gt;

            &lt;tfdm:source&gt;urn:fdc:faa.gov:DFW:tfdm:admt:camel-jupiter-asdex:0.0.3-SNAPSHOT&lt;/tfdm:source&gt;

            &lt;tfdm:validTime gml:id="id2"&gt;

            &lt;gml:beginPosition&gt;20081031T090600.000000000Z&lt;/gml:beginPosition&gt;

            &lt;gml:endPosition&gt;21000101T000000.000000000Z&lt;/gml:endPosition&gt;

            &lt;/tfdm:validTime&gt;

             

            ... snip ...

             

            &lt;/tfdm:SurveillanceTrackUpdatesFeatureCollection&gt;] cannot be opened because it does not exist

            java.lang.IllegalArgumentException: Could not retrieve InputStream for class path resource [&lt;tfdm:SurveillanceTrackUpdatesFeatureCollection gml:id="id0" xmlns:tfdm="http://www.faa.gov/tfdm/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:features="http://www.faa.gov/tfdm/2.0/features" xmlns:types="http://www.faa.gov/tfdm/2.0/types"&gt;

            &lt;features:TrackUpdateFeature gml:id="id1"&gt;

            &lt;tfdm:globalUniqueId&gt;urn:fdc:faa.gov:20081031T090600.000000000Z:DFW:tfdm:admt:camel-jupiter-asdex:0.0.3-SNAPSHOT&lt;/tfdm:globalUniqueId&gt;

            &lt;tfdm:source&gt;urn:fdc:faa.gov:DFW:tfdm:admt:camel-jupiter-asdex:0.0.3-SNAPSHOT&lt;/tfdm:source&gt;

            &lt;tfdm:validTime gml:id="id2"&gt;

            &lt;gml:beginPosition&gt;20081031T090600.000000000Z&lt;/gml:beginPosition&gt;

            &lt;gml:endPosition&gt;21000101T000000.000000000Z&lt;/gml:endPosition&gt;

            &lt;/tfdm:validTime&gt;

             

            ... snip ...

            at org.springframework.beans.propertyeditors.InputStreamEditor.setAsText(InputStreamEditor.java:76)

            at org.apache.camel.impl.converter.PropertyEditorTypeConverter.convertTo(PropertyEditorTypeConverter.java:49)

            at org.apache.camel.impl.converter.PropertyEditorTypeConverter.convertTo(PropertyEditorTypeConverter.java:64)

            at org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:127)

            at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:90)

            at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:79)

            at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)

            at org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelper.java:130)

            at org.apache.camel.component.file.FileProducer.process(FileProducer.java:78)

            at org.apache.camel.component.file.FileProducer.process(FileProducer.java:61)

            at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)

            at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:84)

            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)

            at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)

            at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)

            at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)

            at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)

            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)

            at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)

            at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)

            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)

            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)

            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)

            at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)

            at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)

            at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)

            at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)

            at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)

            at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)

            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)

            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:881)

            at java.lang.Thread.run(Thread.java:619)

            • 3. Re: <Simple> filter requires input stream as class path resource?
              Claus Ibsen Master

              You gotta read the documentation better.

               

              The simple language only supports operators in Camel 2.x

              http://camel.apache.org/simple

               

              So what you do with Camel 1.x is not possible.