Support Article
ClassCastException:__redirected.__XMLInputFactory cannot be cast
SA-75678
Summary
ClassCastException occurs and SOAP connector does not work.
Below is the code snippet from CL:Rule-Connect-SOAP ID:InvokeAxis2 RS:Pega-IntegrationEngine:08-01-01:
//HFix-45582
com.ctc.wstx.stax.WstxInputFactory wInputFactory = (com.ctc.wstx.stax.WstxInputFactory)inputFactory;
wInputFactory.getConfig().setConfigFlag(1);
//HFix-45582
Error Messages
Caused by: java.lang.ClassCastException: __redirected.__XMLInputFactory cannot be cast to com.ctc.wstx.stax.WstxInputFactory)
Steps to Reproduce
Upgrade Pega 7.2.1 to Pega 8.1.3.
Root Cause
A backwards compatibility defect in Pegasystems’ code or rules introduced in Pega 8.1.
Resolution
Perform the following local-change:
- Save As the rule to the application ruleset.
- Add the below line of code,
System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
before
com.ctc.wstx.stax.WstxInputFactory wInputFactory = (com.ctc.wstx.stax.WstxInputFactory)inputFactory;
Published April 4, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.