我用axis2 将ActivityServiceImpl发布成webService类,该类的方法返回的是一个List。生成stub类后,在客户端调用,然后就报错了(找了很久都没有找到原因):
- Java code
[ERROR] java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: org.hibernate.collectionorg.apache.axiom.om.OMException: java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: org.hibernate.collection at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249) at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:327) at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:706) at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:675) at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:124) at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:274) at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:203) at org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231) at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:422) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:138) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)
WebService类:
- Java code
package com.rui.businessactivities.service.impl;import java.util.List;import com.rui.businessactivities.dao.ActivityDao;import com.rui.businessactivities.model.BusinessActivities;import com.rui.businessactivities.service.ActivityService;public class ActivityServiceImpl implements ActivityService { private ActivityDao activityDao; @Override public boolean addActivity(BusinessActivities ba) { return activityDao.saveActivity(ba); } @Override public List<BusinessActivities> listActivities() { return activityDao.listActivity(); } public ActivityDao getActivityDao() { return activityDao; } public void setActivityDao(ActivityDao activityDao) { this.activityDao = activityDao; }}