WanderlandWanderland |
|
Friday Jul 18, 2008
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
If your application suddenly stops working with the stack trace below: Caused by: java.lang.ClassNotFoundException:
org.apache.xerces.parsers.SAXParser
You might be wondering if different class loaders keep separate copies of xercesImpl.jar or if you need to provide xercesImpl.jar to your application to let it find org.apache.xerces.parsers.SAXParser, but it has worked before without adding xercesImpl.jar. The answer: Glassfish does not have a xercesImpl.jar in its system classloader and you most likely will not need this jar. The reason is when system property org.xml.sax.driver is not specified and also no jars provide service API for org.xml.sax.driver , org.xml.sax.helpers.XMLReaderFactory.createXMLReader resolves to use a default XMLReader class which is SAX Parser specific. In SUN JDK5, the default class is com.sun.org.apache.xerces.internal.parsers.SAXParser. Therefore, if another application changes the system property of org.xml.sax.driver and points it to org.apache.xerces.parsers.SAXParser, your application will fail with ClassNotFoundException. How to resolve this issue without adding xercesImpl.jar? You might unset the system property org.xml.sax.driver in your application when you try to get an XMLReader, or you may use a fall-back mechanism like below:
Note that it is generally not a good idea to hard code a reference com.sun.org.apache.xerces.internal.parsers.SAXParser in your application, because the class might not be available when JDK upgrades or in other distributions of JDK .
Posted at 05:07PM Jul 18, 2008 by Mei Wu in Sun | Comments[0]
Tuesday May 20, 2008
Tips of setting up BPELSE in a glassfish cluster
Tidbits I gathered in the recent testing of BPELSE Monitor in a glassfish cluster. Tips of setting up Glassfish Cluster #1 Walk-through guides #2 Watch for caveats : Multi-machine High Availability cluster (default)
Tips of setting up BPELSE on glassfish cluster #1 Walk-through guides BPELSE cluster Walk-through with Extensive examples #2 Create DB schema for Persistence and/or Monitoring Currently, unlike running in a non-clustered glassfish, when BPELSE (persistence/monitoring on) is enabled on a cluster target, DB schema will not be automatically created . You can try one of the 2 workarounds below to address it:
#3 Simple JMSIn --> Clustered BPELSE --> JMSOut
![]() The maxConcurrentConsumers >= instance numbers in a cluster
The example can be simply changed to connect to a cluster of MQ brokers by specifying the list on connectionURL
#4 You can run BPEL Monitor Tool to monitor BPELSE in a cluster (http://wiki.open-esb.java.net/Wiki.jsp?page=BPELMonitor#SupportingClustering)
#5 You can test BPELSE settings on a cluster programmatically (Useful if you are using BPELMonitor API and want to add cluster validation logic) TestCustomExtensionMbeans.java Classpath: appserv-rt.jar ($GLASSFISH_HOME/lib), j2ee.jar ($GLASSFISH_HOME/lib), bpelmonitor-api.jar (bpelMonitorTool.zip), jbi-admin-common.jar ($GLASSFISH_HOME/jbi/lib)
Posted at 12:15AM May 20, 2008 by Mei Wu in Sun | Comments[0] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||