1 Reply Latest reply on Oct 16, 2017 1:39 PM by Nagarjuna Bandamedi

    KieRemoteHttpRequestException: Unable to add char sequence to request body

    Nagarjuna Bandamedi Newbie

      Could some one help with the below error.

      I tried the option of setting -Dfile.encoding = UTF-8 env variable. This is occurring intermittently on average 3 of 5 requests its giving this error.

      Using Jbpm 6.4.0.Final

      When I call same service using spring boot or standalone application it is working fine, this issue occurs only when use the war file and deploy in tomcat

      Code I am using.

      KieServicesConfiguration configuration = KieServicesFactory.newRestConfiguration(serverUrl, username, password);

      Set<Class<?>> extraClasses = new HashSet<Class<?>>();

      extraClasses.add(Date.class); // for JSON only to properly map dates

       

      configuration.setMarshallingFormat(MarshallingFormat.JSON);

      configuration.addJaxbClasses(extraClasses);

      configuration.setTimeout(20000);

      kieServicesClient =  KieServicesFactory.newKieServicesClient(configuration);

       

      Exception

       

      Caused by: org.kie.remote.common.rest.KieRemoteHttpRequestException: Unable to add char sequence to request body

       

      at org.kie.remote.common.rest.KieRemoteHttpRequest.initializeConnection(KieRemoteHttpRequest.java:927) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1326) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpRequest.java:719) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateCustomResponse(AbstractKieServicesClientImpl.java:240) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateCustomResponse(AbstractKieServicesClientImpl.java:235) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.QueryServicesClientImpl.query(QueryServicesClientImpl.java:891) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]

      ... 62 more

      Caused by: java.net.ConnectException: Connection refused (Connection refused)

      at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_111]

      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[?:1.8.0_111]

      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[?:1.8.0_111]

      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[?:1.8.0_111]

      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_111]

      at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_111]

      at sun.net.NetworkClient.doConnect(NetworkClient.java:175) ~[?:1.8.0_111]

      at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[?:1.8.0_111]

      at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[?:1.8.0_111]

      at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) ~[?:1.8.0_111]

      at sun.net.www.http.HttpClient.New(HttpClient.java:308) ~[?:1.8.0_111]

      at sun.net.www.http.HttpClient.New(HttpClient.java:326) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) ~[?:1.8.0_111]

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) ~[?:1.8.0_111]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.openOutput(KieRemoteHttpRequest.java:1110) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.initializeConnection(KieRemoteHttpRequest.java:924) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1326) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpRequest.java:719) ~[kie-remote-common-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateCustomResponse(AbstractKieServicesClientImpl.java:240) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateCustomResponse(AbstractKieServicesClientImpl.java:235) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]

      at org.kie.server.client.impl.QueryServicesClientImpl.query(QueryServicesClientImpl.java:891) ~[kie-server-client-6.4.0.Final.jar:6.4.0.Final]