javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

Better error reporting for invalid catalog files for webservice client #1041

Open glassfishrobot opened 12 years ago

glassfishrobot commented 12 years ago

If there is a problem with the catalog file for a webservice client, JAX-WS provides very unhelpful error messages, or none at all.

This applies both at build time (using wsimport), and at runtime (when initializing the web service client).

To reproduce:

Output:

If an internet connection is available, the build just hangs (apparently trying to download something).

Without internet connection, it fails mysteriously:

setup:

generate-client:
 [wsimport] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
 [wsimport] parsing WSDL...
 [wsimport]
 [wsimport]
 [wsimport] [ERROR] java.net.UnknownHostException: example.org
 [wsimport]
 [wsimport]
 [wsimport] [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
 [wsimport]
 [wsimport]  At least one WSDL with at least one service definition needs to be provided.
 [wsimport]
 [wsimport]
 [wsimport]     Failed to parse the WSDL.
 [wsimport] Command invoked: wsimport "C:\Program Files\Java\jdk1.6.0_27\jre\bin\java.exe" 
-d C:\Users\user\jaxws-ri\samples\catalog\build\classes -g -Xendorsed -keep 
-catalog C:\Users\user\jaxws-ri\samples\catalog\etc\META-INF\jax-ws-catalog.xml2 http://example.org/wsdl -p catalog.client

BUILD FAILED

Expected:

The build should clearly indicate what went wrong. Something like

or similar.

The present behaviour makes it very difficult to debug problems with catalogs, because there is no indication when there is some problem finding the catalog file, or a WSDL file.

Environment

SUN JDK 1.6.0_27

Affected Versions

[2.2.5]

glassfishrobot commented 12 years ago

Reported by sleske

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-1041