XmlPullParserException: in comment after two dashes (--) while creating the virtual service using CICS Copybook protocol in DevTest 10.8.3.1
search cancel

XmlPullParserException: in comment after two dashes (--) while creating the virtual service using CICS Copybook protocol in DevTest 10.8.3.1

book

Article ID: 413216

calendar_today

Updated On:

Products

Service Virtualization

Issue/Introduction


While creating the virtual service using CICS Copybook protocol, getting the below error in version 10.8.3.1. 

Caused by: com.thoughtworks.xstream.io.StreamException: 
at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135)
 
caused by: org.xmlpull.v1.XmlPullParserException: in comment after two dashes (--) next character must be > not - (position: START_TAG seen ...   *--><!--* MR2=======  FEB/2025  S. Name R00.0  A-24---... @1:841) 
 at io.github.xstream.mxparser.MXParser.parseComment(MXParser.java:2373)
 at io.github.xstream.mxparser.MXParser.nextImpl(MXParser.java:1188)
 at io.github.xstream.mxparser.MXParser.next(MXParser.java:1104)
This worked in  10.7.2 version. 

Environment

DevTest 10.8.x or newer

Cause

From the error message,  we verified the Copybook file and it had comments with  double-hyphens in the comment. 

*****************************************************************
                                                                     
                 * MAINTENANCE HISTORY      *                          
                                                                     
      * MR2-------  FEB/2025  S. Name R00.0  A-24-----       * 
      *****************************************************************

 

In XML, including in documents processed by Java 17, the string "--" (double-hyphen) is not permitted within the content of a comment. 

Example of an XML comment:
Invalid: <!-- This is an invalid -- comment -->
Valid: <!-- This is a valid - comment -->
Valid: <!-- This is a valid - - comment -->

Attempting to parse an XML document with a double-hyphen within a comment (not as part of the <!-- or --> delimiters) will typically result in a parsing error or a fatal error

This is the reason why our XML parser was throwing the above error message. 

Resolution

 Removed the comment with double hyphens from the Copybook file and the recorder was able to proceed fine and create VSM/SI