Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-4116

SAXParseException; Premature end of file. by kie-remote-client access with multibyte data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.4.0
    • 6.3.0.GA
    • Business Central
    • Windows Japanese edition (platform encoding is not UTF-8)

    • ER2
    • Hide

      Set -Dfile.encoding=UTF-8 for client side.

      Show
      Set -Dfile.encoding=UTF-8 for client side.
    • Hide
      • Create a process "project1.helloProcess" in "org.kie.example:project1:1.0.0-SNAPSHOT" in business-central. Any process would be fine.
      • Unzip RHBPMS-4116-reproducer.zip
      • Change username/password in ProcessStartTest.java if needed.
      • Run "mvn test"
      • This reproduces the issue because "-Dfile.encoding=US-ASCII" is set in pom.xml
      Show
      Create a process "project1.helloProcess" in "org.kie.example:project1:1.0.0-SNAPSHOT" in business-central. Any process would be fine. Unzip RHBPMS-4116 -reproducer.zip Change username/password in ProcessStartTest.java if needed. Run "mvn test" This reproduces the issue because "-Dfile.encoding=US-ASCII" is set in pom.xml

    Description

      If kie-remote client sends multibyte data and the platform encoding is not UTF-8, ContentLength is wrongly calculated. The access results in:

      Server side:

      14:11:29,139 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (http-127.0.0.1:8080-4) RESTEASY000100: Failed executing POST execute: org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException: javax.xml.bind.UnmarshalException
       - with linked exception:
      [org.xml.sax.SAXParseException; Premature end of file.]
      	at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:147) [resteasy-jaxb-provider-2.3.13.Final-redhat-1.jar:]
      	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:106) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
      	at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:63) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
      	at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:109) [resteasy-jaxrs-2.3.13.Final-redhat-1.jar:]
      ...
      Caused by: javax.xml.bind.UnmarshalException
       - with linked exception:
      [org.xml.sax.SAXParseException; Premature end of file.]
      	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:314) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-3.jar:1.0.4.Final-redhat-3]
      	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:578) [jaxb-impl-2.2.11.jar:2.2.11]
      	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:264) [jaxb-impl-2.2.11.jar:2.2.11]
      	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229) [jaxb-impl-2.2.11.jar:2.2.11]
      	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:119) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-3.jar:1.0.4.Final-redhat-3]
      	at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:102) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-3.jar:1.0.4.Final-redhat-3]
      	at org.jboss.resteasy.plugins.providers.jaxb.SecureUnmarshaller.unmarshal(SecureUnmarshaller.java:167) [resteasy-jaxb-provider-2.3.13.Final-redhat-1.jar:]
      	at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.processWithSecureProcessing(AbstractJAXBProvider.java:306) [resteasy-jaxb-provider-2.3.13.Final-redhat-1.jar:]
      	at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:129) [resteasy-jaxb-provider-2.3.13.Final-redhat-1.jar:]
      	... 46 more
      Caused by: org.xml.sax.SAXParseException; Premature end of file.
      	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:175) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:394) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:322) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:281) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:203) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:802) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:768) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1196) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:555) [xercesImpl-2.9.1.redhat-6.jar:2.9.1.redhat-6]
      	at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258) [jaxb-impl-2.2.11.jar:2.2.11]
      	... 52 more
      

      Client side:

      org.kie.remote.client.api.exception.RemoteCommunicationException: Unable to send HTTP POST request
      	at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:380)
      	at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeCommand(AbstractRemoteCommandObject.java:160)
      	at org.kie.services.client.api.command.KieSessionClientCommandObject.startProcess(KieSessionClientCommandObject.java:282)
      	at com.sample.ProcessStartTest.testRest(ProcessStartTest.java:37)
      ...
      Caused by: org.kie.remote.common.rest.KieRemoteHttpRequestException: Error occurred when trying to retrieve response code
      	at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1331)
      	at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpRequest.java:719)
      	at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:376)
      	... 22 more
      Caused by: java.io.IOException: Incomplete output stream
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1472)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
      	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
      	at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1329)
      	... 24 more
      

      It's reported in community JIRA as well.
      https://issues.jboss.org/browse/GUVNOR-2297

      Attachments

        Issue Links

          Activity

            People

              marco.rietveld Marco Rietveld (Inactive)
              rhn-support-tkobayas Toshiya Kobayashi
              Tomáš Livora Tomáš Livora (Inactive)
              Tomáš Livora Tomáš Livora (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: