Skip to main content

Woodstox in Glassfish v2

Posted by bhaktimehta on June 1, 2007 at 11:07 AM PDT



Starting with GF v2 b49, Woodstox
is now integrated as part of Glassfish
along with sjsxp so that users have the benefit of additional performance improvements which woodstox provides.

sjsxp is the default parser in glassfish. This is a preliminary integration with Woodstox and testing is still in progress so let us know if you run into issues.
Here is some more information from Santiago regarding Woodstox in his blog Woodstox rocks Glassfish v2

To enable Woodstox we need to
use the following



Client
side




These three system properties will need to be added on client side when
you want to enable Woodstox.

-Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory


-Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory


-Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory








Server
side




Similarly on server side we can use standard JAXP API's system
properties to turn Woodstox on for entire GF. So GF process needs to be
execed with the following system properties:




-Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory


-Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory


-Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory




In glassfish, the admin console provides easy way to set system
properties as show in Fig 1 (you can do the same by editing domain.xml)






admin-console-sys-props.jpg



Fig 1  Modifying system
properties using admin console http://localhost:4848




You can try it out and give us feedback at

dev@wsit.dev.java.net

dev@glassfish.dev.java.net