axis 连接过程中的异常解决方法-Java频道-中国IT实验室

624阅读 0评论2008-10-17 HcALky8
分类:

    Exception in thread "main" java.lang.NoClassDefFoundError:

    javax/wsdl/OperationType

    缺少:wsdl4j.jar

    将其加入工程中即可


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

    缺少:mail.jar, Activation.jar

     将其加入工程中即可

    Exception: Communication link failure: java.io.IOException,underlying cause: Unexpected end of input stream ** BEGIN NESTED EXCEPTION **  java.io.IOExceptionMESSAGE: Unexpected end of input stream

    原因:mysql的版本不同,即在axis端连接的JDBC driver的版本与Client端的mysql包的版本不一致。

    解决方法:如在axis工程的lib中加入:mysql-connector-java-5.1.5-bin.jar,即可,不要再加入其它版本的mysql。

    No deserializer for {urn:BeanService} UndueStmtDTO

    原因:在连接axis web service时没有对此类型进行序列化和返序列化。

    解决方法:在方法中加入,

    如:QName dtoqn = new QName("urn:BeanService","UndueStmtDTO");

        Class dtocls = UndueStmtDTO.class;

        call.registerTypeMapping(dtocls, dtoqn,

               new org.apache.axis.encoding.ser.BeanSerializerFactory(dtocls,

                             dtoqn),

               new org.apache.axis.encoding.ser.BeanDeserializerFactory(dtocls,

                             dtoqn));

    即可。

    java.io.FileNotFoundException:config.properties

    在工程中对配置信息存放在文件config.properties中,但是却提示此错误。

    java.io.FileNotFoundException:config.properties(系统找不到指定的文件)

    原因:在调用config.properties的地方没有指定其确切位置,它是根据tomcat的位置而定的,可以通过以下语句找到。

    将config.properties文件存放到工程的src目录下。

    如:

    InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties");

    Properties conProp = new Properties();

    conProp.load(in);

    String applicationId = conProp.getProperty("applicationId").trim();

    String action = conProp.getProperty("action").trim();

 

【责编:landy】

--------------------next---------------------

上一篇:用PHP+java实现自动新闻滚动窗口
下一篇:博客已升级,请注意变更地址