• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Overriding Crimson with Xerces parser on Websphere 6.0

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic