I am facing this ERROR during runtime on Unix environment.
java.util.ServiceConfigurationError: com.sun.xml.ws.policy.spi.PolicyAssertionValidator: Provider com.sun.xml.ws.rm.policy.spi_impl.RmAssertionValidator could not be instantiated
I have webservices-rt-3.0.3.jar on the classpath. But in the same folder where this jar is available, there is another webservices-rt.jar which is not in the classpath. When I run the program, I get the above error. When I delete the webservices-rt.jar from the directory, the program runs fine.
After observing the two jars, the META-INF/services have following entries for com.sun.xml.ws.policy.spi.PolicyAssertionValidator file.
- webservices-rt-3.0.3.jar: com.sun.xml.ws.rx.rm.policy.spi_impl.RmAssertionValidator
- webservices-rt.jar: com.sun.xml.ws.rm.policy.spi_impl.RmAssertionValidator Observe the difference in package. First one has rx.
And even though I have the first one in classpath. The error shows Provider as second (i.e., from the webservices-rt.jar).
I am unable to understand this behavior of java. Can someone explain please.
Below are the environment details: java version "1.8.0.19-hp-ux" Java(TM) SE Runtime Environment (build 1.8.0.19-hp-ux-b1) Java HotSpot(TM) Server VM (build 25.19-b1, mixed mode)
OPERATING SYSTEM : HP-UX TEST RUN : HP-UX VERSION : B.11.31
This should not happen as webservices-rt.jar is not on the classpath in java command. Only when I delete the webservices-rt.jar from the path and keep only one version webservices-rt-3.0.3.jar does it work without error.