-
Jul 21st, 2010, 11:20 PM
#1
What is Autowiring of methods failed?
Hi,
I encountered the following error. I have searched the forums & doc, but still have no idea. Could you please give me some idea or hint what is "Autowiring of methods failed"? And which doc should I refer to?
...Autowiring of methods failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Could not autowire method: ...
Regards,
JK
Regards,
JK
-
Jul 22nd, 2010, 01:51 AM
#2
Hi,
Can you also post in your configuration for autowiring etc...
-Hetal
-
Jul 22nd, 2010, 02:32 AM
#3
Hi Hetal,
Thank you for your reply! Do you mean the file web.xml & web-application-config.xml? And they are as below,
web.xml
======
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- The front controller of the Spring MVC Web application, responsible for handling all application requests -->
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/web-application-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
web-application-config.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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<!-- Scan for annotation based controllers -->
<context:component-scan base-package="com.springsource.springtravel.hotels" />
<!-- Configure Apache Tiles for the view -->
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2 .TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/layouts/layouts.xml</value>
<value>/WEB-INF/controllers/hotels/views.xml</value>
<value>/WEB-INF/controllers/cars/views.xml</value>
</list>
</property>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBas edViewResolver">
<property name="requestContextAttribute" value="requestContext"/>
<property name="viewClass" value="org.springframework.web.servlet.view.tiles2 .TilesView"/>
</bean>
</beans>
Regards,
JK
-
Jul 22nd, 2010, 02:43 AM
#4
Hi Hetal,
I think I just find out how to avoid the error by remove my new class StubCarSearchService. I don't know why it relates to "Autowiring", since I just duplicate the orignal existing class & try to run the app.
Regards,
JK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules