在使用hessian协议时,项目之间方法调用报以下错误:

com.caucho.hessian.io.HessianServiceException: The service has no method findUser 

主要原因是配置的问题,我使用了错误的URl导致问题的发生。

客户端正确的配置:


<bean id="tutorClient"
class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl">
<value>
http://127.0.0.1:9505/remoting/tutorRemoting
</value>
</property>
<property name="serviceInterface">
<value>com.popchinese.tutoring.service.TutorService</value>
</property>
</bean>

服务器端


<bean name="tutorRemote"
class="org.springframework.remoting.caucho.HessianServiceExporter">
<property name="service">
<ref bean="tutorService" />
</property>
<property name="serviceInterface">
<value>com.popchinese.tutoring.service.TutorService</value>
</property>
</bean>
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/tutorRemoting">tutorRemote</prop>
</props>
</property>
</bean>


我的错误是http地址写错了,导致的,希望大家在使用hessian时,细心配置各个文件。