Apache front-end with tomcat backend running REST service,(CXF Container), 500 internal error

813 views Asked by At

When I check the logs, I see that the application request was redirected to tomcat properly and the rest service executed. The rest service returns a http status code 400 on error, with a list of errors passed in a json string in the response body. However, when i send a request the response recieved from the the frontend is always a 500 internal error. I am providing the tomcat and apache logs here.

    **Catalina.out:**

org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:252)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
        at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:873)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:396)
        at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:426)
        at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:345)
        at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:298)
        at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:151)
        at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:804)
        at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
        at org.apache.cxf.transport.http.AbstractHTTPDestination$BackChannelConduit.close(AbstractHTTPDestination.java:735)
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 34 more
Caused by: java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
        at sun.nio.ch.IOUtil.write(IOUtil.java:65)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
        at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:124)
        at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
        at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:172)
        at org.apache.coyote.ajp.AjpNioProcessor.output(AjpNioProcessor.java:140)
        at org.apache.coyote.ajp.AbstractAjpProcessor.writeResponseMessage(AbstractAjpProcessor.java:1754)
        at org.apache.coyote.ajp.AbstractAjpProcessor.writeData(AbstractAjpProcessor.java:1673)
        at org.apache.coyote.ajp.AbstractAjpProcessor.access$300(AbstractAjpProcessor.java:62)
        at org.apache.coyote.ajp.AbstractAjpProcessor$SocketOutputBuffer.doWrite(AbstractAjpProcessor.java:1820)
        at org.apache.coyote.Response.doWrite(Response.java:491)
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:391)
        ... 42 more

****Apache logs:****

[Wed Dec 21 17:09:37.827172 2016] [ssl:info] [pid 9897:tid 139814575982336] [client 172.16.222.18:58770] AH01964: Connection to child 1 established (server ft1-emailservice:443)
[Wed Dec 21 17:09:37.827410 2016] [ssl:debug] [pid 9897:tid 139814575982336] ssl_engine_kernel.c(2115): [client 172.16.222.18:58770] AH02043: SSL virtual host for servername ft1-emailservice found
[Wed Dec 21 17:09:37.853864 2016] [ssl:debug] [pid 9897:tid 139814575982336] ssl_engine_kernel.c(2042): [client 172.16.222.18:58770] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
[Wed Dec 21 17:09:37.863560 2016] [ssl:debug] [pid 9897:tid 139814575982336] ssl_engine_kernel.c(366): [client 172.16.222.18:58770] AH02034: Initial (No.1) HTTPS request received for child 1 (server ft1-emailservice:443)
[Wed Dec 21 17:09:37.863596 2016] [authz_core:debug] [pid 9897:tid 139814575982336] mod_authz_core.c(835): [client 172.16.222.18:58770] AH01628: authorization result: granted (no directives)
[Wed Dec 21 17:09:37.863645 2016] [proxy:debug] [pid 9897:tid 139814575982336] mod_proxy.c(1200): [client 172.16.222.18:58770] AH01143: Running scheme ajp handler (attempt 0)
[Wed Dec 21 17:09:37.863651 2016] [proxy_ajp:debug] [pid 9897:tid 139814575982336] mod_proxy_ajp.c(743): [client 172.16.222.18:58770] AH00895: serving URL ajp://10.212.125.35:11009/emailservice/v1/orders/1514481007/send
[Wed Dec 21 17:09:37.863657 2016] [proxy:debug] [pid 9897:tid 139814575982336] proxy_util.c(2156): AH00942: AJP: has acquired connection for (10.212.125.35)
[Wed Dec 21 17:09:37.863661 2016] [proxy:debug] [pid 9897:tid 139814575982336] proxy_util.c(2209): [client 172.16.222.18:58770] AH00944: connecting ajp://10.212.125.35:11009/emailservice/v1/orders/1514481007/send to 10.212.125.35:11009
[Wed Dec 21 17:09:37.863673 2016] [proxy:debug] [pid 9897:tid 139814575982336] proxy_util.c(2418): [client 172.16.222.18:58770] AH00947: connected /emailservice/v1/orders/1514481007/send to 10.212.125.35:11009
[Wed Dec 21 17:09:37.864395 2016] [proxy:debug] [pid 9897:tid 139814575982336] proxy_util.c(2811): AH02824: AJP: connection established with 10.212.125.35:11009 (10.212.125.35)
[Wed Dec 21 17:09:37.864445 2016] [proxy_ajp:debug] [pid 9897:tid 139814575982336] mod_proxy_ajp.c(269): [client 172.16.222.18:58770] AH00872: APR_BUCKET_IS_EOS
[Wed Dec 21 17:09:37.864450 2016] [proxy_ajp:debug] [pid 9897:tid 139814575982336] mod_proxy_ajp.c(275): [client 172.16.222.18:58770] AH00873: data to read (max 8186 at 4)
[Wed Dec 21 17:09:37.864454 2016] [proxy_ajp:debug] [pid 9897:tid 139814575982336] mod_proxy_ajp.c(289): [client 172.16.222.18:58770] AH00875: got 229 bytes of data

==> errors.20161221 <==
[Wed Dec 21 17:09:38.365718 2016] [proxy_ajp:error] [pid 9897:tid 139814575982336] (104)Connection reset by peer: AH01030: ajp_ilink_receive() can't receive header

==> errors.EMS.20161221 <==
[Wed Dec 21 17:09:38.365769 2016] [proxy_ajp:error] [pid 9897:tid 139814575982336] [client 172.16.222.18:58770] AH00992: ajp_read_header: ajp_ilink_receive failed
[Wed Dec 21 17:09:38.365778 2016] [proxy_ajp:error] [pid 9897:tid 139814575982336] (120006)APR does not understand this error code: [client 172.16.222.18:58770] AH00878: read response failed from 10.212.125.35:11009 (10.212.125.35)
[Wed Dec 21 17:09:38.365785 2016] [proxy:debug] [pid 9897:tid 139814575982336] proxy_util.c(2171): AH00943: AJP: has released connection for (10.212.125.35)
[Wed Dec 21 17:09:38.365971 2016] [ssl:debug] [pid 9897:tid 139814575982336] ssl_engine_io.c(1033): [client 172.16.222.18:58770] AH02001: Connection closed to child 1 with standard shutdown (server ft1-emailservice:443)
0

There are 0 answers