文章目錄
- Endorsed Standards Classes Deployment
MyEclipse整合JBOSS5.0的時候啟動JBOSS的時候出現了下面的API錯誤資訊:
java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/E:/java/apache-tomcat-6.0.26/webapps/ejbClient/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use
the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
到sun公司的上面的一個網址後解釋資訊如下:
Endorsed Standards Classes Deployment
Classes implementing newer versions of endorsed standards should be placed in JAR files. The system property
java.endorsed.dirs specifies one or more directories that the Java runtime environment will search for such JAR files. If more than one directory path is specified by
java.endorsed.dirs, they must be separated by
File.pathSeparatorChar. If no value is set for
java.endorsed.dirs, then Sun Microsystem's implementation of the Java platform looks for JAR files in a default standard location:
<java-home>\lib\endorsed [Microsoft Windows]<java-home>/lib/endorsed [Solaris or Linux]
Here <java-home> refers to the directory where the runtime software is installed (which is the top-level directory of the J2SE Runtime Environment or the
jre directory in the JDK).
The J2SE runtime environment will use classes in such JAR files to override the corresponding classes provided in the Java platform as shipped by Sun.
將jboss-5.0.0.GA\lib\endorsed目錄下的jaxb-api.jar這個jar檔案放到JDK的Java\jdk1.6.0\jre\lib這個目錄下的的endorsed目錄中供類載入器載入;操作就是在jre/lib目錄中建立一個endorsed目錄,然後把上面的那個jaxb-api.jar放到這個目錄中,重新啟動jboss就可以解決這個問題了