dortman
Sep 28th, 2004, 01:48 PM
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:
InputStream is = new FileInputStream(
"C:\\Apps\\eclipse\\workspace\\table_maint\\beans.x ml");
XmlBeanFactory factory = new XmlBeanFactory(is);
manager = (CntlMessageBI) factory.getBean("cntlmsg");
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):
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(Hess ianProxy.java:171)
at $Proxy0.getAllMessages(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.remoting.caucho.HessianClientI nterceptor.invoke(HessianClientInterceptor.java:12 0)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy1.getAllMessages(Unknown Source)
The relevant portions of my configuration files are as follows:
beans.xml - Used by Swing client:
<beans>
<bean id="cntlmsg" class="org.springframework.remoting.caucho.HessianProxyFa ctoryBean">
<property name="serviceInterface">
<value>tablemaint.datalogic.CntlMessageBI</value>
</property>
<property name="serviceUrl">
<value>http://localhost:8080/tablemaint/ws/Clinic-hessian</value>
</property>
</bean>
</beans>
web.xml
<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>
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 files
<bean id="cntlMsgMan" class="tablemaint.datalogic.CntlMessageMgr">
<property name="cntlMessageDao">
<ref bean="msgManDao"/>
</property>
</bean>
<bean name="/Clinic-hessian" class="org.springframework.remoting.caucho.HessianService Exporter">
<property name="service"><ref bean="cntlMsgMan"/></property>
<property name="serviceInterface">
<value>tablemaint.datalogic.CntlMessageBI</value>
</property>
</bean>
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. :)
Thanks in advance for any insight,
-Dave
Swing Client: In the client, I'm using an XMLBeanFactory to obtain instances to the bean:
InputStream is = new FileInputStream(
"C:\\Apps\\eclipse\\workspace\\table_maint\\beans.x ml");
XmlBeanFactory factory = new XmlBeanFactory(is);
manager = (CntlMessageBI) factory.getBean("cntlmsg");
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):
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(Hess ianProxy.java:171)
at $Proxy0.getAllMessages(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.remoting.caucho.HessianClientI nterceptor.invoke(HessianClientInterceptor.java:12 0)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy1.getAllMessages(Unknown Source)
The relevant portions of my configuration files are as follows:
beans.xml - Used by Swing client:
<beans>
<bean id="cntlmsg" class="org.springframework.remoting.caucho.HessianProxyFa ctoryBean">
<property name="serviceInterface">
<value>tablemaint.datalogic.CntlMessageBI</value>
</property>
<property name="serviceUrl">
<value>http://localhost:8080/tablemaint/ws/Clinic-hessian</value>
</property>
</bean>
</beans>
web.xml
<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>
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 files
<bean id="cntlMsgMan" class="tablemaint.datalogic.CntlMessageMgr">
<property name="cntlMessageDao">
<ref bean="msgManDao"/>
</property>
</bean>
<bean name="/Clinic-hessian" class="org.springframework.remoting.caucho.HessianService Exporter">
<property name="service"><ref bean="cntlMsgMan"/></property>
<property name="serviceInterface">
<value>tablemaint.datalogic.CntlMessageBI</value>
</property>
</bean>
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. :)
Thanks in advance for any insight,
-Dave