com.sun.xml.internal.ws.fault.SOAPFaultBuilder的NoClassDefFoundError [英] NoClassDefFoundError for com.sun.xml.internal.ws.fault.SOAPFaultBuilder

查看:436
本文介绍了com.sun.xml.internal.ws.fault.SOAPFaultBuilder的NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在实时环境中的Web服务客户端最近遇到了异常:

Our web service client in live environment recently got the exception:

java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.fault.SOAPFaultBuilder 
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:107)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
at com.sun.proxy.$Proxy146.search(Unknown Source)
....

我在网上做了很多搜索,包括StackOverflow的一些帖子:

I've done a lot of search online, including a few posts here at StackOverflow:

使用CXF捕获webservice异常:NoClassDefFoundError:SOAPFaultBuilder

无法初始化类com.sun.xml.internal.ws.fault.SOAPFaultBuilder

java.lang.NoClassDefFoundError:无法初始化类com.sun.xml .internal.ws.fault.SOAPFaultBuilder

我的理解是我们的客户端从服务器收到了SOAP Fault,它缺少一些jar文件。所以我试图通过首先重新创建它来解决问题。

And my understanding was our client received a SOAP Fault from the server and it's missing some jar file. So I'm trying to solve the problem by first recreating it.

我在Eclipse中创建了一个简单的Web服务服务器项目,它有一个web方法抛出一个简单的故障类注释通过 @WebFault 。然后我创建了一个使用Web方法的简单Web服务客户端项目。客户端项目在其类路径中没有任何其他库/ jar;它只有JRE。令我惊讶的是,它没有抛出NoClassDefFoundError异常!相反,我得到了 javax.xml.ws.soap.SOAPFaultException 我在服务器端定义。

I created a simple Web Service server project in Eclipse which has a web method throws a simple fault class annotated by @WebFault. Then I created a simple Web Service client project which consumes the web method. The client project doesn't have any additional libraries/jars in its classpath; all it has is the JRE. To my surprise, it didn't throw the NoClassDefFoundError exception! Instead, I got the javax.xml.ws.soap.SOAPFaultException I defined on the server side.

class SOAPFaultBuilder 确实在JRE中的rt.jar中。因此,我创建的简单Web服务项目可能正常工作。但是,为什么我们的实时环境中的Web服务客户端会抛出 NoClassDefFoundError 异常?那个项目肯定在类路径中有rt.jar。

The class SOAPFaultBuilder is indeed in rt.jar in JRE. So the simple web service projects I created probably just work as they should. However, how come the web service client in our live environment throw the NoClassDefFoundError exception? That project definitely has rt.jar in the classpath.

有人可以对这个问题有所了解吗?如果它缺少一些jar文件(来自jaxws RI或Apache CXF或其他),为什么我创建的超级简单客户端没有抛出错误?实时环境和我的本地环境都使用Java7u51。

Can anyone please shed some light on this problem? If it's missing some jar files (either from the jaxws RI or Apache CXF or others), why would the super simple client I created didn't throw the error? Both the live environment and my local environment use Java7u51.

推荐答案

我有同样的错误,我通过删除jax解决了这个问题来自tomcat lib文件夹的-impl.jar。这是jaxb jar版本可能与我在tomcat中安装的一个webapp的冲突。

I had the same erorr and I resolved this issue by deleting the jax-impl.jar from the tomcat lib folder. It was a possible conflict of the jaxb jar versions with one of my webapps installed in tomcat.

http://programtalk.com/java/i-was-running-gwt-application-on-tomca/

这篇关于com.sun.xml.internal.ws.fault.SOAPFaultBuilder的NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