0

I'm calling rest API with POST. Its happening in JAVA based ETL tool.

Here is my steps:

String inp = My JSON data;

Then am converting above string document type and then using in to call API

But am getting bellow error

Exception in component tRESTClient_1
javax.ws.rs.ProcessingException: java.lang.IllegalArgumentException: URI is not absolute
    at org.apache.cxf.jaxrs.client.AbstractClient.checkClientException(AbstractClient.java:582)
    at org.apache.cxf.jaxrs.client.AbstractClient.preProcessResult(AbstractClient.java:564)
    at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1144)
    at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1094)
    at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:894)
    at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:865)
    at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:428)
    at org.apache.cxf.jaxrs.client.WebClient.post(WebClient.java:458)
    at project_salesforce.jbposemailsignupcall_0_10.jbPosEmailSignupCall.tFixedFlowInput_1Process(jbPosEmailSignupCall.java:5319)
    at project_salesforce.jbposemailsignupcall_0_10.jbPosEmailSignupCall.tFileList_1Process(jbPosEmailSignupCall.java:4129)
    at project_salesforce.jbposemailsignupcall_0_10.jbPosEmailSignupCall$4.run(jbPosEmailSignupCall.java:13175)
Caused by: java.lang.IllegalArgumentException: URI is not absolute
    at java.net.URI.toURL(URI.java:1088)
    at org.apache.cxf.transport.http.Address.getURL(Address.java:60)
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit.createConnection(URLConnectionHTTPConduit.java:104)
    at org.apache.cxf.transport.http.URLConnectionHTTPConduit.setupConnection(URLConnectionHTTPConduit.java:117)
    at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:497)
    at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:649)
    at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1093)
    ... 7 more

May I know please according to error, what could go wrong or where I need to check ? Because when I use same JSON data in POSTMAN it works fine.

Thanks

Squeez
  • 343
  • 2
  • 3
  • 15
  • Possible duplicate of [Uri not Absolute exception getting while calling Restful Webservice](https://stackoverflow.com/questions/14848877/uri-not-absolute-exception-getting-while-calling-restful-webservice) – Justin Albano Apr 04 '18 at 18:30
  • Since the call to WebClient.post is causing the problem, perhaps you should include the code that actually calls it in your question. – VGR Apr 04 '18 at 18:35
  • Could be that it waits for a URL on an URLInputStream, but you give it a path to a file that would need a FileInputStream instead. Both extend `java.io.InputStream`. Had this just in the code, with the same error. Then, it cannot understand the filepath as a URL. – questionto42 Jan 17 '23 at 17:34

0 Answers0