Eclipse集成jboss-5.0.0.GA的时候出现的java.lang.LinkageError错误

来源:互联网 发布:360建站 编辑:程序博客网 时间:2024/05/16 07:56

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 propertyjava.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 byjava.endorsed.dirs, they must be separated byFile.pathSeparatorChar. If no value is set forjava.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 thejre 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就可以解决这个问题了