No adapter for handler in Spring MVC

I have problem with simple spring mvc controller written in scala:

class HelloWorldController {

 implicit def sessionFactory2Session(sf: SessionFactory) = sf.getCurrentSes
  var sessionFactory: SessionFactory = null

 @RequestMapping(value=Array("/hello.html"),method = Array(RequestMethod.GET,RequestMethod.POST))
 def showHello  = {

   val document = new CustomDocument("name","custom")


When I tried to access /hello.html I received exception:

javax.servlet.ServletException: No adapter for handler: Does your handler implement a supported interface like Controller?
at org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(
at org.springframework.web.servlet.DispatcherServlet.doDispatch(
at org.springframework.web.servlet.DispatcherServlet.doService(
at org.springframework.web.servlet.FrameworkServlet.processRequest(
at org.springframework.web.servlet.FrameworkServlet.doGet(

But when I removed @Transactional annotation - everything works!!. Spring can't find request mapping with two annotations? My applicationContext.xml fragment:

 <bean id="openSessionInViewInterceptor"
     <property name="sessionFactory" ref="sessionFactory"/>

 <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
     <property name="interceptors">
         <list><ref bean="openSessionInViewInterceptor"/></list>
     <property name="alwaysUseFullPath" value="true" />
<context:component-scan base-package="scala.hibernate"/>

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass"
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>

 <!-- for transaction -->
 <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManaager">
      <property name="sessionFactory" ref="sessionFactory"/>
      <property name="dataSource" ref="dataSource"/>


Transactional aspect is applied using dynamic proxy, and it prevents Spring MVC from accessing the @RequestMapping annotations on the target class Solution:

    <tx:annotation-driven proxy-target-class="true"/>


Try adding <context:annotation-config /> to your applicationContext.xml and see if that fixes the problem.

declare following bean . this should solve the problem

<bean id="simpleHandler" class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>

will update you once find out the root cause..

Need Your Help

Wordpress Help - Making a link populate on lower section of the page

php wordpress hyperlink wordpress-plugin

Wordpress Help - Making a link populate on lower section of the page

Symfony2 uncaught exception inside Event Listener

symfony exception listener uncaught-exception

I have a problem with throwing Symfony 2 exception inside event listner. When I do it I get Uncaught exception (onRequest method of listener). Is there any way to throw exception in listener that c...