Announcement Announcement Module
Collapse
No announcement yet.
conflict between hessian remoting and <mvc:annotation-driven /> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • conflict between hessian remoting and <mvc:annotation-driven />

    I have declared some expose bean,
    Code:
    	<bean name="/CoreChecklistService" class="org.springframework.remoting.caucho.HessianServiceExporter">
    		<property name="service" ref="coreChecklistService" />
    		<property name="serviceInterface" value="it.ubiss.gedi.gfs.service.CoreChecklistService" />
    	</bean>
    Now I need to declare a spring controller and add <mvc:annotation-driven />

    So remoting bean are not more reachable.
    Why????

    Web.xml
    Code:
    <servlet>
    		<servlet-name>remoting-servlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>
    				/WEB-INF/spring/application-config.xml
    			</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>remoting-servlet</servlet-name>
    		<url-pattern>/hessianRemoting/*</url-pattern>
    	</servlet-mapping>
    Last edited by luca.preziati; Jun 24th, 2011, 07:38 AM.

  • #2
    Use [ code][/code ] tags when posting.

    Remoting doesn't work anymore because the DispatcherServlet doesn't know what to do with it (anymore). This is due to the annotation-driven namespace, it registers 2 HandlerAdapters which override the defaults. Next to mvc:annotation-driven also include a HttpRequestHandlerAdapter.

    Comment


    • #3
      Sorry for code tags, I didn't know that exist, but I corrected the post.

      I have declared a bean as follow:

      Code:
        <bean id="httpmapper" class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter">
        </bean>
      but now I don't reach nothing

      No mapping found for HTTP request with URI [/gedi-gfs-webapp/hessianRemoting/clearTypeRegistryCache.htm] in DispatcherServlet with name 'remoting-servlet' my controller
      No mapping found for HTTP request with URI [/gedi-gfs-webapp/hessianRemoting/pdc/Search] in DispatcherServlet with name 'remoting-servlet' my hessian element

      Should I attach the bean to servlet?
      Last edited by luca.preziati; Jun 24th, 2011, 10:39 AM.

      Comment


      • #4
        You also need a BeanNameHandlerMapping to map the beanname to a url (which is what you want for the Hessian stuff).

        Comment


        • #5
          This is the solution:

          add the following bean, one required by the annotated spring controller, another one required by Hessian Remoting

          Code:
           <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
              <property name="order" value="1" />
            </bean>
            <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
              <property name="order" value="2" />
            </bean>
          In any case I think the documentation doesn't contain this aspect: expose Hessian bean and have a administrator front end on the same webapp can be useful: in my case I have t clear cache for exposed bean
          Last edited by luca.preziati; Jun 27th, 2011, 06:22 AM.

          Comment

          Working...
          X