Metro 2.0 on Java SE 6

We have recently had reports in the Metro user forum where people that ran Metro 2.0 with Java SE 6 had trouble using wsimport. They would typically get errors like this:

parsing WSDL...

generating code...

wspolicy/provider/wsdl/server/Echo.java
wspolicy/provider/wsdl/server/EchoResponse.java
wspolicy/provider/wsdl/server/EchoService.java
wspolicy/provider/wsdl/server/Echo_Type.java
wspolicy/provider/wsdl/server/ObjectFactory.java
wspolicy/provider/wsdl/server/package-info.java
Copying 2 files to
/Users/fr159072/tmp/WebApplication8/build/web/WEB-INF/wsdl/NewWebServiceFromWSDL
wsimport-service-generate:
Created dir:
/Users/fr159072/tmp/WebApplication8/build/web/WEB-INF/classes
Created dir: /Users/fr159072/tmp/WebApplication8/build/web/META-INF
Copying 1 file to
/Users/fr159072/tmp/WebApplication8/build/web/META-INF
Copying 3 files to /Users/fr159072/tmp/WebApplication8/build/web
library-inclusion-in-archive:
library-inclusion-in-manifest:
wsimport-service-compile:
Compiling 6 source files to
/Users/fr159072/tmp/WebApplication8/build/web/WEB-INF/classes
/Users/fr159072/tmp/WebApplication8/build/generated/wsimport/service/wspolicy/provider/wsdl/server/EchoService.java:47:
cannot find symbol
symbol  : constructor
Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
location: class javax.xml.ws.Service
        super(ECHOSERVICE_WSDL_LOCATION, ECHOSERVICE_QNAME,
features);
/Users/fr159072/tmp/WebApplication8/build/generated/wsimport/service/wspolicy/provider/wsdl/server/EchoService.java:55:
cannot find symbol
symbol  : constructor
Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
location: class javax.xml.ws.Service
        super(wsdlLocation, ECHOSERVICE_QNAME, features);
/Users/fr159072/tmp/WebApplication8/build/generated/wsimport/service/wspolicy/provider/wsdl/server/EchoService.java:63:
cannot find symbol
symbol  : constructor
Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
location: class javax.xml.ws.Service
        super(wsdlLocation, serviceName, features);
3 errors



For a detailed analysis when exactly this is happening, see this Wiki page. The reason for these failures is that Metro 2.0 contains JAX-WS 2.2, which clashes with JAX-WS 2.1 1 that is built into Java SE 6. You will only see these failures if you did not install Metro 2.0 with our installation scripts metro-on-glassfish.xml/metro-on-tomcat.xml. That is the case if you e.g. installed Metro 2.0 for GlassFish V3 via the update center or if you use a version of GlassFish V3 built into NetBeans.

The simplest solution is to download the Metro 2.0 nightly build and run the installation script. The script copies the file webservices-api.jar, which contains the JAX-WS 2.2 API, into <java-home>/lib/endorsed. Alternatively, you can of course manually copy webservices-api.jar into a suitable endorsed directory.

Tags: Web Services, Project Metro, JAX-WS, Java

1Java SE 6 update 3 and older contains JAX-WS 2.0.


Comments:

Post a Comment:
Comments are closed for this entry.
About

ritzmann

Search

Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today