Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: AOP configuration seems to be invalid: tried calling method [public abstract cn.blog.bean.UserInfo cn.blog.service.IBlogService.getBlogs(java.lang.String,java.lang.String)] on target [org.codehaus.xfire.spring.remoting.XFireExporter@10ac9a8]; nested exception is java.lang.IllegalArgumentException: object is not an instance of declaring class
org.codehaus.xfire.fault.XFireFault: AOP configuration seems to be invalid: tried calling method [public abstract cn.blog.bean.UserInfo cn.blog.service.IBlogService.getBlogs(java.lang.String,java.lang.String)] on target [org.codehaus.xfire.spring.remoting.XFireExporter@10ac9a8]; nested exception is java.lang.IllegalArgumentException: 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 $Proxy12.getBlogs(Unknown Source)
at cn.blog.service.IBlogServiceClient.main(IBlogServiceClient.java:99)
另外,我的wsdl如下:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://service.blog.cn" xmlns:tns="http://service.blog.cn" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://bean.blog.cn" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.blog.cn">
- <xsd:element name="getBlogs">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
+ <xsd:element name="getBlogsResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="ns1:UserInfo" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://bean.blog.cn">
- <xsd:complexType name="UserInfo">
- <xsd:sequence>
<xsd:element minOccurs="0" name="age" type="xsd:int" />
<xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string" />
<xsd:element minOccurs="0" name="pwd" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="getBlogsRequest">
<wsdl:part name="parameters" element="tns:getBlogs" />
</wsdl:message>
- <wsdl:message name="getBlogsResponse">
<wsdl:part name="parameters" element="tns:getBlogsResponse" />
</wsdl:message>
- <wsdl:portType name="IBlogServicePortType">
- <wsdl:operation name="getBlogs">
<wsdl:input name="getBlogsRequest" message="tns:getBlogsRequest" />
<wsdl:output name="getBlogsResponse" message="tns:getBlogsResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="IBlogServiceHttpBinding" type="tns:IBlogServicePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getBlogs">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getBlogsRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
+ <wsdl:output name="getBlogsResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="IBlogService">
- <wsdl:port name="IBlogServiceHttpPort" binding="tns:IBlogServiceHttpBinding">
<wsdlsoap:address location="http://localhost:8080/BlogServer/services/BlogService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
5 个解决方案
#1
object is not an instance of declaring class
这么麻烦,接口类定义的有问题吧。
无法调用呀。
把你的接口及实现发出来看看。
http://blog.csdn.net/caok/archive/2008/11/20/3339260.aspx
这么麻烦,接口类定义的有问题吧。
无法调用呀。
把你的接口及实现发出来看看。
http://blog.csdn.net/caok/archive/2008/11/20/3339260.aspx
#2
帮顶!
#3
object is not an instance of declaring class
抽取的窄接口没有被继承。所以创造不了对象。
xfire-servlet.xml 里面 比如:
<bean id="UserServices" parent="baseWebService">
<!-- 业务服务bean -->
<property name="serviceBean"
value="com.fjt.user.webservice.UserServicesImpl" />
<!-- 业务服务bean的窄接口类 -->
<property name="serviceClass"
value="com.fjt.user.webservice.UserServices" />
</bean>
也就是你的UserServicesImpl要继承UserServices,试试
抽取的窄接口没有被继承。所以创造不了对象。
xfire-servlet.xml 里面 比如:
<bean id="UserServices" parent="baseWebService">
<!-- 业务服务bean -->
<property name="serviceBean"
value="com.fjt.user.webservice.UserServicesImpl" />
<!-- 业务服务bean的窄接口类 -->
<property name="serviceClass"
value="com.fjt.user.webservice.UserServices" />
</bean>
也就是你的UserServicesImpl要继承UserServices,试试
#4
哎,看过1楼 坤哥的文章不错不错 嘿嘿(关于webservice)
#5
果然是高手
#1
object is not an instance of declaring class
这么麻烦,接口类定义的有问题吧。
无法调用呀。
把你的接口及实现发出来看看。
http://blog.csdn.net/caok/archive/2008/11/20/3339260.aspx
这么麻烦,接口类定义的有问题吧。
无法调用呀。
把你的接口及实现发出来看看。
http://blog.csdn.net/caok/archive/2008/11/20/3339260.aspx
#2
帮顶!
#3
object is not an instance of declaring class
抽取的窄接口没有被继承。所以创造不了对象。
xfire-servlet.xml 里面 比如:
<bean id="UserServices" parent="baseWebService">
<!-- 业务服务bean -->
<property name="serviceBean"
value="com.fjt.user.webservice.UserServicesImpl" />
<!-- 业务服务bean的窄接口类 -->
<property name="serviceClass"
value="com.fjt.user.webservice.UserServices" />
</bean>
也就是你的UserServicesImpl要继承UserServices,试试
抽取的窄接口没有被继承。所以创造不了对象。
xfire-servlet.xml 里面 比如:
<bean id="UserServices" parent="baseWebService">
<!-- 业务服务bean -->
<property name="serviceBean"
value="com.fjt.user.webservice.UserServicesImpl" />
<!-- 业务服务bean的窄接口类 -->
<property name="serviceClass"
value="com.fjt.user.webservice.UserServices" />
</bean>
也就是你的UserServicesImpl要继承UserServices,试试
#4
哎,看过1楼 坤哥的文章不错不错 嘿嘿(关于webservice)
#5
果然是高手