Announcement Announcement Module
Collapse
No announcement yet.
Error while configuring Connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while configuring Connection

    Hi to all. I have such situation i try to connect through the OAuth 2.0 protocol. I get access_token. and then i try to make facebook connection to use facebook API. But i recieve exception.
    Code:
    rg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error: No suitable constructor found for type [simple type, class org.springframework.social.facebook.api.FacebookProfile]: can not instantiate from JSON object (need to add/enable type information?)
     at [Source: java.io.ByteArrayInputStream@531602f4; line: 1, column: 2]; nested exception is org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.social.facebook.api.FacebookProfile]: can not instantiate from JSON object (need to add/enable type information?)
     at [Source: java.io.ByteArrayInputStream@531602f4; line: 1, column: 2]
    Maybe i have wrong configuration so here is my configs
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
    	default-lazy-init="true">
    
    	<bean id="connectionFactoryLocator"
    		class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
    		<property name="connectionFactories">
    			<list>
    				<bean
    					class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
    					<constructor-arg value="${facebook.appId}" />
    					<constructor-arg value="${facebook.appSecret}" />
    				</bean>
    			</list>
    		</property>
    	</bean>
    	
    	<bean id="usersConnectionRepository"
    		class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
    		<constructor-arg ref="connectionFactoryLocator" />
    		<constructor-arg ref="textEncryptor" />
    	</bean>
    
    	<bean id="connectionRepository" factory-method="createConnectionRepository"
    		factory-bean="usersConnectionRepository" scope="request">
    		<constructor-arg value="#{request.userPrincipal.name}" />
    	</bean>
    
    
    	<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
    		factory-method="noOpText" />
    
    	<!-- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> 
    		<property name="customArgumentResolver" ref="facebookWebArgResolver" /> </bean> 
    		<bean id="facebookWebArgResolver" class="org.springframework.social.facebook.FacebookWebArgumentResolver"> 
    		<constructor-arg name="apiKey" value="${facebook.appId}"/> </bean> -->
    </beans>
    Also i do not know what is #{request.userPrincipal.name}. Maybe i do not need userconnectionRepository at all.
Working...
X