2 geduo 83 geduo_83 于 2013.12.27 15:11 提问

axis2 客户端调用接口数据保存不了,这是怎么回事?报错如下

两个问题:
1. axis2 服务端数据类型为Timestamp,生成的客户端数据类型为Calendar,这就导致类型不匹配,保存数据的时候保存不了,这是怎么回事?报错如下,请大神们指点一下

2.服务端所抛出的异常客户端接收不到,怎么回事儿?

客户端调用如下:
public class Test {
public static void main(String[] args) {
HxcNews hxcNews = new HxcNews();
hxcNews.setTitle("bbb");
hxcNews.setContent("ccc");

hxcNews.setAddtime(Calendar.getInstance());
try {
HxcNewsServicePortType hxcNewsServicePortType = new HxcNewsServiceLocator().getHxcNewsServiceHttpSoap11Endpoint();
hxcNewsServicePortType.create(hxcNews);

} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

}

服务端如下(axis2+hibernate):
public class HxcNewsService extends Service implements IHxcNewsService {
@Override
public void create(HxcNews baseBean){
// TODO Auto-generated method stub
super.create(baseBean);

}

}

服务端报错如下:
[WARN] Unable to locate a BeanInfo cache for class java.sql.Timestamp (stopClass=null). This will negatively affect performance!
[ERROR] Exception occurred while trying to invoke service method create
org.apache.axis2.AxisFault: java.sql.Timestamp
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:47)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:412)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:461)
at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:818)
at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:737)
at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:646)
at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:206)
at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:66)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
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.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:293)
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(Thread.java:619)
Caused by: java.lang.InstantiationException: java.sql.Timestamp
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:42)
... 26 more
[ERROR] org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method create

1个回答

laoyhi
laoyhi   2014.03.13 10:35

只能说Axis2不够健壮

geduo_83
geduo_83 只能说你也不是很懂
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片