无法找到所需的类(javax.activation.DataHandler和javax.mail.internet.MimeMultipart)。附件支持已禁用 [英] Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled

查看:121
本文介绍了无法找到所需的类(javax.activation.DataHandler和javax.mail.internet.MimeMultipart)。附件支持已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在调用Web服务中存在的方法时遇到问题。 wsdl是使用AXIS创建的。

I am facing problems in invoking a method present in a web service. The wsdl was created using AXIS.

当我尝试使用我的java代码调用它时,我从服务响应中获取空值。

When I try to invoke it using my java code, I am getting null values from the service response.

我收到了在我的控制台中打印的警告消息:

I am getting the warning message getting printed in my console:


无法找到所需的类(javax。 activation.DataHandler和javax.mail.internet.MimeMultipart)。附件支持已禁用。

Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.

在尝试解决此问题时,我在工作区构建路径中添加了activation.jar和mail.jar,重新启动服务器。

While trying to solve this, I added activation.jar and mail.jar in my workspace build path, restarted the server.

编辑:

右键单击WSDL ==>生成CLient

Right Click on the WSDL ==> Generate CLient

然后我得到了一个代理类,使用它我写这个来调用服务方法:

Then I got a proxy class, using it I wrote this to invoke the service method:

public class CallingWebService1 {

public static void main(String[] args) throws Exception {

    WebService1Proxy proxy1 = new WebService1Proxy();
    proxy1.setEndpoint("http://localhost:8045/WebService1/services/WebService1");

    EmployeeDetails details = proxy1.getDetails();
    System.out.println("Employee Id: " + details.getEmpId());
    System.out.println("Employee Name: " + details.getEmpName());
    System.out.println("Dept Id: " + details.getDeptId());
    System.out.println("Dept Name" + details.getDeptName());
    System.out.println("Age: " + details.getAge());
}

但问题仍然存在:(

更多信息:

getDetails()方法正在执行数据库操作,从Oracle DB中获取一些记录。使用class12.jar执行数据库操作。是否与我正在调用服务方法有关?

The getDetails() method is performing a DB operation fetching some records from the Oracle DB. For performing the DB operation, class12.jar is used. Does it have something to do with invoking the service method the way I am doing?

推荐答案

为了解决javax.activation.DataHandler问题,你必须添加 JavaBeans Activation Framework activation.jar。

In order to fix the javax.activation.DataHandler issue you must add the JavaBeans Activation Framework activation.jar in your classpath.

为了修复javax.mail.internet.mimeMultipart问题,你必须添加<你的类路径中有一个href =http://www.oracle.com/technetwork/java/javamail/index.html =noreferrer> Java Mail API mail.jar。

In order to fix the javax.mail.internet.mimeMultipart issue you must add the Java Mail API mail.jar in your classpath.

控制台中打印的警告消息显示上述罐子不在c中lasspath。

The warning messages printed in your console shows that the above jars are not in the classpath.

这篇关于无法找到所需的类(javax.activation.DataHandler和javax.mail.internet.MimeMultipart)。附件支持已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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