You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Jorge Rodríguez Pedrianes (JIRA)" <ji...@apache.org> on 2008/08/21 11:21:52 UTC
[jira] Created: (SM-1517) Error in ProviderProcessor whuen I
receive a no soap
Error in ProviderProcessor whuen I receive a no soap
----------------------------------------------------
Key: SM-1517
URL: https://issues.apache.org/activemq/browse/SM-1517
Project: ServiceMix
Issue Type: Bug
Components: servicemix-http
Affects Versions: 3.2.2, 3.2.1, 3.2
Environment: servicemix 3.2.1
Reporter: Jorge Rodríguez Pedrianes
Hello!
I saw that when I use ProviderProcessor and the service don't response a soap xml, the servicemix is blocked.
For example, my remote service send me a 503 http response without xml response, only a html showing the error. Then when ProviderProcessor try to read a Fault soap xml throw a exception.
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// <-- ERROR: Response isn't a SOAP XML -->
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
{code}
the problem is that this exception can't be Serializable, and when ActiveMQ need serialice this throw a exception and never send the response.
I think that solution is:
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// Process error execution
processError(method, exchange, context); * // ADDED *
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
private void processError(PostMethod method, MessageExchange exchange, Context context) {
try {
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
} catch (Throwable e) {
log.debug("Invalid response", e);
Exception exception = new Exception("Invalid response");
exchange.setError(exception);
}
}
{code}
I think that this is necessary also in processInOptionalOut and processInOut method to avoid this situation.
Thanks
PD: This is the log of this situation
{panel}
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "HTTP/1.0 503 Service Unavailable[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Date: Wed, 20 Aug 2008 07:33:40 GMT[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.1.6 mod_jk/1.2.23 mod_perl/2.0.4 Perl/v5.8.5[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Length: 323[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Proxy-Connection: close[\r][\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<html><head>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<title>503 Service Temporarily Unavailable</title>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</head><body>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<h1>Service Temporarily Unavailable</h1>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<p>The server is temporarily unable to service your[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "request due to maintenance downtime or capacity[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "problems. Please try again later.</p>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</body></html>[\n]"
2008-08-20 09:37:50,449 ERROR [org.apache.servicemix.http.HttpComponent] Error processing exchange InOut[
id: ID:10.141.245.139-11bdb329047-5:279
status: Active
role: provider
service: gatewayService
endpoint: gateway
operation: {http://DefaultNamespace}getSmsStatus
in: <?xml version="1.0" encoding="UTF-8"?>IN MESSAGE
]
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
at [row,col {unknown-source}]: [1,50]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)
at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:59)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.next(ExtendedXMLStreamReader.java:61)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.nextTag(ExtendedXMLStreamReader.java:44)
at org.apache.servicemix.soap.marshalers.SoapReader.readSoapUsingStax(SoapReader.java:164)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:89)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:76)
at org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:164)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
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:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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)
2008-08-20 09:37:50,451 ERROR [org.apache.servicemix.http.HttpComponent] Error setting exchange status to ERROR *<-- IMPORTANT EXCEPTION*
java.lang.RuntimeException: com.ctc.wstx.io.WstxInputLocation
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
at org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:144)
at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:361)
at org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:142)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:484)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:439)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
at org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
at org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:81)
at org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:830)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:58)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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.NotSerializableException: com.ctc.wstx.io.WstxInputLocation *<-- IMPORTANT CAUSE*
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:403)
at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
... 19 more
{panel}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SM-1517) Error in ProviderProcessor when I receive
a no soap
Posted by "Jorge Rodríguez Pedrianes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SM-1517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jorge Rodríguez Pedrianes updated SM-1517:
------------------------------------------
Summary: Error in ProviderProcessor when I receive a no soap (was: Error in ProviderProcessor whuen I receive a no soap)
> Error in ProviderProcessor when I receive a no soap
> ---------------------------------------------------
>
> Key: SM-1517
> URL: https://issues.apache.org/activemq/browse/SM-1517
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-http
> Affects Versions: 3.2, 3.2.1, 3.2.2
> Environment: servicemix 3.2.1
> Reporter: Jorge Rodríguez Pedrianes
>
> Hello!
> I saw that when I use ProviderProcessor and the service don't response a soap xml, the servicemix is blocked.
> For example, my remote service send me a 503 http response without xml response, only a html showing the error. Then when ProviderProcessor try to read a Fault soap xml throw a exception.
> {code:title=ProviderProcessor.java|borderStyle=solid}
> public void process(MessageExchange exchange) throws Exception {
> ...
> if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
> if (!(exchange instanceof InOnly)) {
> // <-- ERROR: Response isn't a SOAP XML -->
> SoapReader reader = soapHelper.getSoapMarshaler().createReader();
> Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
> soapMessage = reader.read(method.getResponseBodyAsStream(),
> contentType != null ? contentType.getValue() : null);
> context.setFaultMessage(soapMessage);
> soapHelper.onAnswer(context);
> Fault fault = exchange.createFault();
> fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
> soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
> exchange.setFault(fault);
> if (txSync) {
> channel.sendSync(exchange);
> } else {
> methods.put(exchange.getExchangeId(), method);
> channel.send(exchange);
> close = false;
> }
> return;
> } else {
> throw new Exception("Invalid status response: " + response);
> }
> }
> ...
> }
> {code}
> the problem is that this exception can't be Serializable, and when ActiveMQ need serialice this throw a exception and never send the response.
> I think that solution is:
> {code:title=ProviderProcessor.java|borderStyle=solid}
> public void process(MessageExchange exchange) throws Exception {
> ...
> int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
> if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
> if (!(exchange instanceof InOnly)) {
> // Process error execution
> processError(method, exchange, context); * // ADDED *
> if (txSync) {
> channel.sendSync(exchange);
> } else {
> methods.put(exchange.getExchangeId(), method);
> channel.send(exchange);
> close = false;
> }
> return;
> } else {
> throw new Exception("Invalid status response: " + response);
> }
> }
> ...
> }
> private void processError(PostMethod method, MessageExchange exchange, Context context) {
> try {
> SoapReader reader = soapHelper.getSoapMarshaler().createReader();
> Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
> SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(),
> contentType != null ? contentType.getValue() : null);
> context.setFaultMessage(soapMessage);
> soapHelper.onAnswer(context);
> Fault fault = exchange.createFault();
> fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
> soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
> exchange.setFault(fault);
> } catch (Throwable e) {
> log.debug("Invalid response", e);
> Exception exception = new Exception("Invalid response");
> exchange.setError(exception);
> }
> }
> {code}
> I think that this is necessary also in processInOptionalOut and processInOut method to avoid this situation.
> Thanks
> PD: This is the log of this situation
> {panel}
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "HTTP/1.0 503 Service Unavailable[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Date: Wed, 20 Aug 2008 07:33:40 GMT[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.1.6 mod_jk/1.2.23 mod_perl/2.0.4 Perl/v5.8.5[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Length: 323[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Proxy-Connection: close[\r][\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<html><head>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<title>503 Service Temporarily Unavailable</title>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</head><body>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<h1>Service Temporarily Unavailable</h1>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<p>The server is temporarily unable to service your[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "request due to maintenance downtime or capacity[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "problems. Please try again later.</p>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</body></html>[\n]"
> 2008-08-20 09:37:50,449 ERROR [org.apache.servicemix.http.HttpComponent] Error processing exchange InOut[
> id: ID:10.141.245.139-11bdb329047-5:279
> status: Active
> role: provider
> service: gatewayService
> endpoint: gateway
> operation: {http://DefaultNamespace}getSmsStatus
> in: <?xml version="1.0" encoding="UTF-8"?>IN MESSAGE
> ]
> com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
> at [row,col {unknown-source}]: [1,50]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
> at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:59)
> at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.next(ExtendedXMLStreamReader.java:61)
> at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.nextTag(ExtendedXMLStreamReader.java:44)
> at org.apache.servicemix.soap.marshalers.SoapReader.readSoapUsingStax(SoapReader.java:164)
> at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:89)
> at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:76)
> at org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:164)
> at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
> at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
> 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:170)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
> 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)
> 2008-08-20 09:37:50,451 ERROR [org.apache.servicemix.http.HttpComponent] Error setting exchange status to ERROR *<-- IMPORTANT EXCEPTION*
> java.lang.RuntimeException: com.ctc.wstx.io.WstxInputLocation
> at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
> at org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:144)
> at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:361)
> at org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:142)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:484)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:439)
> at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
> at org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
> at org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:81)
> at org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:830)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
> at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:58)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
> 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.NotSerializableException: com.ctc.wstx.io.WstxInputLocation *<-- IMPORTANT CAUSE*
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> at org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:403)
> at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
> ... 19 more
> {panel}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SM-1517) Error in ProviderProcessor when I receive
a no soap
Posted by "Jorge Rodríguez Pedrianes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/SM-1517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jorge Rodríguez Pedrianes updated SM-1517:
------------------------------------------
Description:
Hello!
I saw that when I use ProviderProcessor and the service don't response a soap xml, the servicemix is blocked.
For example, my remote service send me a 503 http response without xml response, only a html showing the error. Then when ProviderProcessor try to read a Fault soap xml throw a exception.
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// <-- ERROR: Response isn't a SOAP XML -->
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
{code}
the problem is that this exception can't be Serializable, and when ActiveMQ need serialice this throw a exception and never send the response.
I think that solution is:
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// Process error execution
close = processHttpError(method, exchange, context, txSync, close); * // ADDED *
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
private boolean processHttpError(PostMethod method, MessageExchange exchange, Context context, boolean txSync,
boolean close) throws Exception {
try {
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
} catch (Throwable e) {
log.debug("Invalid response", e);
Exception exception = new Exception("Invalid response");
exchange.setError(exception);
exchange.setStatus(ExchangeStatus.ERROR);
channel.send(exchange);
}
return close;
}
{code}
I think that this is necessary also in processInOptionalOut and processInOut method to avoid this situation.
Thanks
PD: This is the log of this situation
{panel}
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "HTTP/1.0 503 Service Unavailable[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Date: Wed, 20 Aug 2008 07:33:40 GMT[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.1.6 mod_jk/1.2.23 mod_perl/2.0.4 Perl/v5.8.5[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Length: 323[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Proxy-Connection: close[\r][\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<html><head>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<title>503 Service Temporarily Unavailable</title>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</head><body>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<h1>Service Temporarily Unavailable</h1>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<p>The server is temporarily unable to service your[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "request due to maintenance downtime or capacity[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "problems. Please try again later.</p>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</body></html>[\n]"
2008-08-20 09:37:50,449 ERROR [org.apache.servicemix.http.HttpComponent] Error processing exchange InOut[
id: ID:10.141.245.139-11bdb329047-5:279
status: Active
role: provider
service: gatewayService
endpoint: gateway
operation: {http://DefaultNamespace}getSmsStatus
in: <?xml version="1.0" encoding="UTF-8"?>IN MESSAGE
]
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
at [row,col {unknown-source}]: [1,50]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)
at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:59)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.next(ExtendedXMLStreamReader.java:61)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.nextTag(ExtendedXMLStreamReader.java:44)
at org.apache.servicemix.soap.marshalers.SoapReader.readSoapUsingStax(SoapReader.java:164)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:89)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:76)
at org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:164)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
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:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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)
2008-08-20 09:37:50,451 ERROR [org.apache.servicemix.http.HttpComponent] Error setting exchange status to ERROR *<-- IMPORTANT EXCEPTION*
java.lang.RuntimeException: com.ctc.wstx.io.WstxInputLocation
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
at org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:144)
at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:361)
at org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:142)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:484)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:439)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
at org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
at org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:81)
at org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:830)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:58)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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.NotSerializableException: com.ctc.wstx.io.WstxInputLocation *<-- IMPORTANT CAUSE*
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:403)
at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
... 19 more
{panel}
was:
Hello!
I saw that when I use ProviderProcessor and the service don't response a soap xml, the servicemix is blocked.
For example, my remote service send me a 503 http response without xml response, only a html showing the error. Then when ProviderProcessor try to read a Fault soap xml throw a exception.
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// <-- ERROR: Response isn't a SOAP XML -->
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
{code}
the problem is that this exception can't be Serializable, and when ActiveMQ need serialice this throw a exception and never send the response.
I think that solution is:
{code:title=ProviderProcessor.java|borderStyle=solid}
public void process(MessageExchange exchange) throws Exception {
...
int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
if (!(exchange instanceof InOnly)) {
// Process error execution
processError(method, exchange, context); * // ADDED *
if (txSync) {
channel.sendSync(exchange);
} else {
methods.put(exchange.getExchangeId(), method);
channel.send(exchange);
close = false;
}
return;
} else {
throw new Exception("Invalid status response: " + response);
}
}
...
}
private void processError(PostMethod method, MessageExchange exchange, Context context) {
try {
SoapReader reader = soapHelper.getSoapMarshaler().createReader();
Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(),
contentType != null ? contentType.getValue() : null);
context.setFaultMessage(soapMessage);
soapHelper.onAnswer(context);
Fault fault = exchange.createFault();
fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
exchange.setFault(fault);
} catch (Throwable e) {
log.debug("Invalid response", e);
Exception exception = new Exception("Invalid response");
exchange.setError(exception);
}
}
{code}
I think that this is necessary also in processInOptionalOut and processInOut method to avoid this situation.
Thanks
PD: This is the log of this situation
{panel}
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "HTTP/1.0 503 Service Unavailable[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Date: Wed, 20 Aug 2008 07:33:40 GMT[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.1.6 mod_jk/1.2.23 mod_perl/2.0.4 Perl/v5.8.5[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Length: 323[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Proxy-Connection: close[\r][\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<html><head>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<title>503 Service Temporarily Unavailable</title>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</head><body>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<h1>Service Temporarily Unavailable</h1>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<p>The server is temporarily unable to service your[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "request due to maintenance downtime or capacity[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "problems. Please try again later.</p>[\n]"
2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</body></html>[\n]"
2008-08-20 09:37:50,449 ERROR [org.apache.servicemix.http.HttpComponent] Error processing exchange InOut[
id: ID:10.141.245.139-11bdb329047-5:279
status: Active
role: provider
service: gatewayService
endpoint: gateway
operation: {http://DefaultNamespace}getSmsStatus
in: <?xml version="1.0" encoding="UTF-8"?>IN MESSAGE
]
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
at [row,col {unknown-source}]: [1,50]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)
at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:59)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.next(ExtendedXMLStreamReader.java:61)
at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.nextTag(ExtendedXMLStreamReader.java:44)
at org.apache.servicemix.soap.marshalers.SoapReader.readSoapUsingStax(SoapReader.java:164)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:89)
at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:76)
at org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:164)
at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
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:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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)
2008-08-20 09:37:50,451 ERROR [org.apache.servicemix.http.HttpComponent] Error setting exchange status to ERROR *<-- IMPORTANT EXCEPTION*
java.lang.RuntimeException: com.ctc.wstx.io.WstxInputLocation
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
at org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:144)
at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:361)
at org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:142)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:484)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:439)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
at org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
at org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:81)
at org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:830)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:58)
at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
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.NotSerializableException: com.ctc.wstx.io.WstxInputLocation *<-- IMPORTANT CAUSE*
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:403)
at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
... 19 more
{panel}
> Error in ProviderProcessor when I receive a no soap
> ---------------------------------------------------
>
> Key: SM-1517
> URL: https://issues.apache.org/activemq/browse/SM-1517
> Project: ServiceMix
> Issue Type: Bug
> Components: servicemix-http
> Affects Versions: 3.2, 3.2.1, 3.2.2
> Environment: servicemix 3.2.1
> Reporter: Jorge Rodríguez Pedrianes
>
> Hello!
> I saw that when I use ProviderProcessor and the service don't response a soap xml, the servicemix is blocked.
> For example, my remote service send me a 503 http response without xml response, only a html showing the error. Then when ProviderProcessor try to read a Fault soap xml throw a exception.
> {code:title=ProviderProcessor.java|borderStyle=solid}
> public void process(MessageExchange exchange) throws Exception {
> ...
> if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
> if (!(exchange instanceof InOnly)) {
> // <-- ERROR: Response isn't a SOAP XML -->
> SoapReader reader = soapHelper.getSoapMarshaler().createReader();
> Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
> soapMessage = reader.read(method.getResponseBodyAsStream(),
> contentType != null ? contentType.getValue() : null);
> context.setFaultMessage(soapMessage);
> soapHelper.onAnswer(context);
> Fault fault = exchange.createFault();
> fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
> soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
> exchange.setFault(fault);
> if (txSync) {
> channel.sendSync(exchange);
> } else {
> methods.put(exchange.getExchangeId(), method);
> channel.send(exchange);
> close = false;
> }
> return;
> } else {
> throw new Exception("Invalid status response: " + response);
> }
> }
> ...
> }
> {code}
> the problem is that this exception can't be Serializable, and when ActiveMQ need serialice this throw a exception and never send the response.
> I think that solution is:
> {code:title=ProviderProcessor.java|borderStyle=solid}
> public void process(MessageExchange exchange) throws Exception {
> ...
> int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
> if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
> if (!(exchange instanceof InOnly)) {
> // Process error execution
> close = processHttpError(method, exchange, context, txSync, close); * // ADDED *
> if (txSync) {
> channel.sendSync(exchange);
> } else {
> methods.put(exchange.getExchangeId(), method);
> channel.send(exchange);
> close = false;
> }
> return;
> } else {
> throw new Exception("Invalid status response: " + response);
> }
> }
> ...
> }
> private boolean processHttpError(PostMethod method, MessageExchange exchange, Context context, boolean txSync,
> boolean close) throws Exception {
> try {
> SoapReader reader = soapHelper.getSoapMarshaler().createReader();
> Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
> SoapMessage soapMessage = reader.read(method.getResponseBodyAsStream(),
> contentType != null ? contentType.getValue() : null);
> context.setFaultMessage(soapMessage);
> soapHelper.onAnswer(context);
> Fault fault = exchange.createFault();
> fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
> soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
> exchange.setFault(fault);
>
> if (txSync) {
> channel.sendSync(exchange);
> } else {
> methods.put(exchange.getExchangeId(), method);
> channel.send(exchange);
> close = false;
> }
> } catch (Throwable e) {
> log.debug("Invalid response", e);
> Exception exception = new Exception("Invalid response");
> exchange.setError(exception);
> exchange.setStatus(ExchangeStatus.ERROR);
> channel.send(exchange);
> }
> return close;
> }
> {code}
> I think that this is necessary also in processInOptionalOut and processInOut method to avoid this situation.
> Thanks
> PD: This is the log of this situation
> {panel}
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "HTTP/1.0 503 Service Unavailable[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Date: Wed, 20 Aug 2008 07:33:40 GMT[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.1.6 mod_jk/1.2.23 mod_perl/2.0.4 Perl/v5.8.5[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Length: 323[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
> 2008-08-20 09:37:50,443 DEBUG [httpclient.wire.header] << "Proxy-Connection: close[\r][\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<html><head>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<title>503 Service Temporarily Unavailable</title>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</head><body>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<h1>Service Temporarily Unavailable</h1>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "<p>The server is temporarily unable to service your[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "request due to maintenance downtime or capacity[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "problems. Please try again later.</p>[\n]"
> 2008-08-20 09:37:50,444 DEBUG [httpclient.wire.content] << "</body></html>[\n]"
> 2008-08-20 09:37:50,449 ERROR [org.apache.servicemix.http.HttpComponent] Error processing exchange InOut[
> id: ID:10.141.245.139-11bdb329047-5:279
> status: Active
> role: provider
> service: gatewayService
> endpoint: gateway
> operation: {http://DefaultNamespace}getSmsStatus
> in: <?xml version="1.0" encoding="UTF-8"?>IN MESSAGE
> ]
> com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
> at [row,col {unknown-source}]: [1,50]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
> at com.ctc.wstx.sr.BasicStreamReader.startDTD(BasicStreamReader.java:2482)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromPrologBang(BasicStreamReader.java:2398)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2058)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:59)
> at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.next(ExtendedXMLStreamReader.java:61)
> at org.apache.servicemix.jbi.jaxp.ExtendedXMLStreamReader.nextTag(ExtendedXMLStreamReader.java:44)
> at org.apache.servicemix.soap.marshalers.SoapReader.readSoapUsingStax(SoapReader.java:164)
> at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:89)
> at org.apache.servicemix.soap.marshalers.SoapReader.read(SoapReader.java:76)
> at org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:164)
> at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
> at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
> 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:170)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
> 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)
> 2008-08-20 09:37:50,451 ERROR [org.apache.servicemix.http.HttpComponent] Error setting exchange status to ERROR *<-- IMPORTANT EXCEPTION*
> java.lang.RuntimeException: com.ctc.wstx.io.WstxInputLocation
> at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:102)
> at org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:144)
> at org.apache.activemq.ActiveMQSession.createObjectMessage(ActiveMQSession.java:361)
> at org.apache.activemq.pool.PooledSession.createObjectMessage(PooledSession.java:142)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doRouting(AbstractJMSFlow.java:484)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.doSend(AbstractJMSFlow.java:439)
> at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:123)
> at org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:283)
> at org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:81)
> at org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:830)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
> at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:58)
> at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
> at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow.access$201(AbstractJMSFlow.java:63)
> at org.apache.servicemix.jbi.nmr.flow.jms.AbstractJMSFlow$4.run(AbstractJMSFlow.java:521)
> 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.NotSerializableException: com.ctc.wstx.io.WstxInputLocation *<-- IMPORTANT CAUSE*
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> at org.apache.servicemix.jbi.messaging.ExchangePacket.writeExternal(ExchangePacket.java:403)
> at org.apache.servicemix.jbi.messaging.MessageExchangeImpl.writeExternal(MessageExchangeImpl.java:605)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> at org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:96)
> ... 19 more
> {panel}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.