Announcement Announcement Module
No announcement yet.
19.4.1 Exposing the service object with spring mvc doesn't work Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

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

    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"/>
    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:
    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, 08:58 AM.

  • #2
    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