PDA

View Full Version : Problem with MessageBrokerHandlerAdapter - Does your handler [...] like Controller?



adelinor
Mar 2nd, 2009, 10:06 AM
Hi,

As soon as I add the following bean config to my existing Spring MVC application (based on spring 2.5.6):



<!-- Dispatches requests mapped to a MessageBroker -->
<bean class="org.springframework.flex.messaging.servlet.Message BrokerHandlerAdapter"/>


I get the following error when trying to access a URL handled by a traditional spring mvc controller:


javax.servlet.ServletException: No adapter for handler [eu.emea.scorecard.web.example.ExampleController@1c f5ee4]: Does y
our handler implement a supported interface like Controller?
at org.springframework.web.servlet.DispatcherServlet. getHandlerAdapter(DispatcherServlet.java:1100)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:874)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)


How can I have the two working in parallel?

Prascic Pepi
Mar 3rd, 2009, 11:23 AM
Try registering additional HandlerAdapter into spring web app context.



<bean class="org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter"/>

I had the same problem, and this seems to solve it. But now I have some other problems (can't receive response from remote sevice), so I can't confirm this solution.

Try it, and say the result.

Prascic Pepi
Mar 4th, 2009, 08:30 AM
I finally got the reply from my remote service, so I can tell that this solution is ok for my case. I have classic spring MVC web application, lots of controllers and .jsp-s and this allows 'hybrid' approach, not just pure flex client.

adelinor
Mar 6th, 2009, 02:38 AM
Thank you so much for your help.

As per your indication, by adding a bean of type org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter, the spring servlet dispatcher handles both:

the traditional requests
and the Flex communication


This is superb.

I add also a problem to have the Blaze DS remote object invokations working: it was because I had not mapped /spring/* to the Servlet dispatcher in the web.xml file.

Looking for trying the M2 release launched yesterday.... and the RC1 lining on the horizon.

Have a beautiful day!