I have all the jars in the Spring 3 framework on my classpath and I wanted to add Spring 3 mvc to my app config. Originally, I had the following XML.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
<context:annotation-config/>
<bean class="com.apppackage.app.config.AppContextConfig" />
<!-- Autoscan for @Controller type controllers -->
<context:component-scan base-package="com.apppackage.app.controller" />
That is just a snippet of the relevant information. My app worked fine with the above XML, but then I added Spring 3 MVC in the config with the following changes:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:annotation-config/>
<mvc:annotation-driven />
<bean class="com.apppackage.app.config.AppContextConfig" />
<!-- Autoscan for @Controller type controllers -->
<context:component-scan base-package="com.apppackage.app.controller" />
Now, I have problems all over my application. Spring does not seem to be Autowiring beans that it was before. I was also getting the following error on my controllers:
No adapter for handler [com.apppackage.app.controller.login.LoginController@274b9691]: Does your handler implement a supported interface like Controller?
LoginController. So show usLoginController.