Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use third party implementions of java apis

 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Could any one help me out with how to do this?

I have a particular question and a general one.

1. How do I use the woodstox implementation of the StAX API with jse 1.6 in place of the bundled implementation (sjsxp) in the the jdk?

2. In general how does one use third party implementations instead of the bundled implementations in the jdk?

Any help is greatly appreciated. Thanks.

Gamini
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you add 3rd party jars in your classpath then you can use it your code
it is applied to all 3rd party api

Thanks
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, if we take the specific question here and suppose I put the woodstox jars in the classpath, will the JVM pick the woodstox implementation (i.e. give priority to what's in the classpath)instead of it's bundled implementation (sjsxp)?

It seems unlikely to me. I am expecting some form of pluggability configuration here? Anybody else can help?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JEE 5 tutorial talks about that. It uses properties, similar to how one would select a particular SAX or DOM implementation. The one you're looking for is probably javax.xml.stream.XMLInputFactory.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
Thanks for getting me to the right track.
Going through the link your provided. For future references the following link is also helpful (on JAXP implementations)

https://jaxp.dev.java.net/1.4/JAXP-FAQ.html
(search for the section "Q. How do I use a different JAXP compatible implementation?" )
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic