Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide warning in jax-ws client which (maybe) caused by jax-ws library

I'm using netbeans to generate web service client in my application. And my program using jax-ws library to set timeout in calling web service.

Problem arise because it generate a lot of this warning message whenever i start this program.:

Dec 13, 2010 4:35:21 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives WARNING: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAlwaysCapability" was evaluated as "UNKNOWN".

Dec 13, 2010 4:35:21 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives WARNING: WSP0075: Policy assertion "{http://schemas.xmlsoap.org/ws/2004/10/wsat}ATAssertion" was evaluated as "UNKNOWN".

Dec 13, 2010 4:35:21 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectAlternatives WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".

I found the same problem with mine in here: http://forums.java.net/node/707265 , but it also have no answer until now.

Is there any way to hide this warning? I try to search using google, and can't find any match answer for this problem..

like image 417
FJE Avatar asked Dec 13 '10 09:12

FJE


2 Answers

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.

  1. 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)
  2. Add the following line to that file: com.sun.xml.ws.policy.EffectiveAlternativeSelector.level=OFF
  3. Launch your application as

java -Djava.util.logging.config.file=/path/to/your/logging.properties MainClass

like image 86
Alexander Pavlov Avatar answered Sep 28 '22 23:09

Alexander Pavlov


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.

like image 31
Andreas Veithen Avatar answered Sep 28 '22 23:09

Andreas Veithen