You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Husarik, Branko" <br...@hp.com> on 2013/01/02 15:33:48 UTC

Tomcat doesn't process error messages

Hello,

I am a bit desperate thanks to my issue with Tomcat, which seems to be like common matter. I am using Tomcat 6.0.35 as a proxy between Oracle and Web service. Tomcat is running on AIX Version 6.1. There is send request http message from Oracle to the Proxy and message is forwarded to the Web service as https. Web services responses https message to Proxy and it is send back to Oracle as http.

When Web service responds HTTP/1.1 200 OK, everything works well and the Soap Message is correctly forwarded back to Oracle.
When Web service responds HTTP/1.1 500 Internal Server Error, proxy fails during getInputStream() method.
There is thrown IOException and Soap message is not forwarded back. Error message is "Server returned HTTP response code: 500 for URL: https://hktibt.rdm.cz:39990/...." and cause is null. I tried to add getErrorStream() executing in case getInputStream() is not working, but the result is null. Please do you know some way, how to process incoming "Error messages"? Is it caused by bad setup of configuration?

Thank you very much.

I am attaching both responses from web service:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Content-Length: 878
Date: Wed, 02 Jan 2013 13:15:24 GMT

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:ActivateServiceRes xmlns:ns0="http://selfcare.ei.tmobile.cz/datatypes"><ns0:eiMessageContext><ns1:sender xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">VCCNG</ns1:sender><ns1:correlationId xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">12000001138552</ns1:correlationId></ns0:eiMessageContext><ns0:data><ns0:ServiceHeader xmlns:ns1="http://messaging.ei.tmobile.net/datatypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ns0:userName>sa</ns0:userName></ns0:ServiceHeader><ns0:OmsStatus><ns0:orderStatus>IN-PROCESS</ns0:orderStatus></ns0:OmsStatus></ns0:data></ns0:ActivateServiceRes></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Content-Length: 1407
Date: Wed, 02 Jan 2013 13:28:33 GMT
Connection: close

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns="">SOAP-ENV:Server</faultcode><faultstring xmlns="">This is an operation implementation generated fault</faultstring><faultactor xmlns=""/><detail xmlns=""><ns:BusinessServiceException xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://selfcare.ei.tmobile.cz/datatypes" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><ns0:eiMessageContext xmlns:ns0="http://messaging.ei.tmobile.net/datatypes"><ns0:sender>VCCNG</ns0:sender><ns0:correlationId>12000013075712</ns0:correlationId></ns0:eiMessageContext><ns1:timestamp xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">2013-01-02T14:28:33.392+01:00</ns1:timestamp><ns1:exceptionClass xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">1002000004</ns1:exceptionClass><ns1:furtherInfo xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">Validation error</ns1:furtherInfo><ns:breData xmlns:ns0="http://www.tibco.com/schemas/BS_SA/Internal"><ns1:reason xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes">NOT_PROPER_TARIFF</ns1:reason><ns1:textInfo xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes">.</ns1:textInfo></ns:breData></ns:BusinessServiceException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Best Regards

Braňko

Re: Tomcat doesn't process error messages

Posted by André Warnier <aw...@ice-sa.com>.
Hi.

Husarik, Branko wrote:
> Hello,
> 
> I am a bit desperate thanks to my issue with Tomcat, which seems to be like common matter. I am using Tomcat 6.0.35 as a proxy between Oracle and Web service. Tomcat is running on AIX Version 6.1. There is send request http message from Oracle to the Proxy and message is forwarded to the Web service as https. Web services responses https message to Proxy and it is send back to Oracle as http.
> 
> When Web service responds HTTP/1.1 200 OK, everything works well and the Soap Message is correctly forwarded back to Oracle.
> When Web service responds HTTP/1.1 500 Internal Server Error, proxy fails during getInputStream() method.
> There is thrown IOException and Soap message is not forwarded back. Error message is "Server returned HTTP response code: 500 for URL: https://hktibt.rdm.cz:39990/...." and cause is null. I tried to add getErrorStream() executing in case getInputStream() is not working, but the result is null. Please do you know some way, how to process incoming "Error messages"? Is it caused by bad setup of configuration?
> 

