Java Reference
In-Depth Information
This difference of minor version matters if you need the JAX-WS runtime JAR (jaxws-rt.jar)
to perform certain tasks that represent extensions to the basic functionality. For example, the
WSBindingProvider class, which gives you easy access to setting outbound headers, is in the
com.sun.xml.ws.developer package.
NOTE
Do not be misled by the fact that these classes are in the com.sun package. Sun itself advocates not
using any such packages because they are not part of the public interface, are frequently undocumen-
ted, and are subject to change at any given time. They are not guaranteed to work in future versions of
the platform, and are considered risky and experimental. However, that is notwhat's happening with
these JAX-WS classes. Sun's admonition against using com.sun classes refers only to classes that
ship within Java SE itself. The JAX-WS classes are defined within the JAX-WS standalone library,
which should be included as part of your application. The package name starts the same, but the rule
doesn't apply. That said, carefully consider how far down the road of proprietary extensions you want
to go when writing your apps.
So if a very new version of JAX-WS, such as 2.1.3, includes some feature you want to use,
you may still have some work to do. You can't just get a newer version of Java in this case (as
of yet). You need to override those JARs, unless you can do everything from the console.
If you have downloaded Metro 1.1, then you can point your JAVA_HOME environment variable
to your Java SE 6 update 4 installation, and run the web service tools from Metro. Metro 1.1
includes a directory called jax-ws-latest-wsit/binthat contains the updated wsgen and wsim-
port tools. But if you want to make sure that your environment always has the same features
available and you don't want to point to Metro, you can use the endorsed directories mechan-
ism.
Using endorsed directories
If you are using Java SE 6 with an update release version of less than 4 (i.e., 1.6.0._03 or less)
and you are using Metro or WSIT (Web Services Interoperability Technology), you may be
familiar with the following error message:
You are running on JDK6 which comes with JAX-WS 2.0 API, but this tool
requires
JAX-WS 2.1 API. Use the endorsed standards override mechanism
(http://java.sun.com/javase/6/docs/technotes/guides/standards/),
or use -Xendorsed option.
The basic problem is classloader confusion because Java SE ships with a slightly older version
of JAX-WS than is required by the operation you're performing. You need to get newer ver-
sions of two API JARs on your classpath: JAX-WS 2.1.x and JAXB 2.1.x. These are found
Search WWH ::




Custom Search