How to hide warning in jax-ws client which (maybe) caused by jax-ws library
You must be using an outdated version of jax-ws (I didn't find EffectiveAlternativeSelector in my 2.2.1 copy), but let me try.
- Create a logging.properties file on some path accessible while launching your application (at the very least you may use the one found at
$JAVA_HOME/lib/logging.properties
) - Add the following line to that file:
com.sun.xml.ws.policy.EffectiveAlternativeSelector.level=OFF
- Launch your application as
java -Djava.util.logging.config.file=/path/to/your/logging.properties MainClass
i think turning of the debugging isn't a solution
http://dannythorpe.com/2012/01/04/java-wcf-usingaddressing-warning/ describes a way to fix this.
My guess is that the WSDL from which the client was generated contains policy assertions related to WS-AtomicTransaction. Since WS-AtomicTransaction requires a transaction manager and the JRE doesn't contain one, it's not surprising that the JAX-WS runtime in the JRE has no support for WS-AtomicTransaction and doesn't understand these policy assertions.
If you don't need WS-AtomicTransaction, then you have two options to get rid of these warnings:
- Configure logging to suppress these warnings.
- Remove the assertions from the WSDL.
If you need WS-AtomicTransaction, then you will probably have to run the code in an application server or as a Java EE application client.
9 years after the question, but maybe someone else needs to set this in java code in 2019.
If you just want to hide the warnings (instead of solving the underlying issue) you can easily set the the logging level in your code like this and no messages should appear:
PolicyLogger logger = PolicyLogger.getLogger(EffectiveAlternativeSelector.class);
logger.setLevel(Level.OFF);