客户端main方法测试,
调试时可以调用服务端,但是当遇到
new Hibernate的DAO 是就出现异常~
(DAO层都是存在继承关系的~) 
异常如下:
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Error invoking 'com.service.IehomeService.sendProposalObj(com.ui.form.ProposalForm)'. Nested exception is java.lang.reflect.InvocationTargetException: null
org.codehaus.xfire.fault.XFireFault: Error invoking 'com.service.IehomeService.sendProposalObj(com.ui.form.ProposalForm)'. Nested exception is java.lang.reflect.InvocationTargetException: null
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.sendProposalObj(Unknown Source)
at com.client.ehomeServiceClient.main(ehomeServiceClient.java:106)昨天调数据源也不行说数据源未注册:
*** DBDataSource testDataSource has not registed!
java.lang.IllegalArgumentException: **** DBDataSource testDataSource has not registed!
 汗汗~!各位大侠帮帮忙呀~!!!

解决方案 »

  1.   

    数据源没注册,看看配置文件吧……其实我也不懂XFire的,路过把我知道的说出来吧,祝楼主好运……
      

  2.   

    如果你使用了spring和XFire进行整合的话,必须要按照以下步骤进行:
    1、导入XFire和Spring相关的包,其中spring的必须导入关于DAO的包
    2、在src下建Spring配置文件applicationContext.xml、在WEB-INF下建xfire-servlet.xml 
    3、配置web.xml 
    4、编写服务接口和实现类
    5、配置Spring配置文件applicationContext.xml和xfire-servlet.xml其详细过程我就不贴出了,因为涉及到MyEclipse的导入包之类的操作。这里只给出applicationContext.xml和xfire-servlet.xml,web.xml的配置部分。applicationContext.xml如下:<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean id="HelloWorldBean" class="com.HelloService" />
    </beans>xfire-servlet.xml文件内容如下:<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <!-- 引入XFire预配置信息 -->
    <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
    <bean
    class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
    <map>
    <entry key="/HelloWorldService.ws">
    <ref bean="HelloWorldService" />
    </entry>
    </map>
    </property>
    </bean>
    <!-- 使用XFire导出器 -->
    <bean id="baseWebService"
    class="org.codehaus.xfire.spring.remoting.XFireExporter"
    lazy-init="false" abstract="true">
    <!-- 引用xfire.xml中定义的工厂 -->
    <property name="serviceFactory" ref="xfire.serviceFactory" />
    <!-- 引用xfire.xml中的xfire实例 -->
    <property name="xfire" ref="xfire" />
    </bean>

    <bean id="HelloWorldService" parent="baseWebService">
    <!-- 业务服务bean -->
    <property name="serviceBean" ref="HelloWorldBean" />
    <!-- 业务服务bean的窄接口类 -->
    <property name="serviceClass" value="com.IHello" />
    </bean>
    </beans>web.xml文件内容如下:<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/classes/applicationContext.xml,/WEB-INF/xfire-servlet.xml</param-value>
    </context-param>

    <servlet>    
    <servlet-name>SpringContextServlet</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoaderServlet
    </servlet-class> 
     <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- end Spring配置 -->
    <!-- begin XFire 配置 -->
    <servlet>
    <servlet-name>xfire</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>xfire</servlet-name>
    <url-pattern>*.ws</url-pattern>
    </servlet-mapping>
    <servlet>

    <!--  配合Spring容器中XFire一起工作的Servlet-->
    <servlet-name>xfireServlet</servlet-name>
    <servlet-class>
    org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
    </servlet>
     
    <servlet-mapping>
    <servlet-name>xfireServlet</servlet-name>
    <!-- 在这个URI下开放Web Service服务 -->
    <url-pattern>/service/*</url-pattern>
    </servlet-mapping>
     
    </web-app>
      

  3.   

    基本上知道你的问题
    你这样你先把服务器端的写好
    在服务器段 建一个 Test类有main方法把 Dao都测试一边
    然后 提供远程调用的service类 不应该直接是Dao等
    应该是一个 Service类 比如 UserService (现在知道为什么spring都要这么设计了吧,就是为了提供各种实现)
    当你UserServiceImpl 做完以后 也是用Test类测一下 其实这里要注意就是你问题所在
    方法返回值 如果跨系统只能是String  如果你返回一个List 并且里面是一个vo对象
    对象是hibernate对象还有 懒加载就会报你的错最好返回String 然后接受在做处理。 这个是经验谈 最终你会明白的。