Results 1 to 5 of 5

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

  1. #1

    Default 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 at 06:38 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    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 at 09:39 AM.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    You also need a BeanNameHandlerMapping to map the beanname to a url (which is what you want for the Hessian stuff).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5

    Default

    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 at 05:22 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •