Announcement Announcement Module
Collapse
No announcement yet.
FacebookWebArgumentResolver: Unsatisfied dependency expressed through Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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>

    Comment


    • #3
      thanks a lot. It works now.

      great. Its working now.

      Comment

      Working...
      X