I am not quite sure what your problem is, but I am quite sure that there is no part of the 
standard Tomcat software which acts as a proxy server.
Can you explain which code is actually performing this proxying function ?
(It must be some webapp running under Tomcat, but it does not belong to the standard 
Tomcat release).

> Thank you very much.
> 
> I am attaching both responses from web service:
> 
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 878
> Date: Wed, 02 Jan 2013 13:15:24 GMT
> 
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:ActivateServiceRes xmlns:ns0="http://selfcare.ei.tmobile.cz/datatypes"><ns0:eiMessageContext><ns1:sender xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">VCCNG</ns1:sender><ns1:correlationId xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">12000001138552</ns1:correlationId></ns0:eiMessageContext><ns0:data><ns0:ServiceHeader xmlns:ns1="http://messaging.ei.tmobile.net/datatypes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ns0:userName>sa</ns0:userName></ns0:ServiceHeader><ns0:OmsStatus><ns0:orderStatus>IN-PROCESS</ns0:orderStatus></ns0:OmsStatus></ns0:data></ns0:ActivateServiceRes></SOAP-ENV:Body></SOAP-ENV:Envelope>
> 
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 1407
> Date: Wed, 02 Jan 2013 13:28:33 GMT
> Connection: close
> 
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns="">SOAP-ENV:Server</faultcode><faultstring xmlns="">This is an operation implementation generated fault</faultstring><faultactor xmlns=""/><detail xmlns=""><ns:BusinessServiceException xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://selfcare.ei.tmobile.cz/datatypes" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><ns0:eiMessageContext xmlns:ns0="http://messaging.ei.tmobile.net/datatypes"><ns0:sender>VCCNG</ns0:sender><ns0:correlationId>12000013075712</ns0:correlationId></ns0:eiMessageContext><ns1:timestamp xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">2013-01-02T14:28:33.392+01:00</ns1:timestamp><ns1:exceptionClass xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">1002000004</ns1:exceptionClass><ns1:furtherInfo xmlns:ns1="http:/
/messaging.ei.tmobile.net/datatypes">Validation error</ns1:furtherInfo><ns:breData xmlns:ns0="http://www.tibco.com/schemas/BS_SA/Internal"><ns1:reason xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes">NOT_PROPER_TARIFF</ns1:reason><ns1:textInfo xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes">.</ns1:textInfo></ns:breData></ns:BusinessServiceException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
> 
> Best Regards
> 
> Braňko
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by "Husarik, Branko" <br...@hp.com>.
Hello, 

Sorry for replying so late. There are error data following: 

Error message:
Server returned HTTP response code: 500 for URL: https://hktibt.rdm.cz:39990/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint

Error cause:
null

Error trace:
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1179)
                com.ibm.net.ssl.www2.protocol.https.a.getInputStream(a.java:73)
                com.ceskyweb.soapproxy.SOAPProxy.doPost(SOAPProxy.java:379)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:156)
                org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
                org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
                java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
                java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
                java.lang.Thread.run(Thread.java:810)

Purpose of this proxy is to add basic authentization into request, to add ssl (truststore), to forward request from oracle to web service, to forward response back and to log whole process.

I am adding log of whole process:

