SAX parser or other XML-related class cannot be found

I'm running an application that uses shared-memory communications, and I get an exception that states that the SAX parser or other XML-related class cannot be found. The class in question is definitely in the application's classpath as specified in the configuration file. The application works fine when using binary communications.

This problem occurs if you're running an application that uses the Xerces XML parsing library and JDK 1.4.x or later. Following JDK 1.4.x, the JRE includes its own set of JAXP (Java API for XML Parsing) classes that override the Xerces classes. This generally means that the Xerces classes cannot be found, and an exception will be thrown. You can resolve this problem in one of two ways:

  • You can use JDK 1.3.x (JDK 1.3.1 or later; 1.3.0 is not supported). These JDKs do not have their own JAXP implementations, so the Xerces classes will not be overridden.
  • You can use your JDK 1.4.x or later, but move the Xerces implementation from the regular classpath to the special boot classpath. You do this by adding a JVM option to your configuration information and specifying that the Xerces JAR file (typically xercesImpl.jar) is now in the boot classpath. The actual procedure for doing this depends on how you are configuring JNBridgePro.

If you are configuring JNBridgePro using the application configuration file, you may have had something like:

<dotNetToJavaConfig
   scheme="sharedmem"
   jvm="
full path to jvm.dll in JDK or JRE"
   jnbcore="
full path to jnbcore.jar"
   bcel="
full path to bcel-5.1-jnbridge.jar"
   classpath="
semicolon-separated Java classpath"/>

Change this element so it looks like:

<dotNetToJavaConfig
   scheme="sharedmem"
   jvm="
full path to jvm.dll in JDK or JRE"
   jnbcore="
full path to jnbcore.jar"
   bcel="
full path to bcel-5.1-jnbridge.jar"
   classpath="
semicolon-separated Java classpath"
   jvmOptions.0="-Xbootclasspath/p:
path_to_xercesImpl.jar_goes_here"/>