Monday April 02, 2007
Java EE Tutorial JAX-WS client examples and Application Server 9.1 Beta

If you are trying to use the Java EE 5 Tutorial with Application Server 9.1/GlassFish v2 Beta, you will encounter problems with the JAX-WS examples when running them in NetBeans. Here's the error message for simpleclient:

init:deps-jar:
wsimport-init:
Created dir:
C:\javaeetutorial5\examples\jaxws\simpleclient\build\generated\wsimport\client
Created dir: 
C:\javaeetutorial5\examples\jaxws\simpleclient\build\generated\wsimport\binaries
wsimport-client-check-HelloService:
wsimport-client-HelloService:
Consider using <depends>/<produces> so that wsimport won't do 
unnecessary compilation
parsing WSDL...
[ERROR] 
http://127.0.0.1:8080/helloservice/HelloService/__container$publishing$subctx/WEB-INF/wsdl/HelloService_schema1.xsd
unknown location
[ERROR] 
http://127.0.0.1:8080/helloservice/HelloService/__container$publishing$subctx/WEB-INF/wsdl/HelloService_schema1.xsd
unknown location

The error is due to the changes in JAX-WS 2.1 and JAXB 2.1, which are included in Application Server 9.1/GlassFish v2 Beta. For web service clients NetBeans uses a local copy of the WSDL to generate the artifacts needed to communicate with the service. The WSDL included with simpleclient uses the JAX-WS 2.0/JAXB 2.0 schema URI, as seen above in the error message.

The work-around is to retrieve a new copy of the WSDL. For example, for simpleclient:

  1. Deploy helloservice to Application Server 9.1/GlassFish v2 Beta.
  2. Open simpleclient in NetBeans.
  3. In the Projects pane, expand Web Service References and right-click on HelloService.
  4. Select Refresh Client.
  5. Right-click on simpleclient and select Run.

Refreshing the client WSDL in NetBeans

Another work-around is to follow the ant instructions for simpleclient.

We're working on a more permanent fix for the examples, and will release a new tutorial bundle as soon as we have a working solution.

Trackback URL: http://blogs.sun.com/ievans/entry/java_ee_tutorial_jax_ws
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed