Announcement Announcement Module
Collapse
No announcement yet.
Exception faced while migrating Social's java based configuration style to xml based Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception faced while migrating Social's java based configuration style to xml based

    Hi,
    I am a beginner to Spring and newbie to Spring AOP but I am pretty impressed with your work. I am a big fan of spring social especially, among your other offerings.
    I tried to migrate the spring social's configuration from java based to XML based and thats where the spring aop and proxy came into picture.
    I do understand that java based configuration is powerful than the xml based one but due to seggregation of configuration to xmls, I chose to try it out.

    [Note: For me there isnt a usecase which may make me to rethink this descision and go for a hybrid approach at best, partly java based and partly xml based configuration, to get the best of both world.]

    While using the xml based configuration, the code compiles fine and deploys (thanks to lazy-init) but when after succesful signin via say facebook, I have put injection for facebook object (property being of type Facebook interface), the object which should have been initialized with necessary authorization for current user and returned. In current scenario proxy to concrete facebook object being returned [Note: I believe the proxied object is actually the subclass of the object being proxied, as I recall from my initial lookup elsewhere in this regard], I get following error:
    -----------------------------------------------------
    [Stacktrace]
    Code:
    SEVERE: Servlet.service() for servlet [SpringParentController] in context with path [/SpringFB] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facebookHomeController' defined in ServletContext resource [/WEB-INF/application-context-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy114 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.social.facebook.api.Facebook' for property 'facebook'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy114 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.social.facebook.api.Facebook] for property 'facebook': no matching editors or conversion strategy found] with root cause
     java.lang.IllegalStateException: Cannot convert value of type [$Proxy114 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.social.facebook.api.Facebook] for property 'facebook': no matching editors or conversion strategy found
     	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:241)
     	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470)
     	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516)
     	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510)
     	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406)
     	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365)
     	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
     	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
     	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
     	at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:332)
     	at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
     	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:328)
     	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
     	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
     	at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.lookupHandler(AbstractUrlHandlerMapping.java:152)
     	at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.getHandlerInternal(AbstractUrlHandlerMapping.java:102)
     	at org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:288)
     	at org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1063)
     	...
    -----------------------------------------------------
    application-context.xml
    [Extract]
    Code:
    <context:component-scan base-package="org.springframework.social.connect.jdbc." scoped-proxy="interfaces"/>
    <context:component-scan base-package="org.springframework.social.connect.support" scoped-proxy="interfaces"/>
    <context:component-scan base-package="org.springframework.social.connect.web" scoped-proxy="interfaces"/>
    <context:component-scan base-package="org.springframework.social.facebook" scoped-proxy="interfaces"/>
    <context:component-scan base-package="org.springframework.social.facebook.api" scoped-proxy="interfaces"/>
    	...
    
    <bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository" primary="true" scope="singleton">
    		<constructor-arg type="javax.sql.DataSource" ref="dataSource"/>
    		<constructor-arg type="org.springframework.social.connect.ConnectionFactoryLocator" ref="connectionFactoryLocator"/>
    		<constructor-arg type="org.springframework.security.crypto.encrypt.TextEncryptor" ref="textEncryptor"/>
    		<property name="connectionSignUp" ref="simpleConnectionSignUp"/>
    </bean>
    
    
    <bean name="connectionRepository" class="org.springframework.social.connect.ConnectionRepository" factory-bean="usersConnectionRepository" factory-method="createConnectionRepository" scope="request" lazy-init="true">
    	<constructor-arg value="#{request.userPrincipal.name}"/>
    	<aop:scoped-proxy proxy-target-class="false"/>
    
    </bean>	 
    
    <bean id="OA2ConectionClass" class="org.springframework.social.connect.Connection" factory-bean="connectionRepository" factory-method="getPrimaryConnection" scope="request" lazy-init="true">
    	<constructor-arg type="java.lang.Class" value="org.springframework.social.facebook.api.Facebook"/>
    	<aop:scoped-proxy proxy-target-class="false"/>
    </bean>
    	
    <bean id="facebook" class="org.springframework.social.facebook.api.Facebook" factory-bean="OA2ConectionClass" factory-method="getApi" scope="request" lazy-init="true">
    	<aop:scoped-proxy proxy-target-class="false"/>
    </bean>
    -----------------------------------------------------------------------
    pom.xml
    [Extract]

    Code:
    <dependencies>
    	<dependency>
    		<groupId>org.springframework.social</groupId>
    		<artifactId>spring-social-core</artifactId>
    		<version>1.0.2.RELEASE</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.social</groupId>
    		<artifactId>spring-social-web</artifactId>
    		<version>1.0.2.RELEASE</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.social</groupId>
    		<artifactId>spring-social-facebook</artifactId>
    		<version>1.0.1.RELEASE</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.social</groupId>
    		<artifactId>spring-social-facebook-web</artifactId>
    		<version>1.0.1.RELEASE</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.security</groupId>
    		<artifactId>spring-security-crypto</artifactId>
    		<version>3.1.0.RELEASE</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	<dependency>
    		<groupId>org.apache.httpcomponents</groupId>
    		<artifactId>httpclient</artifactId>
    		<version>4.2</version>
    		<type>jar</type>
    		<scope>compile</scope>
    	</dependency>
    	  ...
    	<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-context</artifactId>
    			<version>3.1.1.RELEASE</version>
    			<type>jar</type>
    			<scope>compile</scope>
    	</dependency>
    	<dependency>
    			<groupId>cglib</groupId>
    			<artifactId>cglib-nodep</artifactId>
    			<version>2.2.2</version>
    			<type>jar</type>
    			<scope>compile</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-beans</artifactId>
    			<version>3.1.1.RELEASE</version>
    			<type>jar</type>
    			<scope>compile</scope>
    	</dependency>
    	...
    </dependencies>
    ------------------------------------------------------------------------

    One more thing, upon new user being connected and returning user being directly sent to the home area works fine with authentication and database record creation/updation. So getting the facebook object to do operations should not have been a problem.

    Please feel free to correct me if I am missing something important or if you can point me to an appropriate resource for resolving this. I have already taken look at the quickstart and showcase samples.

    I appreciate all the help I can get in resolving this.

    Thanks & regards,
    Vinayak
    Last edited by habuma; Jun 13th, 2012, 03:30 PM. Reason: To ensure clarity and abidance to forum posting standard

  • #2
    I have got this feeling that this query can/should have been posted in AOP forum as the issue is AOP related.
    I am not sure how to do that now so please bear with me and hope an informed privileged user will do the needful.

    Happy coding,
    Vinayak

    Comment


    • #3
      Wow, that error really wasn't very helpful in figuring out what went wrong, was it? But I think I *might* have a clue anyway.

      Have you seen the spring-social-twitter4j example (https://github.com/SpringSource/spri...al-twitter4j)? Aside from showing how to use Spring Social with a 3rd party API binding, it also demonstrates how to configure Spring Social using XML. Here's a snippet of the social configuration:

      Code:
      	<bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
      		<constructor-arg ref="dataSource" />
      		<constructor-arg ref="connectionFactoryLocator" />
      		<constructor-arg ref="textEncryptor" />
      		<aop:scoped-proxy proxy-target-class="false" />
      	</bean>
      	
      	<bean id="connectionFactoryLocator" class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
      		<property name="connectionFactories">
      			<list>
      				<bean class="org.springframework.social.showcase.twitter.connect.TwitterConnectionFactory">
      					<constructor-arg value="${twitter.consumerKey}" />
      					<constructor-arg value="${twitter.consumerSecret}" />				
      				</bean>
      			</list>
      		</property>
      		<aop:scoped-proxy proxy-target-class="false" />
      	</bean>
      
      	<bean id="connectionRepository" factory-method="createConnectionRepository" factory-bean="usersConnectionRepository" scope="request">
      		<constructor-arg value="#{request.userPrincipal.name}" />
      		<aop:scoped-proxy proxy-target-class="false" />
      	</bean>
      Notice that the "usersConnectionRepository" bean is singleton, but it also has a scoped-proxy element in it. I think the lack of such an element in your configuration might be a part of the problem (but I could be wrong...I'm trying to break the Twitter4j sample by making its config look much like yours and haven't had much luck yet...it keeps working no matter what I change).
      Last edited by habuma; Jun 13th, 2012, 03:42 PM.

      Comment


      • #4
        Originally posted by habuma View Post
        Wow, that error really wasn't very helpful in figuring out what went wrong, was it? But I think I *might* have a clue anyway.
        Thank you Habuma for your reply. Yes it indeed wasn't. (Unless a regular user of this [read: aop] may think otherwise.)

        Originally posted by habuma View Post
        Have you seen the spring-social-twitter4j example (https://github.com/SpringSource/spri...al-twitter4j)? Aside from showing how to use Spring Social with a 3rd party API binding, it also demonstrates how to configure Spring Social using XML.
        I did take a look at few samples but those had java based configuration. Thank you for pointing out the XML config style of twitter sample. I had missed it.
        I will explore the said sample to understand it better.

        Originally posted by habuma View Post
        Notice that the "usersConnectionRepository" bean is singleton, but it also has a scoped-proxy element in it. I think the lack of such an element in your configuration might be a part of the problem (but I could be wrong...I'm trying to break the Twitter4j sample by making its config look much like yours and haven't had much luck yet...it keeps working no matter what I change).
        In my initial code config/code updation, the result was the same as earlier. I still get the same exception;
        Code:
        org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facebookHomeController' defined in ServletContext resource [/WEB-INF/application-context-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy86 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.social.facebook.api.Facebook' for property 'facebook'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy86 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.social.facebook.api.Facebook] for property 'facebook': no matching editors or conversion strategy found
        	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
        	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
        	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
        	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        	org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
        	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        	org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
        	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        
        root cause
        
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facebookHomeController' defined in ServletContext resource [/WEB-INF/application-context-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy86 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.social.facebook.api.Facebook' for property 'facebook'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy86 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.social.facebook.api.Facebook] for property 'facebook': no matching editors or conversion strategy found
        	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
        	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        	org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:332)
        	org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
        	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:328)
        	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
        	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
        	org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.lookupHandler(AbstractUrlHandlerMapping.java:152)
        	org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.getHandlerInternal(AbstractUrlHandlerMapping.java:102)
        The deeper look at twitter sample should shed more light in the correct way of doing this.

        Regards,
        Vinayak

        Comment


        • #5
          Please let me know if you figure it out or if you get stuck again. I spent some time yesterday trying to recreate your problem within the Twitter4j example, but could not and ran out of time before I had to head to a meeting. I might pick it up again today...but can't say for certain if I'll have the time.

          I was thinking late last night that the one thing that might be worth trying is to simply add Facebook to the Twitter4J example (should only need a pom.xml dependency, a connection factory configuration, an API binding bean config, and some code to use it). If it works, then you'd have a working example to draw from. If it doesn't work, then if you're lucky it will fail with the same error and we'll have another example to tinker with to try to figure it out.

          Comment


          • #6
            Thank you Habuma for your reply.
            The twitter4j sample uses a hybrid configuration approach.

            Originally posted by habuma View Post
            Please let me know if you figure it out or if you get stuck again. I spent some time yesterday trying to recreate your problem within the Twitter4j example, but could not and ran out of time before I had to head to a meeting. I might pick it up again today...but can't say for certain if I'll have the time.
            Migrating the twiter4j sample is no piece of cake (for beginners at least) as there are implementation specifics (like OAuth implementations, APIAdapters etc) to tackle before we reach our actual usecase.
            I suggest migrating quickstart's java based configuration to xml one, applying lessons from twiter4j samples configuration. This may save us some time. [Although I doubt why complete xml config can't do the same for me. Unless a particular usecase warrants alternative approach]

            If you would like to recreate the problem in question then you can take a look at the attached application context file Attachment .
            [Please rename it to be xml and add your specific settings like facebook app credentials and datsource]

            The key thing to note for me, between the quickstart config and mine is interaction/mapping in following and quickstart/showcase [For facebook/linkedin]] samples config :
            Code:
            <bean id="usersConnectionRepository" class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository" primary="true" scope="singleton">
            		<constructor-arg type="javax.sql.DataSource" ref="dataSource"/>
            		<constructor-arg type="org.springframework.social.connect.ConnectionFactoryLocator" ref="connectionFactoryLocator"/>
            		<constructor-arg type="org.springframework.security.crypto.encrypt.TextEncryptor" ref="textEncryptor"/>
            		<property name="connectionSignUp" ref="simpleConnectionSignUp"/>
            
            		<aop:scoped-proxy proxy-target-class="false"/>
            </bean>
            
            
            <bean name="connectionRepository" factory-bean="usersConnectionRepository" factory-method="createConnectionRepository" scope="request" lazy-init="true">
            	<constructor-arg value="#{request.userPrincipal.name}"/>
            	<aop:scoped-proxy proxy-target-class="false"/>
            
            </bean>	 
            
            <bean id="OA2ConectionClass" factory-bean="connectionRepository" factory-method="getPrimaryConnection" scope="request" lazy-init="true">
            	<constructor-arg type="java.lang.Class" value="org.springframework.social.facebook.api.Facebook"/>
            	<aop:scoped-proxy proxy-target-class="false"/>
            </bean>
            I believe the runtime behaviour of this is affecting the outcome [read: returned Facebook api instance for DI].

            I will revert back if any new significant development happens.

            I am also eager to know the outcome,if you choose to go ahead and test the problem (especially) with provided application context or any other approach of yours.

            Regards,
            Vinayak
            Attached Files
            Last edited by vinayakchalse; Jun 14th, 2012, 11:59 AM.

            Comment


            • #7
              [Update] I updated my code to replace facebook DI with the connectionRepository DI, so that I can get required api's later when required.
              Now I am getting following exception.

              [Error stacktrace]
              Code:
                       org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 22): Field or property 'name' cannot be found on null
                       at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFie         ldReference.java:205)
                       at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyO         rFieldReference.java:72)
                       at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpress         ion.java:57)
                       at  org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
                       at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88         )
                       at  org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:139)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1299)
                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:210)
                       at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:182)
                       at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
                       at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
                       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                       at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:332)
                       at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
                       at org.springframework.web.context.request.SessionScope.get(SessionScope.java:92)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:328)
                       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
                       at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33)
                       at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)
                       at $Proxy76.getPrimaryConnection(Unknown Source)
                       **...**
              I can see spring expression jar (3.1.x) in the jar list created by maven. I am not sure why it wont find the value yet.

              Note: As I was using guidelines in social page and hence havent configured any particualr SecurityContext or my authentication-manager yet.

              Is this the required missing piece?

              Comment


              • #8
                Added the Security xml with authentication manager but no change in result outcome. Same exception persists.

                Code:
                 SEVERE: Servlet.service() for servlet [SpringParentController] in context with path [/SpringFB] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 22): Field or property 'name' cannot be found on null] with root cause
                	org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 22): Field or property 'name' cannot be found on null
                	at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:205)
                	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72)
                	at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
                	at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
                	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
                	at org.springframework.context.expression.StandardBeanExpressionResolver.evaluate(StandardBeanExpressionResolver.java:139)
                	at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1299)
                	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:210)
                	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:182)
                	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:630)
                	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:441)
                	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
                	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
                	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
                	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                	at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:332)
                	at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
                	at org.springframework.web.context.request.SessionScope.get(SessionScope.java:92)
                	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:328)
                	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
                	at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33)
                	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)
                	at $Proxy107.getPrimaryConnection(Unknown Source)
                	at org.mydomain.social.controller.FacebookHomeController.home(FacebookHomeController.java:235)

                Comment


                • #9
                  Hi Habuma & vinaykchalse,

                  i am also facing the same issue that you have initiated in this trail. appreciate if you could help me out.
                  at deployment to jboss following error is thrown. i am using <spring.social.version>1.1.0.M4</spring.social.version>

                  my xml's are available in http://pastebin.com/uu9K2tJH.

                  i even tried <aop:scoped-proxy proxy-target-class="true" /> with clib , but no luck.


                  Caused by: org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'socialAuthenticationFilter' defined in ServletContext resource [/WEB-INF/spring/LBSWeb/security-config.xml]: Unsatisfied dependency expressed through constructor argument with index 2 of type [org.springframework.social.connect.UsersConnection Repository]: Could not convert constructor argume
                  nt value of type [com.sun.proxy.$Proxy198] to required type [org.springframework.social.connect.UsersConnection Repository]: Failed to convert value of type 'com.sun.proxy.$Proxy198 implementing org.springframework.social.connect.ConnectionRepos itory,java.io.Serializable,org.springframework.aop .scope.ScopedObject,org.springframework.aop.framew ork.AopInfrastructureBean,org.springframework.aop. Spring
                  Proxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.social.connect.UsersConnectio nRepository'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy198 implementing org.springframework.social.connect.ConnectionRepos itory,java.io.Serializable,org.springframework.aop .scope.ScopedObject,org.springframework.aop.framew
                  ork.AopInfrastructureBean,org.springframework.aop. SpringProxy,org.springframework.aop.framework.Advi sed] to required type [org.springframework.social.connect.UsersConnection Repository]: no matching editors or conversion strategy found
                  at org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:702)
                  at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:196)


                  Comment

                  Working...
                  X