org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException
客户端调用服务器端webservice时,出现如图情况:
applicationContext相关配置:
<bean id="managerReportsDAO" class="cn.communion.taxi.dao.ManagerReportsDAOImpl">
<property name="sqlMapClientTemplate" ref="sqlMapClientTemplate"></property>
</bean>
<bean id="managerReportsService" class="cn.communion.taxi.service.ManagerReportsServiceImpl">
<property name="managerReportsDAO" ref="managerReportsDAO"></property>
</bean>
服务器端对外webservice:
public class ManagerServiceImpl implements ManagerService {
//服务层service
private ManagerReportsService managerReportsService;
public String getCarNoLoad(String nowDate, String carNumber){
System.out.println(nowDate);
List<ReportsResponse> list = managerReportsService.getCarNoLoad(nowDate, carNumber);
StringBuffer json = new StringBuffer();
json.append("[");
for(int i = 0; i < list.size(); i ++){
json.append("{");
json.append("occurDate:" + list.get(i).getOccurDate()+",");
json.append("averageItem:" + list.get(i).getAverageItem());
json.append("}");
if(i != list.size() - 1){
json.append(",");
}
}
json.append("]");
System.out.println(json.toString());
String enString = "";
try {
enString = Constants.Encrypt(json.toString());
} catch (Exception e) {
e.printStackTrace();
}
return enString;
}
public ManagerReportsService getManagerReportsService() {
return managerReportsService;
}
public void setManagerReportsService(ManagerReportsService managerReportsService) {
this.managerReportsService = managerReportsService;
}
}
BUG:org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.Client.invoke(Client.java:368)
at cn.communion.taxi.webService.TestService.main(TestService.java:16)
------解决方案--------------------
遇到同样的问题:Nested exception is org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException
org.codehaus.xfire.fault.XFireFault: Fault: java.lang.NullPointerException
------解决方案--------------------
楼主是怎么解决的?求指点。。