2 baidu 28843887 baidu_28843887 于 2015.06.19 13:06 提问

SpringMVC整合hessian客户端访问异常,求各位大能指导解决!

错误信息:严重: Servlet.service() for servlet spring threw exception
java.lang.ClassNotFoundException: com.caucho.hessian.client.HessianConnectionException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(HessianClientInterceptor.java:230)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy23.fromCpsReturnVo(Unknown Source)
at com.pumandai.cps.controller.CpsController.toCpsList(CpsController.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)

我的客户端配置文件spring-api.xml中配置了
<!-- hessian连接服务器接口地址 -->
     <bean id="apiService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
        <property name="serviceUrl" value="http://192.168.1.57:8082/cms-web/cpsService" />
        <property name="serviceInterface" value="com.hessian.service.CpsService" />
      <!--  新增overloadEnabled属性,并把它的值设置为true,默认是false,则Hessian就能支持方法的重载了。   -->
        <property name="overloadEnabled" value="true" />
    </bean>
hessian的版本的 hessian 3.1.3.jar

3个回答

beacon_2011
beacon_2011   Rxr 2015.06.19 13:26
u012006909
u012006909   2015.06.19 13:36

HessianConnectionException Class导进去了吗?

baidu_28843887
baidu_28843887 回复cnxieyang: 启动了。我在我本地访问服务器的路径是提示:HTTP Status 405 - HessianServiceExporter only supports POST requests
2 年多之前 回复
u012006909
u012006909 Hessian服务端起起来了没有?
2 年多之前 回复
baidu_28843887
baidu_28843887 我的是客户端,访问服务端。SpringMVC配置按照网上步骤配置的
2 年多之前 回复
baidu_28843887
baidu_28843887 是在xml中配置的吗?org.springframework.remoting.caucho.HessianProxyFactoryBean?这个?
2 年多之前 回复
baidu_28843887
baidu_28843887   2015.06.19 13:44

我的配置文件spring-api.xml中配置了




<!-- 新增overloadEnabled属性,并把它的值设置为true,默认是false,则Hessian就能支持方法的重载了。 -->

Csdn user default icon
上传中...
上传图片
插入图片