JDK-8196140 : javax.xml.soap.SOAPMessage.getEnvelope(): UnsupportedOperationException
  • Type: Bug
  • Component: xml
  • Sub-Component: jax-ws
  • Affected Version: 8u161
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2018-01-24
  • Updated: 2018-01-31
  • Resolved: 2018-01-31
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.16299.192]

A DESCRIPTION OF THE PROBLEM :
While using SOAP handler to modify the header (https://gist.github.com/sivaprasadreddy/2555700 or https://www.ibm.com/support/knowledgecenter/SSFPJS_8.0.0/com.ibm.wbpm.wid.integ.doc/topics/rjaxwshandlercogsoaphdr.html) call to getEnvelope() failes with 

com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl createEntityReference
SAAJ0543

This happens only if the content of the soap messages contains new lines. Eg.

class A {
String text;
}

If this class is sent with a single line string it works but if this string contains a new line - so multiple lines - the getEnvelope() failes.

REGRESSION.  Last worked in version 8u151


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
From submitter: Additional Information: 1. As per the bug report , the issue has started occurring from JDK 8u161 , it was working fine until JDK 8u151. Can you confirm if this is the case ? Correct. Java auto update is enabled on client. Previous version of u161 was installed and working without any problem. After updating to u161 the problem occured. 2. Can you send across the complete stack trace with the exception for our analysis? Sorry, there is NO stack trace! Just this: Jan 29, 2018 9:53:23 AM com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl createEntityReference SCHWERWIEGEND: SAAJ0543: Entity-Referenzen sind in SOAP-Dokumenten nicht zul����ssig I set a break point on the catch part to see the exception (catch (Exception e) { e.printStackTrace();}. The print just gives this text. Debugging analysis of exception variable e is very poor. It is of type "UnsupportedOperationException", detailMessage is "Entity References are not allowed in SOAP documents", stackTrack array is empty (length=0). 3. Can you please verify if this is working with the latest JDK 9.0.4 and JDK 10-ea versions ? Sorry, application does not yet run or build on Java 9 or later. Setting up a complete Webservice environment just for testing this problem is too much work for now.
30-01-2018

To submitter: 1. As per the bug report , the issue has started occurring from JDK 8u161 , it was working fine until JDK 8u151. Can you confirm if this is the case ? 2. Can you send across the complete stack trace with the exception for our analysis? 3. Can you please verify if this is working with the latest JDK 9.0.4 and JDK 10-ea versions ? You can download them at : http://www.oracle.com/technetwork/java/javase/downloads/index.html http://jdk.java.net/10/
25-01-2018