WSSERVLET11:failed to parse runtime descriptor: java.lang.LinkageError
2016-08-24 10:36
531 查看
MyEclipse 建立的JAX-WS webservice工程,到其他机器tomcat中无法启动--LinkageError
错误内容:严重: WSSERVLET11:failed to parse runtime descriptor: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/FreeRoomWS/WEB-INF/lib/webservices-rt.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class)
needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader.(Seehttp://java.sun.com/j2se/1.5.0/docs/guide/standards/)
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/FreeRoomWS/WEB-INF/lib/webservices-rt.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class)
needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (Seehttp://java.sun.com/j2se/1.5.0/docs/guide/standards/)
…………………………………………………………
错误产生原因:
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI(xxx) needs 2.1 API
很明显是由于tomcat加载了低版本的jaxb包,而实际上需要更高版本的jaxb包。
网上有很多人提出了不少解决方案,差不多利用的都是tomcat的endorsed特性。
但介绍往往不全面,只是针对自己的错误,进行了解决,照着去做有可能解决不了自己的错误,需要对症下药。
要解决此问题,需要注意以下两点:
1. 不是下载jaxb-api.jar 而是下载jaxb-api-2.1.jar文件,或者按照提示,下载需要的更高版本的Jaxb 包。
2.不是把下载的这个jar文件放在sun网站给出的<java-home>/lib/endorsed 下,也不一定是放在Tomcat6.0的根目录下,自己建立的endorsed文件夹内。而是要自己试验确定应该放在哪个目录下:
确定放在哪个目录下的方法如下:
首先要看你的项目是java项目还是java web项目:
A, java项目直接打印System.out.println(System.getProperty("java.endorsed.dirs"));即是jaxb-api-2.1.jar应该放的目录。
B, java web 项目要用一个可以正常启动的web项目(当然没用到jaxb的web项目),打印System.out.println(System.getProperty("java.endorsed.dirs"));即可。
友情小提示:
如果你不想这么麻烦,可以选几个路径放一下试试,如果实在不行再打印。
可以尝试的两个路径:<%Tomcat%>/endorsed/jaxb-api-2.x.jar;
<%Tomcat%>/common/endorsed/jaxb-api-2.x.jar;需要注意的是,在Tomcat6.0下,是没有common和endorsed目录的,需要自己手动建立。
小结:
为了解决此错误,我花费了近三个小时,在此贡献出来帮助需要的人,以防再走弯路。
相关文章推荐
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
- hive 报错FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient FAILED: Execu
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
- hive 报错FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoo
- Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException
- 严重: WSSERVLET11: failed to parse runtime descriptor: The serviceName cannot be retrieved from an int
- Hive出现异常 FAILED: Error In Metadata: Java.Lang.RuntimeException: Unable To Instantiate Org.Apache.Had
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
- HIVE2 Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteExc
- FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.解决办法
- ERROR/AndroidRuntime(716): java.lang.SecurityException: Binder invocation to an incorrect interface
- Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastor
- java.lang.AssertionError: java.net.SocketTimeoutException: failed to connect to /192.168.1.5 (por
- linux中使用hbase出现 Failed to start master java.lang.RuntimeException: HMaster Aborted
- Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastor
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class
- android中ADT版本问题: java.lang.NoClassDefFoundError和conversion to dalvik format failed with error 1错误
- 【解决问题】failed: java.lang.RuntimeException: org.openqa.selenium.WebDriverException: Unexpected error launching Internet Explorer.