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

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

    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, 09: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

    Comment

    Working...
    X