Hi Team,
I am using tRESTClient in one of my jobs to POST data and DELETE data when required.
POST works perfectly fine but DELETE throws me the following error:
Exception in component tRESTClient_1
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: .Problem with writing the request message, class : class org.dom4j.tree.DefaultDocument, ContentType : application/xml.
at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1121)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1072)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:878)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:852)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:312)
at finance_datalake.copy_of_poc_soa_api_0_1.Copy_of_POC_SOA_API.tGreenplumInput_1Process(Copy_of_POC_SOA_API.java:2624)
at finance_datalake.copy_of_poc_soa_api_0_1.Copy_of_POC_SOA_API.runJobInTOS(Copy_of_POC_SOA_API.java:6296)
at finance_datalake.copy_of_poc_soa_api_0_1.Copy_of_POC_SOA_API.main(Copy_of_POC_SOA_API.java:5954)
Caused by: org.apache.cxf.interceptor.Fault: .Problem with writing the request message, class : class org.dom4j.tree.DefaultDocument, ContentType : application/xml.
at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1202)
at org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1052)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:635)
at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1071)
... 6 more
Caused by: javax.ws.rs.client.ClientException: .Problem with writing the request message, class : class org.dom4j.tree.DefaultDocument, ContentType : application/xml.
at org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:756)
at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:450)
at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1197)
... 10 more
Caused by: java.net.ProtocolException: HTTP method DELETE doesn't support output
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:174)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1290)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1246)
at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:201)
at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:80)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
at java.io.BufferedWriter.flush(Unknown Source)
at org.dom4j.io.XMLWriter.flush(XMLWriter.java:272)
at org.dom4j.io.XMLWriter.write(XMLWriter.java:350)
at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:92)
at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:42)
at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1295)
at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:436)
... 11 more
Requesting you to kindly help me out in debugging the error/configuring the RESTClient.
Job Design:
DB_Input --> XMLMap --> tRESTClient -->tLogRow