TonyB
Jul 18th, 2007, 06:10 AM
Hello,
I am trying to use BeanNameUrlHandlerMapping to map a Url (/assistMe) onto a bean (assistMe), but get the following error message on deployment:
2007-07-18 10:40:08 StandardContext[/assist-gui]Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
org.springframework.beans.factory.UnsatisfiedDepen dencyException:
Error creating bean with name 'defaultHandlerMapping' defined in ServletContext resource [/WEB-INF/httpinvoker-servlet.xml]:
Unsatisfied dependency expressed through bean property 'rootHandler':
There are 20 beans of type [java.lang.Object] available for autowiring by type: [assistAction, swaAction, filterChainProxy, httpSessionContextIntegrationFilter, logoutFilter, authenticationProcessingFilter, securityContextHolderAwareRequestFilter, rememberMeProcessingFilter, anonymousProcessingFilter, exceptionTranslationFilter, filterInvocationInterceptor, rememberMeServices, authenticationManager, daoAuthenticationProvider, userDetailsService, dataSource, loggerListener, agentAdapter, assistMe, /assistMe].
There should have been exactly 1 to be able to autowire property 'rootHandler' of bean 'defaultHandlerMapping'.
Consider using autowiring by name instead.
Spring config looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="autodetect">
<bean id="defaultHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUr lHandlerMapping">
<property name="defaultHandler"><value>/assistMe</value></property>
</bean>
<bean name="/assistMe" class="org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter">
<property name="service">
<ref bean="assistMe"/>
</property>
<property name="serviceInterface">
<value>com.mytest.AssistMeClient</value>
</property>
</bean>
<bean id="assistAction"
class="com.mytest.AssistAction"
singleton="false">
<property name="assistMe">
<ref local="assistMe"/>
</property>
</bean>
<bean id="assistMe" class="com.mytest.AssistMe" lazy-init="true">
<property name="agentAdapter">
<ref local="agentAdapter"/>
</property>
<property name="timeoutInSeconds">
<value>30</value>
</property>
</bean>
<bean id="agentAdapter" class="com.mytest.VoxAgentAdapter" lazy-init="true"/>
</beans>
Any hints or tips would be greatly appreciated.
Cheers,
TonyB
I am trying to use BeanNameUrlHandlerMapping to map a Url (/assistMe) onto a bean (assistMe), but get the following error message on deployment:
2007-07-18 10:40:08 StandardContext[/assist-gui]Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
org.springframework.beans.factory.UnsatisfiedDepen dencyException:
Error creating bean with name 'defaultHandlerMapping' defined in ServletContext resource [/WEB-INF/httpinvoker-servlet.xml]:
Unsatisfied dependency expressed through bean property 'rootHandler':
There are 20 beans of type [java.lang.Object] available for autowiring by type: [assistAction, swaAction, filterChainProxy, httpSessionContextIntegrationFilter, logoutFilter, authenticationProcessingFilter, securityContextHolderAwareRequestFilter, rememberMeProcessingFilter, anonymousProcessingFilter, exceptionTranslationFilter, filterInvocationInterceptor, rememberMeServices, authenticationManager, daoAuthenticationProvider, userDetailsService, dataSource, loggerListener, agentAdapter, assistMe, /assistMe].
There should have been exactly 1 to be able to autowire property 'rootHandler' of bean 'defaultHandlerMapping'.
Consider using autowiring by name instead.
Spring config looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="autodetect">
<bean id="defaultHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUr lHandlerMapping">
<property name="defaultHandler"><value>/assistMe</value></property>
</bean>
<bean name="/assistMe" class="org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter">
<property name="service">
<ref bean="assistMe"/>
</property>
<property name="serviceInterface">
<value>com.mytest.AssistMeClient</value>
</property>
</bean>
<bean id="assistAction"
class="com.mytest.AssistAction"
singleton="false">
<property name="assistMe">
<ref local="assistMe"/>
</property>
</bean>
<bean id="assistMe" class="com.mytest.AssistMe" lazy-init="true">
<property name="agentAdapter">
<ref local="agentAdapter"/>
</property>
<property name="timeoutInSeconds">
<value>30</value>
</property>
</bean>
<bean id="agentAdapter" class="com.mytest.VoxAgentAdapter" lazy-init="true"/>
</beans>
Any hints or tips would be greatly appreciated.
Cheers,
TonyB