Results 1 to 2 of 2

Thread: 19.4.1 Exposing the service object with spring mvc doesn't work

  1. #1
    Join Date
    Sep 2010
    Posts
    25

    Smile please explain chapter 19.4.1 of the reference doc

    http://static.springsource.org/sprin...ng-httpinvoker


    To expose the AccountService (mentioned above) within a Spring Web MVC DispatcherServlet, the following configuration needs to be in place in the dispatcher's application context:

    HTML Code:
    <bean name="/AccountService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        <property name="service" ref="accountService"/>
        <property name="serviceInterface" value="example.AccountService"/>
    </bean>
    Such an exporter definition will be exposed through the DispatcherServlet's standard mapping facilities, as explained in the section on Hessian.
    This I can't make it work.

    I manage to make work the alternative way by declaring in the web.xml

    HTML Code:
    <servlet>
        <servlet-name>accountExporter</servlet-name>
        <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
    </servlet>
    but the first mentionned way doesn't work, it's not automagically bound to an already existing spring mvc dispatcher servlet
    Last edited by etrier; Mar 17th, 2011 at 08:58 AM.

  2. #2
    Join Date
    Sep 2010
    Posts
    25

    Default

    after debugging spring I finally found I needed to instanciate in the spring servlet context xml
    <bean class="org.springframework.web.servlet.mvc.HttpReq uestHandlerAdapter"/>

    please update the docs, how can we guess this is needed ?
    javax.servlet.ServletException: No adapter for handler [org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter@f80123]: Does your handler implement a supported interface like Controller?

    it says there is no adapter as if it's definitive and doesn't say you might just instantiate some appropriate adapter that will register themselves automagically

Posting Permissions

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