Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8246311

Entity References are not allowed in SOAP documents

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10 , Java 1.8.0_251

      A DESCRIPTION OF THE PROBLEM :
      We are facing below mentioned issue.
      org.apache.cxf.interceptor.Fault: Marshalling Error: Entity References are not allowed in SOAP documents
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:270)
      at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:239)

      REGRESSION : Last worked in version 8u251

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      We are trying to call the SOAP service and to update the comments field as mentioned below
      <currentComment>This is for test /n</currentComment>
      then we get below error

      org.apache.cxf.interceptor.Fault: Marshalling Error: Entity References are not allowed in SOAP documents
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:270)
      at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:239)
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:137)
      at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:535)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:444)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:345)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Service should get pass for above SOAP request .
      ACTUAL -
      org.apache.cxf.interceptor.Fault: Marshalling Error: Entity References are not allowed in SOAP documents
      at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:270)
      at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:239)
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:137)
      at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:535)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:444)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:345)

      Since we have seen the the marshalling with JAX-WS does not escape carriage return.
      Also as mentioned it should be fixed as part of 1.8.0_251.
      But still we are facing issue with marshalling. Kindly let us know on this.

      CUSTOMER SUBMITTED WORKAROUND :
      As of now we are doing code fix.
      currentComment.replaceAll("\n", ": "). This is not correct since our functionality requires /n in the code.

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: