Announcement Announcement Module
Collapse
No announcement yet.
Protocol Exceptions with Hessian & Burlap Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Protocol Exceptions with Hessian & Burlap

    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:

    Code:
    InputStream is = new FileInputStream(
        "C:\\Apps\\eclipse\\workspace\\table_maint\\beans.xml");
    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):

    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)
    The relevant portions of my configuration files are as follows:

    beans.xml - Used by Swing client:

    Code:
    <beans>
    	
    	<bean id="cntlmsg" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
    		<property name="serviceInterface">
    			<value>tablemaint.datalogic.CntlMessageBI</value>
    		</property>
    		<property name="serviceUrl">
    			<value>http&#58;//localhost&#58;8080/tablemaint/ws/Clinic-hessian</value>
    		</property>
    	</bean>
    	
    </beans>
    web.xml

    Code:
      	<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

    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>
    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

  • #2
    I found my problem. My ws-servlet.xml also had the following entries:

    Code:
       <bean id="springappController" class="tablemaint.web.SpringappController">
            <property name="cntlMessageManager">
                <ref bean="cntlMsgMan"/>
            </property>
        </bean>
    
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
            <property name="mappings">
                <props>
                    <prop key="/cntlmessage.htm">springappController</prop>
                </props>
            </property>
        </bean>
    These entries were left over as I copied the xml file from another one in which I used to setup the web application. I'm not entirely sure why having an instance of Controller in there was causing all of the export services to fail; but it was.

    -Dave

    Comment

    Working...
    X