I'm trying to access some objects running in Tomcat in a Swing client. I've setup a web application which uses these objects fine, so I know they work. However, I keep encountering ProtocolExceptions with both Hessian and Burlap. I'm sure I'm doing something incorrect; but am having a hard time figuring it out.
Swing Client: In the client, I'm using an XMLBeanFactory to obtain instances to the bean:
According to the log file, the bean is created and returned without any problems. However, when I try to invoke a method, I get the following Hessian error (I get the equivalent error with Burplap):Code:InputStream is = new FileInputStream( "C:\\Apps\\eclipse\\workspace\\table_maint\\beans.xml"); XmlBeanFactory factory = new XmlBeanFactory(is); manager = (CntlMessageBI) factory.getBean("cntlmsg");
The relevant portions of my configuration files are as follows:Code:org.springframework.remoting.RemoteAccessException: Cannot access Hessian service at [http://localhost:8080/tablemaint/ws/Clinic-hessian]; nested exception is com.caucho.hessian.io.HessianProtocolException: com.caucho.hessian.io.HessianProtocolException: at com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java:171) at $Proxy0.getAllMessages(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.remoting.caucho.HessianClientInterceptor.invoke(HessianClientInterceptor.java:120) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy1.getAllMessages(Unknown Source)
beans.xml - Used by Swing client:
web.xmlCode:<beans> <bean id="cntlmsg" class="org.springframework.remoting.caucho.HessianProxyFactoryBean"> <property name="serviceInterface"> <value>tablemaint.datalogic.CntlMessageBI</value> </property> <property name="serviceUrl"> <value>http://localhost:8080/tablemaint/ws/Clinic-hessian</value> </property> </bean> </beans>
ws-servlet.xml - I've only included the portion which creates the Hessian (or Burlap) service. There are about a dozen beans defined in the XML file, but they are all created with no problems according ot the log filesCode:<servlet> <servlet-name>ws</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ws</servlet-name> <url-pattern>/ws/*</url-pattern> </servlet-mapping>
I borrowed this code from the sample projects assuming I could get it up and running quickly. I've been able to defeat that assumption.Code:<bean id="cntlMsgMan" class="tablemaint.datalogic.CntlMessageMgr"> <property name="cntlMessageDao"> <ref bean="msgManDao"/> </property> </bean> <bean name="/Clinic-hessian" class="org.springframework.remoting.caucho.HessianServiceExporter"> <property name="service"><ref bean="cntlMsgMan"/></property> <property name="serviceInterface"> <value>tablemaint.datalogic.CntlMessageBI</value> </property> </bean>
Thanks in advance for any insight,
-Dave



Reply With Quote