Java 制作 Web 服务客户端时出现“警告:无法找到所需的类”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4384749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"WARNING: Unable to find required classes" when making a web service client
提问by Julia
I have to make a web service client from an wsdl file. I have followed tutorial to create and test the service client in the eclipse wizard, and (I thought that I have implemented the code to call the service), but I keep getting this stack trace, I know its maybe trivial but I didn't manage to find anything on internet. I have attached these libraries to the path, so i cant understand what this is, I appreciate any help, first time dealing with web services. I am not sure if it is ok to post entire stack trace here, its quite big, but here is part of it.....
我必须从 wsdl 文件创建一个 Web 服务客户端。我已经按照教程在 eclipse 向导中创建和测试服务客户端,并且(我认为我已经实现了调用服务的代码),但是我一直在获取这个堆栈跟踪,我知道它可能很简单,但我没有设法在互联网上找到任何东西。我已将这些库附加到路径上,所以我无法理解这是什么,我感谢任何帮助,第一次处理 Web 服务。我不确定在这里发布整个堆栈跟踪是否可以,它非常大,但这是其中的一部分.....
Dec 8, 2010 7:10:31 AM org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Fault occurred while processing.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Fault occurred while processing.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
atorg.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
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:2938)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
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.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
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)
at ch.contract.BookCourseServiceEndpointServiceSoapBindingStub.getCourses(BookCourseServiceEndpointServiceSoapBindingStub.java:287)
at ch.contract.RemoteBookCourseServiceProxy.getCourses(RemoteBookCourseServiceProxy.java:62)
at ch.controllers.BookCourseController.getAllCourses(BookCourseController.java:23)
at ch.gui.CourseListFrame.initComponents(CourseListFrame.java:60)
at chbookcourse.gui.CourseListFrame.start(CourseListFrame.java:37)
at ch.bookcourse.Runner.main(Runner.java:9)
{http://xml.apache.org/axis/}hostname:usis-MacBook-Pro-15.local
采纳答案by Asaph
Make sure activation.jar
from the JAF (Java Activation Framework)is in your classpath.
确保activation.jar
来自JAF(Java 激活框架)在您的类路径中。
回答by Bernhard
I solved this warning/error on tomcat 8 with eclipse birt reporting viewer.
我使用 eclipse birt 报告查看器在 tomcat 8 上解决了这个警告/错误。
Fetch the latest ones from:
从以下位置获取最新的:
- http://central.maven.org/maven2/javax/activation/activation/
- http://central.maven.org/maven2/com/sun/mail/javax.mail/
- http://central.maven.org/maven2/javax/activation/activation/
- http://central.maven.org/maven2/com/sun/mail/javax.mail/
and place them into the installation directory (just like in classpath):
并将它们放入安装目录(就像在类路径中一样):
- /apache-tomcat-v/lib/
- /apache-tomcat-v/lib/
this should solve your problem
这应该可以解决您的问题