views:

18

answers:

1

Axis2 relies on woodstox's wstx while other part of my project has tested heavily with sjsxp and we can't afford to rerun the same test. Now, there is a problem with parsing SOAP message with axis2 that if I take away sjsxp, the problem is gone. Is there a way to tell axis2 to use the wstx implementation and leave the rest of the project alone to use sjsxp implementation?

A: 

Simplest way is to never use XMLInputFactory.createInstance() (and same for XMLOutputFactory). Rather use explicit constructors -- the intent behind these discovery methods is nice, but unfortunately they tend to be more hassle than worth in my opinion. To reduce explicit dependencies from using constructors directly it's probably best to use a dependency injection library like Guice (Spring and others will do too) so that instantiation occurs in just one place.

This would work for your part of project but would not solve Axis2 issue. I suspect there is a setting for Axis2 but I don't know what it would be off-hand.

StaxMan