• 问题记录 java.lang.NoClassDefFoundError: org/dom4j/DocumentException


    客户端调webservice服务产生以下错误
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
    faultSubcode:
    faultString: java.lang.NoClassDefFoundError: org/dom4j/DocumentException; nested exception is:
    java.lang.NoClassDefFoundError: org/dom4j/DocumentException
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}hostname:DESKTOP-EKM6CGM

    java.lang.NoClassDefFoundError: org/dom4j/DocumentException; nested exception is:
    java.lang.NoClassDefFoundError: org/dom4j/DocumentException
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    但是客户端并没有使用dom4j的任何class,所以问题出在服务端或其他地方。服务端本身并没有报错,而且在debugger状态下请求还没收到客户端就报错了,所以猜测是tomcat的问题。
    把dom4j.jar复制到tomcat/lib目录下,使用客户端再次访问,发现刚才的问题没有了。
    希望对同样遇到此问题的同学有帮助!!!

  • 相关阅读:
    Ruby的Integer数据类型
    InfoPath设计优化
    深入浅出SharePoint——TimeJob编程
    深入浅出SharePoint——操作Item权限类
    深入浅出Powershell——添加用户或群组到群组中
    深入浅出PowerShell——更新List Item中的PeopleandGroup 域值
    使用TimeJob
    深入浅出InfoPath——动态获取InfoPath中的命名空间
    ContentType大展拳脚——定义List
    PowerShell深入浅出——增加账号到管理员群组
  • 原文地址:https://www.cnblogs.com/bunuo/p/12795487.html
Copyright © 2020-2023  润新知