axis2 不能参与Spring切面编程问题解决小技
http://ssagara.blogspot.com/2008/08/axis2-with-spring-aop.html#!/2008/08/axis2-with-spring-aop.html
最近在整axis2,加入spring之后发现报错The following error occurred during schema generation: Unable to load bytecode for class
网上找资料看了之后,发现是由于axis2 不能参与事务管理,而我的写的service又刚好符合pointcut,所以报错了,后来把pointcut改写了一下,就不会报错了
或者通过下面方式解决
定义一个Service接口,定义一个Service类,类不要实现接口,类和接口里的函数定义要一样。
然后在services.xml里用下面方式配置:
<service name=”getOrgService”>
<description>
Web Service for organization
</description>
<!– <schema schemaNamespace=”http://service.axis2.ws” /> –>
<description>web service</description>
<parameter name=”ServiceObjectSupplier”>
org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
</parameter>
<parameter name=”SpringBeanName” locked=”false”>orgWebSoapServiceImpl</parameter>此处的Bean被Spring管理。即是Service的实现类
<parameter name=”ServiceClass” locked=”false”>ws.axis2.service.OrgWebSoapService</parameter>此处只给他接口,骗axis,让其初始化成功。
<operation name=”getOrgGet” >
<!–<messageReceiver class=”jp.co.nttdata.security.web.spring.controller.org.ws.axis2.xml.MyRecerver”/>–>
<messageReceiver class=”org.apache.axis2.rpc.receivers.RPCMessageReceiver” /> 此处在Http get参数中,要用args0,args1…..来传递参数。
</operation>
<operation name=”getOrgPost” >
<messageReceiver class=”org.apache.axis2.receivers.RawXMLINOutMessageReceiver”/>
<!– <messageReceiver mep=”http://www.w3.org/2004/08/wsdl/in-out” class=”org.apache.axis2.rpc.receivers.RPCMessageReceiver” />–>
</operation>
</service>