Hello

I have been trying to get call a RESTful service via servicemix-http and
have  http://www.nabble.com/servicemix-http-Post-support-to16418421.html had
some success  but I've run into a problem with handling unsuccessful calls. 

Here is my scenario. My client app sends a message to a JMS queue listened
to by SMX and sets a temporary replyTo queue. The message gets routed
through SMX to the SMX-http BC and that calls the restful service. When the
request is for a resource that does not exist the RESTful service throws an
expception. SMX gets this and puts it in the ME as a Fault. It then gets
passed back to the JMS component where "WstxIOException: Stream closed" gets
thrown. 

Below are the pertinent logs and configs but my question is shouldn't the
JMS component just pass the fault back in the JMS response payload? Is there
some configuration that I'm missing?

Thanks
Tom 

Here's the log:
10:05:41,711 - DEBUG - SedaFlow                       - Called Flow send
10:05:41,715 - ERROR - JmsComponent                   - Error processing
exchange InOut[
  id: ID:127.0.0.2-11938cad4bc-3:7
  status: Done
  role: consumer
  service: {http://www.company.com/wile}wileRestService
  endpoint: wileRestQuery
  in: <?xml version="1.0"
encoding="UTF-8"?><assetRequest><resource>asset</resource><guid>EA64Cx385-C534-446B-6417-A3BDCB9381E4</guid><perspective>ServerAsset</perspective></assetRequest>
  fault: Unable to display: java.io.IOException: Stream closed
]
com.ctc.wstx.exc.WstxIOException: Stream closed
        at
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)
        at
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)
        at
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)
        at
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)
        at
org.apache.servicemix.jbi.jaxp.StAXSourceTransformer.toXMLStreamReader(StAXSourceTransformer.java:86)
        at
org.apache.servicemix.soap.marshalers.SoapWriter.writeSimpleMessage(SoapWriter.java:120)
        at
org.apache.servicemix.soap.marshalers.SoapWriter.write(SoapWriter.java:92)
        at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:79)
        at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:106)
        at
org.apache.servicemix.jms.AbstractJmsProcessor.fromNMSResponse(AbstractJmsProcessor.java:194)
        at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.process(MultiplexingConsumerProcessor.java:111)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:551)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:524)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Stream closed
        at sun.nio.cs.StreamDecoder.ensureOpen(StreamDecoder.java:38)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:153)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at
com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245)
        at
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132)
        at
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543)
        ... 20 more
10:05:41,716 - ERROR - JmsComponent                   - Error setting
exchange status to ERROR
java.lang.IllegalStateException: component is not owner when trying to set
error: com.ctc.wstx.exc.WstxIOException: Stream closed
        at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setError(MessageExchangeImpl.java:264)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:57)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: com.ctc.wstx.exc.WstxIOException: Stream closed
        at
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)
        at
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)
        at
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)
        at
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)
        at
org.apache.servicemix.jbi.jaxp.StAXSourceTransformer.toXMLStreamReader(StAXSourceTransformer.java:86)
        at
org.apache.servicemix.soap.marshalers.SoapWriter.writeSimpleMessage(SoapWriter.java:120)
        at
org.apache.servicemix.soap.marshalers.SoapWriter.write(SoapWriter.java:92)
        at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:79)
        at
org.apache.servicemix.jms.DefaultJmsMarshaler.toJMS(DefaultJmsMarshaler.java:106)
        at
org.apache.servicemix.jms.AbstractJmsProcessor.fromNMSResponse(AbstractJmsProcessor.java:194)
        at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.process(MultiplexingConsumerProcessor.java:111)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:551)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:524)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        ... 7 more
Caused by: java.io.IOException: Stream closed
        at sun.nio.cs.StreamDecoder.ensureOpen(StreamDecoder.java:38)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:153)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at
com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245)
        at
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132)
        at
com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543)
        ... 20 more

Here's my JMS endpoint config:
    <jms:endpoint service="wile:jmsWileQueues"
                  endpoint="jmsToRestQueryQueue"
                  targetService="wile:wileRestService"
                  targetEndpoint="wileRestQuery"
                  role="consumer"
                  destinationStyle="queue"
                  jmsProviderDestinationName="wileJmsQueryQueue"
                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out";
                  connectionFactory="#connectionFactory"/>

And my HTTP config:
    <http:provider service="wile:wileRestService"
                   interfaceName="wileQuery"
                   endpoint="wileRestQuery"
                   marshaler="#queryMarshaler"/>
    <bean id="queryMarshaler"
class="org.apache.servicemix.http.endpoints.DefaultHttpProviderMarshaler">
        <property name="locationURIExpression">
            <bean
class="org.apache.servicemix.expression.JAXPStringXPathExpression">
                <constructor-arg
                       
value="concat('http://localhost:8080/wile-www/assetmanagement/assetservice/',
                                        /assetRequest/resource,
                                        '/',
                                        /assetRequest/guid,
                                        '/',
                                        /assetRequest/perspective)"/>
            </bean>
        </property>
        <property name="method"
                  value="GET"/>
    </bean>
-- 
View this message in context: 
http://www.nabble.com/JMS-Error-Caused-By-Fault-on-REST-Call-tp16609525p16609525.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to