Saturday, July 7, 2007

Configure plugins jaxws-maven-plugin with jdk1.6

Today, i will write about how to use plugins jaxws-maven-plugin with jdk 1.6.
The prolem is : JDK 1.6 shipped with jaxws 2.0. But if you want to use jaxws-maven-plugin with latest jaxws library 2.1, you will meet the error:

JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Documents and Settings/Administrator.HOME/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directo
ry mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)

This error occurred because jaxb 2.0 was loaded instead of your jaxb 2.1.

Solution:
First: you should find where is your java-home.
Second: go to ${java-home}/jre/lib and create folder: endorsed.
In this folder(endorsed) you copy your jaxb-api and jaxws-api (version 2.1 not 2.0)

Now done!
Test: mvn jaxws:wsimport and see the result.

1 comment:

Anonymous said...

Thanks a lot!!

Google