Hi Sandeep, 

We also faced the same problem with http component.  servicemix-http returns
the response with source as StaxSource or DOMSource.and StaxSource messages
are giving inconsitent results.  I don't know the reason for this. 

But,  work around for this to get the message from the http  with DOMSource. 
For this purpose, add the following policy definition in the http endpoint
definition.

<http:policies> 
    <bean class="org.apache.servicemix.soap.handlers.dom.DomHandler"/>
</http:policies>

If we add the above policy to http endpoint, NM  contents will be in DOM
source and we can avoid this problem. 

If you find any other good solution let me know.



sandeep reddy wrote:
> 
> Hi,
>    I am still facing this same problem and I am not able to resolve it.
> Please provide some advice on how to solve this or at least a workaround.
>    This is very important so please help us.
> 
> Thanks,
> Sandeep 
> 
> 
> 
> sandeep reddy wrote:
>> 
>>>Can you pinpoint the messages that are causing this error? 
>>   
>> This is the response message from External application:
>> when it is success:
>>     <?xml version='1.0' encoding='UTF-8'?>
>>         <response>
>>             <message>password changed</message>
>>             <status>0</status>
>>         </response>
>> when it is error:
>>     <?xml version='1.0' encoding='UTF-8'?><response><message>Internal
>> Server Error: failed to change
>> password</message><status>1000</status></response>
>> 
>>>Is there anything special to them? 
>> 
>>     There is nothing special with response message.And we are pretty sure
>> that message is not creating any sought of problem because if message is
>> not proper it should fail for each time. And it works fine having DEBUG
>> level in log4j.xml file.
>> 
>>>BTW, I see you are using the Camel dead
>>>letter channel.  Make sure you configure that properly (not related to
>>>your current question, but the default configuration just writes a
>>>message to the log when things go wrong without information the JBI
>>>endpoint).
>> 
>>     Yes we are using Dead letter channel, and it is configured
>> properly.This is camel configure method:
>> public void configure() {
>> 
>>         exception(java.lang.Throwable.class)
>>         .setBody(constant("<response><status>"+
>> ErrorConstants.SYSTEM_ERROR +"</status><message>System
>> Error</message></response>"))
>>        
>> .to("jbi:service:http://servicemix.in2m.com/operations/changepassword/ResponseGeneratorService?mep=in-out";);
>>        
>>         exception(java.net.SocketException.class)
>>         .setBody(constant("<response><status>"+
>> ErrorConstants.SOCKET_ERROR +"</status><message>Connection
>> Error</message></response>"))
>>        
>> .to("jbi:service:http://servicemix.in2m.com/operations/changepassword/ResponseGeneratorService?mep=in-out";);
>>        
>>        
>> from("jbi:service:http://servicemix.in2m.com/operations/changepassword/RoutingService";)
>>         .convertBodyTo(DOMSource.class)    //added here
>>         .choice()
>>         .when(header("userPrincipals").contains("director"))       
>>            
>> .to("jbi:service:http://servicemix.in2m.com/operations/changepassword/PortalService?mep=in-out";)
>>             .convertBodyTo(DOMSource.class)   //added here
>>         .when(header("userPrincipals").contains("portal"))
>>            
>> .to("jbi:service:http://servicemix.in2m.com/operations/changepassword/DirectorService?mep=in-out";)
>>             .convertBodyTo(DOMSource.class);   //added here
>> } 
>> 
> 
> 


-----
Cheers
Praveen Oruganti
"Think before you act and act on what you believe"
-- 
View this message in context: 
http://www.nabble.com/RuntimeCamelException%3A-java.io.IOException%3AAttempted-read-on-closed-stream-tp18869452p19313332.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to