开发者

How to choose an implementation sjsxp and wstx if both of them are in the classpath

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