Contributed by Andrzej Adamczyk
Symptoms
Errors
Explanation
Environments
Solutions
Related content
Symptoms
Problems are reported for Pega Platform™ update scenarios involving Product rule export and import that lead to missing database tables, database schema issues, and Export to Excel failures. The error org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler is common to all reported scenarios.
Scenario 1 Database tables not created when importing a Product rule (RAP file) after update
After updating your Pega deployment from Pega Platform version 8.5.1 to Pega Platform version 8.7.3, you notice that data tables are not created when importing a Product rule (RAP file) that contains class instances.
In this scenario, a Class is mapped to a table in the PegaDATA database in Pega Platform version 8.5.1. But the mapped-to table does not exist in the PegaDATA database in Pega Platform version 8.7.3 after you update to this version. You first see the error message that the database table does not exist. After checking the logs from the RAP import, you see two instances of ERROR - Unable generate schema for xxx. See the Errors for Scenario 1.
Scenario 1 Steps to Reproduce the problem
- Import a RAP file that contains the foundation class DATA-ADMIN-DB-TABLE in the pr4_base table.
- Try to Test Connectivity to DATA-ADMIN-DB-TABLE: From Dev Studio, click .
- See the error Class xxx is mapped to table schema.xxx in database xxx, which does not exist.
- Check the logs from the RAP file import and see two instances of ERROR - Unable generate schema for xxx org.apache.xml.serializer.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler.
- Perform the first workaround in the Solutions.
Scenario 2 Database schema changes not captured in Product rule (RAP file)
Database schema changes are not captured in the Product rule (RAP file) generated from Pega Platform version 8.6. When you preview the Product rule, the rules engine displays DB Schema Changes. However, when you perform an export, the Product rule is not captured.
Scenario 2 Steps to Reproduce the problem
Create a Product rule having one Data-Admin-Table instance. Preview the Product rule and notice that the system correctly captures the Schema Change details. Create a Product rule (RAP file). Go to the Import wizard and select the RAP package you just created. Click the Errors for Scenario 2 and the Solutions. button. The Database Schema Change related instances are missing. See the
Scenario 3 Database tables not extracted in Product export
When you create a Product rule (RAP file), you notice that the database tables are not extracted for all data types and case types. The preview of the Export wizard suggested that the database tables would be extracted. See the Errors for Scenario 3 and the Solutions.
Scenario 4 Report action Export to Excel fails
While using reports in your application, when you click Export to Excel, the Tracer displays the error, There has been an issue; please consult your system administrator. You also see the error Section 'pzRDExportWrapper' execution error on page '' of class 'Rule-Obj-Report-Definition'. : Fail to save: an error occurs while saving the package : org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to to org.apache.xml.serializer.SerializationHandler. See the Errors for Scenario 4 and the Solutions.
Scenario 5 Report action Export to Excel fails
After you install Pega Platform version 8.6.1 on the JBoss application server with the poi-4.1.2.jar file and from a report click Export to Excel, you see the Severe error org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler. See the Error for Scenario 5 and the Solutions.
Scenario 6 Export to Excel fails after application update to Pega Platform version 8.6.1
After your Pega application is updated from Pega Platform version 8.4 to version 8.6.1, the Export to Excel action does not work. The problem occurred in two different applications after Pega deployment update to Pega Platform version 8.6.1. See the Error for Scenario 6 and the Solutions.
Errors
Errors for Scenario 1
Class xxx is mapped to table schema.xxx in database xxx, which does not exist.
ERROR - Unable generate schema for xxx
org.apache.xml.serializer.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
ERROR - Unable generate schema for xxx
org.apache.xml.serializer.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
Errors for Scenario 2
Unable generate schema for <data_table>
exception: org.apache.xml.serializer.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
Errors for Scenario 3
Unable generate schema for <database>
Unable to export table metadata for class <data_class>
org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler )
Errors for Scenario 4
There has been an issue; please consult your system administrator.
Section 'pzRDExportWrapper' execution error on page '' of class 'Rule-Obj-Report-Definition'. : Fail to save: an error occurs while saving the package : org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
Error for Scenario 5
(Code-Pega-List)SEVERE: It should not have reached here. Something went really wrong. Reason can be Fail to save: an error occurs while saving the package: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
Error for Scenario 6
Section 'pzRDExportWrapper' execution error on page '' of class 'Rule-Obj-Report-Definition'. : Fail to save: an error occurs while saving the package : org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
Explanation
Pegasystems – Third-party issue – JBoss application server with Oracle database system -- JAR file conflict
JBoss application server versions earlier than version 4.0 ship with a poi-XXX.jar file that refers to conflicting serializer and Xalan JAR file versions present in JBoss Java libraries, specifically version 2.7.2 of Xalan and serializer JAR files.
Pega Platform also ships with serializer-2.7.2.jar and xalan-2.7.2.jar files that get loaded in the Pega database table PegaRULES.pr_engineclasses. This causes problems during class loading, making the org.apache.xml.serializer exception likely to occur.
Environments
The problem was reported when the Pega Platform was updated to the following versions in on-premises environments:
- Pega Platform version 8.7.3 on-premises
- Pega Platform version 8.6.4 on-premises
- Pega Platform version 8.6.1 on-premises
- Pega Platform version 8.6 on-premises
Solutions
Perform the following workaround:
- In \modules\system\layers\base\org\apache\xalan\main, edit the module.xml file to comment out the resource tag for the xalan-2.7.1.redhat-12.jar file as shown:
<module xmlns="urn:jboss:module:1.5" name="org.apache.xalan"> <resources> <resource-root path="serializer-2.7.1.redhat-12.jar"/> <!--<resource-root path="xalan-2.7.1.redhat-12.jar"/>--> </resources> <dependencies> <module name="javax.api"/> </dependencies> </module>
- Restart the server.
Alternatively, perform the following workaround:
-
Find the old Pega serializer and Xalan JAR files for version 3.x by running this SQL statement:
Select * from pegarules.pr_engineclasses WHERE pzjar LIKE 'poi-3%.jar'
- Delete the old JAR files found in Step 1 by running this SQL statement:
DELETE FROM pegarules.pr_engineclasses WHERE pzjar LIKE 'poi-3.15.jar'
- Identify the conflicting serializer and Xalan JAR file versions that are present in JBoss by finding the current version 2.7.2 in the latest Pega versions. Run this SQL statement:
Select * from PegaRULES.pr_engineclasses where PegaRULES.pr_engineclasses.pzjar like 'serializer%' or PegaRULES.pr_engineclasses.pzjar like '%xalan%';
- Shut down all JVMs for the Pega Platform.
- Back up the table PegaRULES.pr_engineclasses.
- Run the following SQL script on the database:
update PegaRULES.pr_engineclasses set pzcodeset='pega-enginecodenouse' where PegaRULES.pr_engineclasses.pzjar like '%serializer%' or PegaRULES.pr_engineclasses.pzjar like '%xalan%'; commit;
- Restart the JVMs for the Pega Platform.
Related content
Pega Academy
Application migration > Product rule
Pega Documentation
Packaging your application in a product rule
Specifying the content of a product rule
Pega Support Questions
PEGA 8.1.2 : RAP export/Import missing schema changes
PEGA 8.1.2: OOB Report definition export to excel not working