22.01.2013 15:50:35 - DEBUG - -  incoming HTTP headers  -
22.01.2013 15:50:35 - DEBUG - Header: host=localhost:8943
22.01.2013 15:50:35 - DEBUG - Header: connection=close, TE
22.01.2013 15:50:35 - DEBUG - Header: te=trailers, deflate, gzip, compress
22.01.2013 15:50:35 - DEBUG - Header: user-agent=RPT-HTTPClient/0.3-3
22.01.2013 15:50:35 - DEBUG - Header: soapaction="/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint/activate"
22.01.2013 15:50:35 - DEBUG - Header: accept-encoding=gzip, x-gzip, compress, x-compress
22.01.2013 15:50:35 - DEBUG - Header: content-type=text/xml; charset=UTF-8
22.01.2013 15:50:35 - DEBUG - Header: content-length=1723
22.01.2013 15:50:35 - DEBUG - -  END of incoming HTTP headers  -
22.01.2013 15:50:35 - DEBUG - -  Basic autorization not in request  -
22.01.2013 15:50:35 - DEBUG - -  There will be used basic auth from configuration  -
22.01.2013 15:50:35 - INFO - called soap action: "/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint/activate"
22.01.2013 15:50:35 - DEBUG - Opening connection to: https://hktibt.rdm.cz:39990/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint .
..
22.01.2013 15:50:40 - DEBUG - ... connection opened
22.01.2013 15:50:40 - DEBUG - using Basic HTTP authentication to API: Basic abcdefghijklmnopqrstuvwxyz==
22.01.2013 15:50:40 - DEBUG - Connecting to: https://hktibt.rdm.cz:39990/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint ...
22.01.2013 15:50:42 - DEBUG - ... connected
22.01.2013 15:50:42 - DEBUG - getting output stream to https://hktibt.rdm.cz:39990/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint
...
22.01.2013 15:50:42 - DEBUG - OK
22.01.2013 15:50:42 - DEBUG - getting request input stream ...
22.01.2013 15:50:42 - DEBUG - OK
22.01.2013 15:50:42 - DEBUG - forwarding input to output...
22.01.2013 15:50:42 - DEBUG - forward OK
22.01.2013 15:50:42 - DEBUG - getting input stream of https://hktibt.rdm.cz:39990/WebServices/SA/SA.serviceagent/SaPortTypeEndpoint.
..
22.01.2013 15:50:43 - INFO - error message: Server returned HTTP response code: 500 for URL: https://hktibt.rdm.cz:39990/WebServices
/SA/SA.serviceagent/SaPortTypeEndpoint
22.01.2013 15:50:43 - INFO - error cause: null
22.01.2013 15:50:43 - INFO - error trace: sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1179)
                com.ibm.net.ssl.www2.protocol.https.a.getInputStream(a.java:73)
                com.ceskyweb.soapproxy.SOAPProxy.doPost(SOAPProxy.java:379)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
                javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:156)
                org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
                org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
                java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
                java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
                java.lang.Thread.run(Thread.java:810)

22.01.2013 15:50:43 - INFO - remote server returned error code: 500
22.01.2013 15:50:43 - INFO - remote server returned error mesagge: Internal Server Error
22.01.2013 15:50:43 - INFO - remote server returned error stream mesagge: Internal Server Error
22.01.2013 15:50:43 - DEBUG - -   returned headers  -
22.01.2013 15:50:43 - DEBUG - Server=Apache-Coyote/1.1
22.01.2013 15:50:43 - DEBUG - Content-Type=text/xml;charset=utf-8
22.01.2013 15:50:43 - DEBUG - Connection=close
22.01.2013 15:50:43 - DEBUG - Content-Length=1407
22.01.2013 15:50:43 - DEBUG - Date=Tue, 22 Jan 2013 14:50:43 GMT
22.01.2013 15:50:43 - DEBUG - null=HTTP/1.1 500 Internal Server Error
22.01.2013 15:50:43 - DEBUG - -  END of returned headers  -
22.01.2013 15:50:43 - DEBUG - forwarding response to remote user...
22.01.2013 15:50:43 - DEBUG - forward OK

Braňko


-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: 3. ledna 2013 23:58
To: Tomcat Users List
Subject: Re: Tomcat doesn't process error messages

Husarik, Branko wrote:
> Hello,
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service Oracle --> 
> HTTP --> Tomcat --> Input/Output stream --> webapp --> Input/Output 
> stream --> Tomcat --> HTTPS --> Web Service
> 

I think that this is wrong. Tomcat should not be in this part :
webapp --> Input/Output stream --> Tomcat --> HTTPS --> Web Service

Tomcat plays no role at all in the dialog between the webapp and the Web Service.

> Response message receiving process from Web Service to Oracle Web 
> Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp --> 
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 

