Results 1 to 3 of 3

Thread: FacebookWebArgumentResolver: Unsatisfied dependency expressed through

  1. #1
    Join Date
    Mar 2011
    Posts
    13

    Default FacebookWebArgumentResolver: Unsatisfied dependency expressed through

    Hi,
    I am using M2 spring social and I get the following error when my webapp is started.

    Error:
    15 [Thread-2] ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed
    org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'facebookWebArgResolver' defined in ServletContext res
    ource [/WEB-INF/spring-servlet.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: Ambiguous
    constructor argument types - did you specify the correct bean references as constructor arguments?
    at org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:716)
    at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:196)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:1003)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:907)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)

    My xml is like this:
    <!-- Initialize Facebook Argument Resolver -->
    <bean id="facebookWebArgResolver" class="org.springframework.social.facebook.web.Fac ebookWebArgumentResolver">
    <constructor-arg name="apiKey" value="${facebook.appId}"/>
    <constructor-arg name="apiSecret" value="${facebook.appSecret}"/>
    </bean>

    <bean class="org.springframework.web.servlet.mvc.annotat ion.AnnotationMethodHandlerAdapter">
    <property name="customArgumentResolver" ref="facebookWebArgResolver"/>
    </bean>

    I checked the docs and I am passing correct constructor arguments. Can you please help ?

  2. #2
    Join Date
    Aug 2004
    Posts
    1,070

    Default

    The constructor argument names have changed, so it should look like this:

    Code:
    <bean id="facebookWebArgResolver" class="org.springframework.social.facebook.web.Fac ebookWebArgumentResolver">
        <constructor-arg name="appId" value="${facebook.appId}"/>
        <constructor-arg name="appSecret" value="${facebook.appSecret}"/>
    </bean>
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Mar 2011
    Posts
    13

    Default thanks a lot. It works now.

    great. Its working now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •