Problem:
- Product Name: Borland Enterprise Server, AppServer Edition
- Product Version: 6.5
- Product Component:Web Container
- Platform/OS version: All
- JDK: 1.4.2 and 1.5
A java.lang.ClassCastException will be thrown when you deploy a WAR file with third party xml parser library into BES server. It is caused by the xml parser being included in the deployed archive.
The parser is used by the Tomcat web server to process the web.xml. The system class loader will load the parser bundled with the Borland Enterprise Server, AppServer Edition. When the same class is requested by any class loaded using the application class loader, it cannot be properly upcast.
Resolution:
- Remove any xml parser from the archive file if possible.
- If you need to bundle your version of the xml parser in the war file, you can follow the steps below:
- Open partition's partition.xml
- Append ,javax.xml.parsers.,org.xml.sax.,org.w3c.dom. into <container system.classload.prefixes=" setting.
- Restart app server and redeployed war file
#AppServer
#Security
#XML
#ClassCastException
#VisiBroker
#tomcat