java/ws-rawclient – No message body writer has been found

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf java/ws-rawclient – No message body writer has been found

  • Creator
    Topic
  • #55777
    Yuhong Snyder
    Participant

      I am trying to use java/ws_rawclient to write a client request to a web service, however I always get the error saying no message body writer has been found, and invalid parameter, the log is like below:

      I checked all the setup in this thread but could not figure out what parameter it is talking about and if that’s the reason caused error “no message body writer has been found’, does anybody have any clue?

      Sep 06, 2018 2:38:22 PM com.infor.cloverleaf.gjdws.WSRawClient processMessageFromCloverleaf

      SEVERE: Caught retryable exception trying to process message from Cloverleaf

      com.lawson.cloverleaf.driver.RetryException: webClient got exception calling https://www.pdcreporting.com/api/token

      at com.infor.cloverleaf.gjdws.WSRawClient.processMessageFromCloverleaf(WSRawClient.java:229)

      at com.lawson.cloverleaf.driver.FromCloverleafLink.doMsg(FromCloverleafLink.java:46)

      Caused by: javax.ws.rs.ProcessingException: org.apache.cxf.interceptor.Fault: No message body writer has been found for class java.io.ByteArrayInputStream, ContentType: application/x-www-form-urlencoded

      at org.apache.cxf.jaxrs.client.WebClient.doResponse(WebClient.java:1149)

      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 com.infor.cloverleaf.gjdws.WSRawClient.processMessageFromCloverleaf(WSRawClient.java:223)

      … 1 more

      Caused by: org.apache.cxf.interceptor.Fault: No message body writer has been found for class java.io.ByteArrayInputStream, ContentType: application/x-www-form-urlencoded

      at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1222)

      at org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1091)

      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)

      … 5 more

      Caused by: javax.ws.rs.ProcessingException: No message body writer has been found for class java.io.ByteArrayInputStream, ContentType: application/x-www-form-urlencoded

      at org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:780)

      at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:491)

      at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1217)

      … 9 more

      Caused by: java.net.SocketException: A system call received a parameter that is not valid.

      at java.net.SocketInputStream.socketRead(SocketInputStream.java:127)

      at java.net.SocketInputStream.read(SocketInputStream.java:181)

      at java.net.SocketInputStream.read(SocketInputStream.java:152)

      at com.ibm.jsse2.a.a(a.java:26)

      at com.ibm.jsse2.a.a(a.java:118)

      at com.ibm.jsse2.as.a(as.java:129)

      at com.ibm.jsse2.as.i(as.java:387)

      at com.ibm.jsse2.as.a(as.java:615)

      at com.ibm.jsse2.as.startHandshake(as.java:91)

      at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:154)

      at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:9)

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1297)

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1272)

      at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:95)

      at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:236)

      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1320)

      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1280)

      at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:267)

      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 org.apache.cxf.helpers.IOUtils.copy(IOUtils.java:197)

      at org.apache.cxf.helpers.IOUtils.copyAndCloseInput(IOUtils.java:156)

      at org.apache.cxf.jaxrs.provider.BinaryDataProvider.copyInputToOutput(BinaryDataProvider.java:194)

      at org.apache.cxf.jaxrs.provider.BinaryDataProvider.writeTo(BinaryDataProvider.java:154)

      at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1381)

      at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:477)

      … 10 more

      [java:wrte:ERR /0:pdc_https_o_0:09/06/2018 14:38:23] Call to “doMsg” returned error string “caught exception trying to processMessageFromCloverleaf: webClient got exception calling https://www.pdcreporting.com/api/token“. Returning bad send to engine.

    Viewing 7 reply threads
    • Author
      Replies
      • #86475
        lauri buijs
        Participant

          Hi,

          I do not have much experience in this, but the errors i’ve seen untill now where all related to certificate and licenses.

        • #86476
          Yuhong Snyder
          Participant

            I am able to use curl to get the token back , the command is like :

            curl -k –request POST –url https://XXX.com/api/token –header “content-type: application/x-www-form-urlencoded” –data “grant_ENGINE=password&username=XXX&password=XXX”

            however, for the ws-rawclient setting, I tried to use it with and without tls, the message never went out and it always says invalid parameter

          • #86477
            Yuhong Snyder
            Participant

              the attached is the detail setting without tls.

              from the log, it has already reached to the point to produce the message

              as

              INFO: Outbound Message


              ID: 1

              Address: https://www.pdcreporting.com/api/token

              Http-Method: POST

              Content-Type: application/x-www-form-urlencoded

              Headers: {Content-ENGINE=[application/x-www-form-urlencoded], Accept=[*/*]}

              Payload: grant_ENGINE=password&username=xxx&password=xxx

            • #86478
              lauri buijs
              Participant

                When you put the application/x-www-form-urlencoded in the header i would try to leave it blank.I’m not sure why you define your header and overwrite again..

              • #86479
                Yuhong Snyder
                Participant

                  I did try that but it didn’t make any difference

                • #86480
                  Ryan Curtin
                  Participant

                    I have a similar issue when I use the java/ws-rawclient protocol and I have not gotten any closer to a permanent resolution.

                    My issue, the destination confirms receipt of the message and correct mapping in their system, but they send a 202 http response (accepted – not yet processed) which I would’ve thought was an acceptable response for Cloverleaf(?).  

                    In the interim while I am still investigating, I am having the destination system send a 200 response if it gets the message and does not error. That stops the engine from queueing and the error does not happen. Although I believe there is a bigger issue than just the http response being “off” to cause that java error.

                  • #86481
                    lauri buijs
                    Participant

                      Yuhong, have you come to a solution?

                      If not:

                      1. Are you sure that the message is not beeing sent and the logging is of the responsemessage of the server? Can you check with the company you are trying to reach?

                      2. Please also check your java drivers and library for the right jars.

                      3. Have you checked your http-conduit?

                      4. Please try to use a GET instead of a POST when your message has no content.

                      5. contact infor

                      Normally I would use payload only on a soap sender and a simple message when you use a raw sender[/list]

                    • #86482
                      John Mercogliano
                      Participant

                        I ran into this issue with a biz talk server.  We received a 200 response but no reply and received this error.  The fix was to set cloverleaf no exceptions to true.

                        In your case it looks like a check box.  Since you are getting a 202 that might be your problem also.

                        John Mercogliano
                        Sentara Healthcare
                        Hampton Roads, VA

                    Viewing 7 reply threads
                    • The forum ‘Cloverleaf’ is closed to new topics and replies.