zhangyuhong的gravatar头像
zhangyuhong 2018-03-27 14:34:54
学习Axis2遇到问题总结

1.Asix版本冲突的问题【解决:我用wsdl2Java生成的客户端调用代码,里面有两行代码:oper.setStyle(org.apache.axis.enum.Style.WRAPPED);  
oper.setUse(org.apache.axis.enum.Use.LITERAL);enum应该是被认定成了关键字,这里采用axis1.0会报错的, 用axis1.4的jar包就没问题了】

2.异常:An error occurred at line: 34 in the jsp file: /sampleTestCCProxy/Result.jsp

org.eclipse.jst.ws.util.JspUtils cannot be resolved to a type【解决:把Client清除掉,Eclipse重启,异常消失。】

3.[ERROR] The ws.jar service, which is not valid, caused com.ctc.wstx.exc.WstxIOEx
ception: Invalid UTF-8 middle byte 0xfd (at char #66, byte #-1)【解决:这是中文问题,删掉services.xml中的中文即可。要想在services.xml中加中文,需要将编码设为UTF-8或GBK。】

4.异常:Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL【解决:没有在AXIS2上发布,所以导致客户端生成Stub类时出错】

5.

在用eclipse配合Axis2进行开发的时候,编译通过,启动tomcat也顺利,但是就是在调用服务器端的服务时,会抛出:

The ServiceClass object does not implement the required method
        in the following form: OMElement xxx (OMElement e)【解决的方法是在service.xml里面对服务器端开放的服务(操作方法)进行说明。比如我的服务端实现了这两个方法login和getLoginMsg,那么就需要这么定义一下:<operation name="login" >
        <messageReceiver  mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
    </operation>
 <operation name="getLoginMsg" >
        <messageReceiver  mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
    </operation>】

6.按照教程配置Axis2,出现The Apache Axis2 Web service runtime in Tomcat v7.0 Server does not support the service project 问题【经过Google漫长搜索等待,终于小心的找到了解决方法如下:只能使用Servlet3.0以下的规范

7.异常:javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception 【解决:经检查原来tomcat运行环境配置错误】

8.New WebService到最后点击finish却一直卡在那,也不能关闭,要关闭就跳出对话框Wizard can not be closed due to an active operation.You must cancel the operation before you can close the wizard.【解决:寻找一个文件夹从以前的项目(应具有相同的名称)。如果有一个,删除它。也删除该项目从工作区本身的任何保留,并尝试再次导入。】

9.在使用Axis2+eclipse开发web service时,在启动tomcat时,一直报错:java. lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver【解决:在Axis2的安装目录下的lib文件夹下找到xmlschema-core-2.2.1.jar文件。将xmlschema-core-2.2.1.jar文件拷贝到tomcat安装目录下的lib文件夹里。重新部署启动tomcat。】

10.Axis2集成Hibernate时出现org.hibernate.HibernateException: ../hibernate.cfg.xml not found【解决:经过Google漫长搜索等待,终于小心的找到了解决方法,开始尝试硬编码路径:
Configuration cfg = new Configuration().configure(new File("x:\..\..\hibernate.cfg.xml"));没想到,终于ok啦!哈哈哈】


打赏
最近浏览
xishang  LV1 2021年9月28日
张先生没昵称  LV2 2021年7月12日
lipeng927 2020年7月29日
暂无贡献等级
Yolandaa  LV3 2020年7月20日
bcli123  LV7 2020年5月7日
清蒸corns 2019年12月23日
暂无贡献等级
KelvinYip  LV1 2019年6月27日
xianyu  LV2 2018年8月18日
zhangyuhong  LV3 2018年3月27日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友