Exception in thread "main" java.lang.LinkageError:

qq_26333595 java工程师  2015-12-11 11:12:56
调用外部接口,通过myeclipse--web server client 一系列操作,得到一些文件,然后写测试demo,
public static void main(String[] args) {
// TODO Auto-generated method stub
EntpriseInfoImplService ent = new EntpriseInfoImplService();
EntpriseInfoInterface eif = ent.getEntpriseInfoImplPort();
String info=eif.findEnt(1, 2, "");
//eif.findEnt(0, 10, "");
System.out.println(info);
//System.out.println(System.getProperty("java.endorsed.dirs"));

}
run as 运行报错:
Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/F:/Program%20Files/Eclipse/Common/plugins/com.genuitec.eclipse.ws.xfire_9.0.0.me201211011550/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. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:276)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:273)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:98)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
at javax.xml.ws.spi.Provider.provider(Provider.java:76)
at javax.xml.ws.Service.<init>(Service.java:57)
at com.dj.entservice.EntpriseInfoImplService.<init>(EntpriseInfoImplService.java:56)
at com.dj.entservice.TestEntpriseinfo.main(TestEntpriseinfo.java:14)

在网上查的解决办法不对,请大家来分析一下是什么原因呢
...全文
140 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
引用 2 楼 qq_26333595 的回复:
[quote=引用 1 楼 shijing266 的回复:] 参考 参考
这个我已经试过了,是不行的!现在问题已经解决了,可能插件不同,在eclipse和myeclipse下面生成的文件是不一样的,不过能拿来使用,所以问题已经解决,谢谢![/quote] 你是用eclipse执行myeclipse生成的文件?
回复
qq_26333595 2015-12-14
引用 1 楼 shijing266 的回复:
参考 参考
这个我已经试过了,是不行的!现在问题已经解决了,可能插件不同,在eclipse和myeclipse下面生成的文件是不一样的,不过能拿来使用,所以问题已经解决,谢谢!
回复
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-12-11 11:12
社区公告
暂无公告