Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Provider com.sun.xml.stream.ZephyrParserFactory not found using annotation-driven [SWS-752] #840
Error message appears when <sws:annotation-driven /> is used.
The error message does not appear in previous versions.
I have tried to trace the problem and I have found out, that due task: "SWS:697: Support maven 3" library wsit-rt (wsit-rt-1.1.jar) has been added as an dependency. This library became part of my ear and therefore part of the my classpath.
This library contains /META-INF/services/javax.xml.stream.XMLInputFactory, which contains com.sun.xml.stream.ZephyrParserFactory. This overrides default settings without saying a word.
The simple workaround is to remove the related dependencies:
<dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-security</artifactId> <exclusions> <exclusion> <groupId>com.sun.xml.wsit</groupId> <artifactId>xws-security</artifactId> </exclusion> <exclusion> <groupId>com.sun.xml.wsit</groupId> <artifactId>wsit-rt</artifactId> </exclusion> </exclusions> </dependency>
Still I believe this is wrong behavior and has to be fixed.
Arjen Poutsma commented
Unfortunately, there is very little I can do about fixing that wsit-rt jar. I contacted the Oracle guys about it, but got no response so far.
As an alternative to excluding the dependency altogether, you can also make sure that your preferred StAX parser (Woodstox) comes before wsit-rt on the class path. This will put Woodstox's /META-INF/services/javax.xml.stream.XMLInputFactory before the one in wsit-rt, thus overriding it.
Martin Vanek commented
Hi, thanks for the quick answer.
You are right, classpath alternation is possible but because the Maven creates the EAR and classpath MANIFEST within it is quite uncontrolled what comes first. And because of more 100 jar libraries in our ear, it is even harder.
I do not know code of spring-ws in detail, but why is wsit-rt dependency of spring-ws?
Steve Jones commented
The following Maven dependency setup worked for me. I am Running on Tomcat 6, Java 7.
com.sun.xml.stream.ZephyrParserFactory is a reference to the Sun Java Streaming XML Parser (apparently this was a code name at one point).