File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Overriding Crimson with Xerces parser on Websphere 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Overriding Crimson with Xerces parser on Websphere 6.0" Watch "Overriding Crimson with Xerces parser on Websphere 6.0" New topic
Author

Overriding Crimson with Xerces parser on Websphere 6.0

Mahesh Desai
Ranch Hand

Joined: Apr 04, 2007
Posts: 76
Hi Ranchers,

How could we override Crimson with Xerces parser in Websphere 6.0?

As I know, we need to follow following steps:

1] Put required Xerces jar files in into <"JAVA_HOME">/lib/endorsed
2] Set JVM argument as

-Djava.endorsed.dirs=/user/java/j2sdk1.4.2_08/lib/endorsed

3] Set CLASSPATH= <"JAVA_HOME">/lib/endorsed/xerces.jar


But it seems it�s not working after following the above steps . My question is, Is there any other way than the above to force WAS 6.0 to load Xerces parser rather than its default Crimson parser?


Any ideas would be appreciated.

Thanks,
Mahesh



----------------------
SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
[ May 06, 2007: Message edited by: Mahesh Desai ]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18989
    
    8

I tracked down a tutorial that explains how you use system properties to force the JVM to use a particular parser implementation. Here's what it said:
The factory APIs give you the ability to plug in an XML implementation offered by another vendor without changing your source code. The implementation you get depends on the setting of the javax.xml.parsers.SAXParserFactory and javax.xml.parsers.DocumentBuilderFactory system properties. The default values (unless overridden at runtime) point to the reference implementation.
So you need to do this:

1. Find out what values to assign to these properties for Xerces.

2. Configure Websphere with those values.

3. Make sure Xerces is actually in Websphere's classpath. (I don't think setting the CLASSPATH environment variable is the way to do that.)

I haven't tried this so I have no idea whether it will work or what problems might arise if you do it.
Mahesh Desai
Ranch Hand

Joined: Apr 04, 2007
Posts: 76
Hi Paul,


I just found the property values which we need to set for Xerces parser. Following are the four properties:

1] -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

2] -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

3] -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

4] -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XML11Configuration


But do you know where and how we can set these properties in Websphere?

Thanks for your reply for my earlier post.


Thanks,
Mahesh



----------------------
SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
[ May 06, 2007: Message edited by: Mahesh Desai ]
Mahesh Desai
Ranch Hand

Joined: Apr 04, 2007
Posts: 76
Hi Paul,

I just went through the one of the tutorials and came to know about how we can set the JVM arguments in Websphere. Here are the steps to setup JVM Arguments:


From the administrative console, go to Application servers > servername > Java and Process Management > Process Definition > Java Virtual Machine.
Set the Generic JVM Arguments as shown below:

Windows:

-Xms640m -Xmx1472m -Xss128k -Xoss128k -Xpartialcompactgc -Xgcpolicy ptthruput -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Xk15000 -Dsun.rmi.dgc.ackTimeout=1 -Dcom.ibm.websphere.threadpool.clearThreadLocal=TRUE

AIX:

-Xms640m -Xmx1840m -Xss256k -Xoss256k -Xpartialcompactgc -Xgcpolicy ptthruput -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Xk15000 -Xloratio0.2 -Xlp -Dsun.rmi.dgc.ackTimeout=1 -Dcom.ibm.websphere.threadpool.clearThreadLocal=TRUE

Solaris:

-Xms640m -Xmx1840m -Xss256k -XX:+CMSConcMarkSweepGC -XX:NewSize=256m -XX:MaxNewSize=512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Dsun.rmi.dgc.ackTimeout=1 -Dcom.ibm.websphere.threadpool.clearThreadLocal=TRUE


Thanks for your time Paul.


Thanks,
Mahesh



----------------------
SCJP 1.4 | SCWCD 1.4 | SCBCD 1.3 | SCEA Part I - In Progress
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overriding Crimson with Xerces parser on Websphere 6.0