Similarly, this part is wrong :
Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp Tomcat plays no role there.

Instead, it is the webapp which sets up its own independent HTTPS connection to the Web service, writes to that connection and reads from it.  Tomcat does not even know that this HTTPS connection exists.

I think that you misunderstand the nature of the problem. You seem to think that Tomcat is involved in the dialog between the webapp and the web service, so you think that when it goes wrong, it must be due to something in Tomcat.
But Tomcat is /not/ involved in that part.
So I believe that you are looking in the wrong place.


> The problem occures during the receiving stage (Tomcat --> Input/Output stream --> webapp) when the response from Web service cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com]
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
>> SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
>>
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be 
> a client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to 
> Tomcat))
> 
> response :
> ( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle 
> client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat doesn't process error messages

Posted by André Warnier <aw...@ice-sa.com>.
Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp --> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 

I think that this is wrong. Tomcat should not be in this part :
webapp --> Input/Output stream --> Tomcat --> HTTPS --> Web Service

Tomcat plays no role at all in the dialog between the webapp and the Web Service.

> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp --> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 

Similarly, this part is wrong :
Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp
Tomcat plays no role there.

Instead, it is the webapp which sets up its own independent HTTPS connection to the Web 
service, writes to that connection and reads from it.  Tomcat does not even know that this 
HTTPS connection exists.

I think that you misunderstand the nature of the problem. You seem to think that Tomcat is 
involved in the dialog between the webapp and the web service, so you think that when it 
goes wrong, it must be due to something in Tomcat.
But Tomcat is /not/ involved in that part.
So I believe that you are looking in the wrong place.


> The problem occures during the receiving stage (Tomcat --> Input/Output stream --> webapp) when the response from Web service cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
>> SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
>>
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))
> 
> response :
> ( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat doesn't process error messages

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Tim,

On 1/3/13 10:09 AM, Tim Watts wrote:
> I just re-read your original email and I may have missed something.
> Are you saying that you get an IOException when you call 
> request.getInputStream() during a 500 response?  If so can you
> please post the stack trace.

+1

I think this will clear everything up.

Also, please tell us who wrote the code that calls getInputStream (on
what? Probably an HttpURLConnection...).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDnWBoACgkQ9CaO5/Lv0PCfRACguRxq3+zCIE2HpqXziT4Kt/cq
Ja4AnjB6uwkU54AtGDLM6nM+lqUmTxYm
=86+7
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Thu, 2013-01-03 at 12:42 +0000, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
I just re-read your original email and I may have missed something.  Are
you saying that you get an IOException when you call
request.getInputStream() during a 500 response?  If so can you please
post the stack trace.


> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))
> 
> response :
> ( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Thu, 2013-01-03 at 12:42 +0000, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 

Sounds like 'webapp' is what you referred to as the 'Proxy' in your
original message?  And it sounds like it's the 'webapp' that's
discarding the SOAP response.  Perhaps when it sees the 500 HTTP
response code it simply discards the body of the response and sends that
generic error message instead -- e.g. by calling sendError() and letting
Tomcat generate it's default error response or the webapp's error page
(if one is defined)?

Depending on which component you have control over you can either:
     1. Modify the 'webapp' to unconditionally send back the response
        body (perhaps by modifying it's error page if one is defined)
        -- OR --
     2. Modify the Web Service to reply with a 200 HTTP response code
        even if the service request fails.

#2 seems the more reasonable approach to me since the failure is on the
service level not the HTTP level.

But in either case there's no tweaking in Tomcat itself that will fix
this.


> Braňko
> 
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))
> 
> response :
> ( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by Tim Watts <ti...@cliftonfarm.org>.
On Thu, 2013-01-03 at 12:42 +0000, Husarik, Branko wrote:
> Hello, 
> 
> I will try to clarify the process as I see it:
> 
> Request message sending process  from Oracle to Web Service
> Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTPS --> Web Service
> 
> Response message receiving process from Web Service to Oracle
> Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp -->
> Input/Output stream --> Tomcat --> HTTP --> Oracle
> 
It's also important to note that in the WebService-->webapp path the
webapp is acting as an HTTP client.  If I'm understanding you correctly
then, if the webapp calls request.getInputStream() that stream would be
connected to the Oracle client NOT the WebService.  Since the request
has already been completely read (and presumably closed?) it's
understandable that you would get an IOException trying to read from it.


> The problem occures during the receiving stage (Tomcat -->
> Input/Output stream --> webapp) when the response from Web service
> cointains "HTTP/1.1 500 Internal Server Error"
> 
> Webapp modifies the message (for example it adds basic
> authentication). I hope I don't miss something Big.
> 
> Braňko
> 
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com] 
> Sent: 3. ledna 2013 11:23
> To: Tomcat Users List
> Subject: Re: Tomcat doesn't process error messages
> 
> Husarik, Branko wrote:
> > SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
> > 
> Hi.
> Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.
> 
> In the scenario as you describe it,
> - Oracle is the HTTP client for Tomcat (just like any browser could be a client)
> - inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
> Schematically, we have this :
> 
> request :
> Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))
> 
> response :
> ( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client
> 
> Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
> (For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
> It is the webapp which is responsible for that kind of thing.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by "Husarik, Branko" <br...@hp.com>.
Hello, 

I will try to clarify the process as I see it:

Request message sending process  from Oracle to Web Service
Oracle --> HTTP --> Tomcat --> Input/Output stream --> webapp --> Input/Output stream --> Tomcat --> HTTPS --> Web Service

Response message receiving process from Web Service to Oracle
Web Service--> HTTPS --> Tomcat --> Input/Output stream --> webapp --> Input/Output stream --> Tomcat --> HTTP --> Oracle

The problem occures during the receiving stage (Tomcat --> Input/Output stream --> webapp) when the response from Web service cointains "HTTP/1.1 500 Internal Server Error"

Webapp modifies the message (for example it adds basic authentication). I hope I don't miss something Big.

Braňko

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: 3. ledna 2013 11:23
To: Tomcat Users List
Subject: Re: Tomcat doesn't process error messages

Husarik, Branko wrote:
> SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
> 
Hi.
Personally, I do not understand what you are trying to say.  I believe that there is some incorrect understanding on your part of how this is supposed to work.

In the scenario as you describe it,
- Oracle is the HTTP client for Tomcat (just like any browser could be a client)
- inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process some HTTP requests (depending on the URL of the request), and generate a HTTP response.
Schematically, we have this :

request :
Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))

