Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart)

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

 事实上这个问题很简单,我也是搜索了很长时间。但因为这个只是警告,不是出错。因此,只要新添一个log4j,便可以设定提示的警告状态。

错误原因:需要mail.jar和activation.jar。

一般的解决办法是:

1) 下载javamail和jaf,解压出mail.jar和activation.jar

http://java.sun.com/products/javamail/downloads/index.html

http://java.sun.com/products/javabeans/glasgow/jaf.html#download

2) 把mail.jar和activation.jar放到%AXIS_HOME%/WEB-INF/lib目录下

3) 将.jar文件添加到%CLASSPATH%

 

这个办法只会出现新的问题,如no manifiest section for signature file entry /DataContentHandlerFactory,因为需要signture file

 

但其实这个警告是可以忽略的,方法很简单

建立一个新 log4j.properties在JAR的首目录下,log4j.rootLogger=ERROR, Console

====== log4j.properties ====

log4j.rootLogger=ERROR, Console

log4j.category.org.apache.struts=INFO

log4j.category.org.hibernate=INFO

log4j.category.tools=DEBUG,

log4j.additivity.tools=true

log4j.category.ocd=DEBUG

log4j.additivity.ocd=true

log4j.appender.Console=org.apache.log4j.ConsoleAppender

log4j.appender.Console.layout=org.apache.log4j.PatternLayout

log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

====== end =====

  

====== build.xml ====

 

<target name="makejarSOAP" depends="cleanSOAP" description="Build soap jar">

<jar destfile="${build.dir}/${soap.prefixe}.jar" basedir="${classes.dir}">

<exclude name="test/**" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/axis.jar" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/jargs.jar" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/jaxrpc.jar" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/saaj.jar" />         

<zipfileset src="${webapp.dir}/WEB-INF/lib/wsdl4j-1.5.1.jar" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/commons-logging.jar" />

<zipfileset src="${webapp.dir}/WEB-INF/lib/commons-discovery-0.2.jar" /><zipfileset src="${webapp.dir}/WEB-INF/lib/log4j-1.2.9.jar" />        

<manifest>

<attribute name="Main-Class" value="ocd.wsclient.WsClient"/>

</manifest>

</jar>

<javac classpath="${soap.classes.dir}" srcdir="${soap.src.dir}" nowarn="true">
    <include name="${webapp.dir}/WEB-INF/lib/jargs.jar"/>                 

</javac>

</target>

====== end =====

警告就会不再显示了

来自:http://blog.csdn.net/chastel/article/details/2084076

=========================================================

错误原因:
需要mail.jar和activation.jar。

Solution:
Web Services Required Jars Download Instructions 
http://www.eclipse.org/webtools/wst/components/ws/download_instructions_for_jars.html

解决办法:
1) 下载javamail和jaf,解压出mail.jar和activation.jar
http://java.sun.com/products/javamail/downloads/index.html
http://java.sun.com/products/javabeans/glasgow/jaf.html#download
或者我提供了一个rar包:包含mail.jar action.jar
download:mail.jar and activation.jar
2) 把mail.jar和activation.jar放到%AXIS_HOME%\WEB-INF\lib目录下

3) 将.jar文件添加到%CLASSPATH%

说明:
这个是可以忽略的。不过以后构建web services都要用到的,还是添加上的好。
参考:http://www.ogsadai.org.uk/documentation/ogsadai-wsi-2.1/doc/wsi/FAQ.html
This is a warning message that can safely be ignored. It is displayed when Axis has been deployed without an optional JAR. An optional JAR is one that allows Axis to support a particular piece of functionalty but is not required for general use. Please refer to the Axis documentation for more details.

备注:
一篇很好的jars下载指南:Web Services Required Jars Download Instructions
Axis指南:Guide to building Axis

来自:http://www.cppblog.com/wform/archive/2006/04/27/mail_activation_jar.html

你可能感兴趣的:(internet)