Java Reference
In-Depth Information
in jaxws-api.jarand jaxb-api.jar. But because Java already includes these classes, it's not just
a simple matter of placing them on your classpath as you would with a third-party JAR. You
need to get Java to read your new JAR before it reads its own. You do that using the endorsed
directory.
NOTE
There is no support for the endorsed directories mechanism using Web Start (JNLP) technology. This
may be addressed in Java SE 7.
Because the classes that Java uses at runtime are in the rt.jar, you need to get your classes
into the bootstrap classpath, which loads before rt.jar. You do this by creating a new directory
called “endorsed” under <java-home>/lib , and place your new JARs in there.
Alternatively, you can point to a different directory using the java.endorsed.dirs property;
the Java runtime will search the directories listed there for classes to load. If you use multiple
directories, they must be separated with your OS directory separator character, which is equi-
valent to the value of File.pathSeparatorChar .
Using with Ant
You really only want jaxws-api.jarand jaxb-api.jarin your endorsed directories. Do not copy
every JAX-WS-related JAR into this directory, as doing so can cause an Ant task to fail, and it
is more likely that you are using Ant rather than the command line to do your wsimport work.
You may see an error such as the following:
taskdef A class needed by class com.sun.tools.ws.ant.WsImport cannot
be found: org/apache/tools/ant/taskdefs/MatchingTask
Use the classpath task in Ant to specify the two JARs if necessary.
Search WWH ::




Custom Search