response :
( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client

Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
(For example, if the webapp uses HTTPS to communicate with something else, Tomcat never knows this, and never plays any role in that part) So in this case, if the webapp generates a response which happens to be a 500 error, Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream coming back from the webapp" or anything like this.
It is the webapp which is responsible for that kind of thing.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat doesn't process error messages

Posted by André Warnier <aw...@ice-sa.com>.
Husarik, Branko wrote:
> SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.
> 
Hi.
Personally, I do not understand what you are trying to say.  I believe that there is some 
incorrect understanding on your part of how this is supposed to work.

In the scenario as you describe it,
- Oracle is the HTTP client for Tomcat (just like any browser could be a client)
- inside Tomcat, runs some webapp which happens to be a SOAP proxy. What this webapp does, 
is unknown to Tomcat.  As far as Tomcat is concerned, this webapp is supposed to process 
some HTTP requests (depending on the URL of the request), and generate a HTTP response.
Schematically, we have this :

request :
Oracle client --> HTTP --> Tomcat --> webapp (--> ???? (unknown to Tomcat))

response :
( ???? (unknown to Tomcat) --> ) webapp --> Tomcat --> HTTP --> Oracle client

Repeat : what the webapp does inside is unknown and of (almost) no interest to Tomcat.
(For example, if the webapp uses HTTPS to communicate with something else, Tomcat never 
knows this, and never plays any role in that part)
So in this case, if the webapp generates a response which happens to be a 500 error, 
Tomcat will forward this to the (Oracle client).  Tomcat will never read any "input stream 
coming back from the webapp" or anything like this.
It is the webapp which is responsible for that kind of thing.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat doesn't process error messages

Posted by "Husarik, Branko" <br...@hp.com>.
SOAP service logic should manipulate the message, but there is need to receive message from Tomcat by reading it's input stream. Problem is, there is only error stream cointaining tomcat error coming from Tomcat. I think it is caused by message from web service, which cointains " HTTP/1.1 500 Internal Server Error " in HTTP protocol and SOAP message is not forwarded. It seems to me like common logic, but i don't know, how to set Tomcat to forward these messages to input stream.

-----Original Message-----
From: Igor Cicimov [mailto:icicimov@gmail.com] 
Sent: 3. ledna 2013 1:44
To: Tomcat Users List
Subject: Re: Tomcat doesn't process error messages

On Thu, Jan 3, 2013 at 1:33 AM, Husarik, Branko <br...@hp.com>wrote:

> Hello,
>
> I am a bit desperate thanks to my issue with Tomcat, which seems to be 
> like common matter. I am using Tomcat 6.0.35 as a proxy between Oracle 
> and Web service. Tomcat is running on AIX Version 6.1. There is send 
> request http message from Oracle to the Proxy and message is forwarded 
> to the Web service as https. Web services responses https message to 
> Proxy and it is send back to Oracle as http.
>
> When Web service responds HTTP/1.1 200 OK, everything works well and 
> the Soap Message is correctly forwarded back to Oracle.
> When Web service responds HTTP/1.1 500 Internal Server Error, proxy 
> fails during getInputStream() method.
> There is thrown IOException and Soap message is not forwarded back. 
> Error message is "Server returned HTTP response code: 500 for URL:
> https://hktibt.rdm.cz:39990/...." and cause is null. I tried to add
> getErrorStream() executing in case getInputStream() is not working, 
> but the result is null. Please do you know some way, how to process 
> incoming "Error messages"? Is it caused by bad setup of configuration?
>
> Thank you very much.
>
> I am attaching both responses from web service:
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 878
> Date: Wed, 02 Jan 2013 13:15:24 GMT
>
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:Activat
> eServiceRes 
> xmlns:ns0="http://selfcare.ei.tmobile.cz/datatypes"><ns0:eiMessageCont
> ext><ns1:sender 
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">VCCNG</ns1:sende
> r><ns1:correlationId 
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">12000001138552</
> ns1:correlationId></ns0:eiMessageContext><ns0:data><ns0:ServiceHeader
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:env="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
> "><ns0:userName>sa</ns0:userName></ns0:ServiceHeader><ns0:OmsStatus><n
> s0:orderStatus>IN-PROCESS</ns0:orderStatus></ns0:OmsStatus></ns0:data>
> </ns0:ActivateServiceRes></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 1407
> Date: Wed, 02 Jan 2013 13:28:33 GMT
> Connection: close
>
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fa
> ult><faultcode xmlns="">SOAP-ENV:Server</faultcode><faultstring 
> xmlns="">This is an operation implementation generated 
> fault</faultstring><faultactor xmlns=""/><detail 
> xmlns=""><ns:BusinessServiceException xmlns:xs="
> http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="
> http://selfcare.ei.tmobile.cz/datatypes" xmlns:ns0="
> http://schemas.xmlsoap.org/soap/envelope/"><ns0:eiMessageContext
> xmlns:ns0="http://messaging.ei.tmobile.net/datatypes"><ns0:sender>VCCN
> G</ns0:sender><ns0:correlationId>12000013075712</ns0:correlationId></n
> s0:eiMessageContext><ns1:timestamp
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">2013-01-02T14:28
> :33.392+01:00</ns1:timestamp><ns1:exceptionClass
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">1002000004</ns1:
> exceptionClass><ns1:furtherInfo 
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">Validation
> error</ns1:furtherInfo><ns:breData xmlns:ns0="
> http://www.tibco.com/schemas/BS_SA/Internal"><ns1:reason xmlns:ns1="
> http://selfcare.ei.tmobile.cz/datatypes">NOT_PROPER_TARIFF</ns1:reason
> ><ns1:textInfo xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes
> ">.</ns1:textInfo></ns:breData></ns:BusinessServiceException></detail>
> </SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> Best Regards
>
> Braňko
>

Shouldn't this be handled by the SOAP service logic running on the tomcat server?

Re: Tomcat doesn't process error messages

Posted by Igor Cicimov <ic...@gmail.com>.
On Thu, Jan 3, 2013 at 1:33 AM, Husarik, Branko <br...@hp.com>wrote:

> Hello,
>
> I am a bit desperate thanks to my issue with Tomcat, which seems to be
> like common matter. I am using Tomcat 6.0.35 as a proxy between Oracle and
> Web service. Tomcat is running on AIX Version 6.1. There is send request
> http message from Oracle to the Proxy and message is forwarded to the Web
> service as https. Web services responses https message to Proxy and it is
> send back to Oracle as http.
>
> When Web service responds HTTP/1.1 200 OK, everything works well and the
> Soap Message is correctly forwarded back to Oracle.
> When Web service responds HTTP/1.1 500 Internal Server Error, proxy fails
> during getInputStream() method.
> There is thrown IOException and Soap message is not forwarded back. Error
> message is "Server returned HTTP response code: 500 for URL:
> https://hktibt.rdm.cz:39990/...." and cause is null. I tried to add
> getErrorStream() executing in case getInputStream() is not working, but the
> result is null. Please do you know some way, how to process incoming "Error
> messages"? Is it caused by bad setup of configuration?
>
> Thank you very much.
>
> I am attaching both responses from web service:
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 878
> Date: Wed, 02 Jan 2013 13:15:24 GMT
>
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:ActivateServiceRes
> xmlns:ns0="http://selfcare.ei.tmobile.cz/datatypes"><ns0:eiMessageContext><ns1:sender
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">VCCNG</ns1:sender><ns1:correlationId
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">12000001138552</ns1:correlationId></ns0:eiMessageContext><ns0:data><ns0:ServiceHeader
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" xmlns:env="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
> "><ns0:userName>sa</ns0:userName></ns0:ServiceHeader><ns0:OmsStatus><ns0:orderStatus>IN-PROCESS</ns0:orderStatus></ns0:OmsStatus></ns0:data></ns0:ActivateServiceRes></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/xml;charset=utf-8
> Content-Length: 1407
> Date: Wed, 02 Jan 2013 13:28:33 GMT
> Connection: close
>
> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode
> xmlns="">SOAP-ENV:Server</faultcode><faultstring xmlns="">This is an
> operation implementation generated fault</faultstring><faultactor
> xmlns=""/><detail xmlns=""><ns:BusinessServiceException xmlns:xs="
> http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="
> http://selfcare.ei.tmobile.cz/datatypes" xmlns:ns0="
> http://schemas.xmlsoap.org/soap/envelope/"><ns0:eiMessageContext
> xmlns:ns0="http://messaging.ei.tmobile.net/datatypes"><ns0:sender>VCCNG</ns0:sender><ns0:correlationId>12000013075712</ns0:correlationId></ns0:eiMessageContext><ns1:timestamp
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">2013-01-02T14:28:33.392+01:00</ns1:timestamp><ns1:exceptionClass
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">1002000004</ns1:exceptionClass><ns1:furtherInfo
> xmlns:ns1="http://messaging.ei.tmobile.net/datatypes">Validation
> error</ns1:furtherInfo><ns:breData xmlns:ns0="
> http://www.tibco.com/schemas/BS_SA/Internal"><ns1:reason xmlns:ns1="
> http://selfcare.ei.tmobile.cz/datatypes">NOT_PROPER_TARIFF</ns1:reason><ns1:textInfo
> xmlns:ns1="http://selfcare.ei.tmobile.cz/datatypes
> ">.</ns1:textInfo></ns:breData></ns:BusinessServiceException></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
> Best Regards
>
> Braňko
>

Shouldn't this be handled by the SOAP service logic running on the tomcat
server?