您的位置:首页 > 其它

XFire容易配置出现的几个异常信息

2010-02-24 11:19 417 查看
今天做一个Flex调用Web服务的程序创建一个WS,由于一段时间没有使用配置忘记,导致发生一个错误,经过研究发现时配置错误:所以修改配置发现常出现错误!!如下希望可以给各个编程爱好者一个帮助!^_^

发生以下错误的原因:

Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault:

Illegal argument invoking 'com.unutrip.remoting.ws.FlexWebService.helloWord(java.lang.String, java.lang.String)': object is not an instance of declaring

class
org.codehaus.xfire.fault.XFireFault: Illegal argument invoking 'com.unutrip.remoting.ws.FlexWebService.helloWord(java.lang.String, java.lang.String)': object

is not an instance of declaring class
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.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.helloWord(Unknown Source)
at com.unutrip.xfire.ws.XFireWSClient.main(XFireWSClient.java:30)

经过一番分析和检得到是xfire.xml的配置文件错误!!

错误配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>FlexWebService</name>
<namespace>com.unutrip.remoting.ws</namespace>
<serviceClass>
com.unutrip.remoting.ws.FlexWebService
</serviceClass>
<serviceBean>com.unutrip.remoting.ws.FlexWebServiceImpl</serviceBean>
</service>
</beans>

正确配置:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>FlexWebService</name>
<namespace>com.unutrip.remoting.ws</namespace>
<serviceClass>com.unutrip.remoting.ws.FlexWebService</serviceClass>
<implementationClass>com.unutrip.remoting.ws.FlexWebServiceImpl</implementationClass>
</service>
</beans>

发生以下错误:
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault:

Invalid operation: {http://ws.remoting.unutrip.com}helloWord
org.codehaus.xfire.fault.XFireFault: Invalid operation: {http://ws.remoting.unutrip.com}helloWord
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.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.helloWord(Unknown Source)
at com.unutrip.xfire.ws.XFireWSClient.main(XFireWSClient.java:30)

错误配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>FlexWebService</name>
<namespace>com.unutrip.remoting.ws</namespace>
<serviceBean>com.unutrip.remoting.ws.FlexWebService</serviceBean>

<serviceClass>com.unutrip.remoting.ws.FlexWebService</serviceClass>
<implementationClass>com.unutrip.remoting.ws.FlexWebServiceImpl</implementationClass>
</service>
</beans>

正确配置:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>FlexWebService</name>
<namespace>com.unutrip.remoting.ws</namespace>
<serviceClass>com.unutrip.remoting.ws.FlexWebService</serviceClass>
<implementationClass>com.unutrip.remoting.ws.FlexWebServiceImpl</implementationClass>
</service>
</beans>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