---
title: "Eclipse集成jboss-5.0.0.GA的时候出现的java.lang.LinkageError错误"
author: "holoblog"
date: "2011-11-06T13:42:00Z"
tags: []
slug: "eclipse-jboss-5-0-0-ga-java-lang-linkageerror"
draft: false
lastmod: "2011-11-20T20:24:42Z"
id: 1268894
url: "https://holoblog.iteye.com/blog/1268894"
---

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`](http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#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就可以解决这个问题了