Announcement Announcement Module
Collapse
No announcement yet.
Canvas Sample Not Working :( Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Canvas Sample Not Working :(

    After a while I begun my facebook game again, using 1.1.0.BUILD-SNAPSHOT. When I run my previously working code it did not work then noticed the changes. To learn what are the new features I downloaded the samples from github, changed the secretkey etc. and run the canvas sample but it did not work either

    here is a part of my nice exception:

    HTML Code:
    HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.facebook' defined in class path resource [org/springframework/social/canvas/config/SocialConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.social.facebook.api.Facebook org.springframework.social.canvas.config.SocialConfig.facebook()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.connectionRepository' defined in class path resource [org/springframework/social/canvas/config/SocialConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.social.connect.ConnectionRepository org.springframework.social.canvas.config.SocialConfig.connectionRepository()] threw exception; nested exception is java.lang.IllegalStateException: No user is currently signed in
    
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.facebook' defined in class path resource [org/springframework/social/canvas/config/SocialConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.social.facebook.api.Facebook org.springframework.social.canvas.config.SocialConfig.facebook()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.connectionRepository' defined in class path resource [org/springframework/social/canvas/config/SocialConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.social.connect.ConnectionRepository org.springframework.social.canvas.config.SocialConfig.connectionRepository()] threw exception; nested exception is java.lang.IllegalStateException: No user is currently signed in
    
    .......
    
    java.lang.IllegalStateException: No user is currently signed in
    	org.springframework.social.canvas.user.SecurityContext.getCurrentUser(SecurityContext.java:30)
    	org.springframework.social.canvas.config.SocialConfig.connectionRepository(SocialConfig.java:86)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61.CGLIB$connectionRepository$0(<generated>)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61$$FastClassByCGLIB$$9eeed16f.invoke(<generated>)
    	org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    	org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:286)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61.connectionRepository(<generated>)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:601)
    	org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)
    	org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    	org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:333)
    	org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    	org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:34)
    	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
    	com.sun.proxy.$Proxy14.getPrimaryConnection(Unknown Source)
    	org.springframework.social.canvas.config.SocialConfig.facebook(SocialConfig.java:97)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61.CGLIB$facebook$3(<generated>)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61$$FastClassByCGLIB$$9eeed16f.invoke(<generated>)
    	org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    	org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:286)
    	org.springframework.social.canvas.config.SocialConfig$$EnhancerByCGLIB$$f8bafb61.facebook(<generated>)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:601)
    	org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)
    	org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1025)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:921)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
    	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    	org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:333)
    	org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
    	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
    	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    	org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:34)
    	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184)
    	com.sun.proxy.$Proxy15.friendOperations(Unknown Source)
    	org.springframework.social.canvas.HomeController.homePage(HomeController.java:23)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	java.lang.reflect.Method.invoke(Method.java:601)
    	org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
    	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
    	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
    	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)


    Do I miss something or is it a bug?
    btw using tomcat 7.0.41

  • #2
    Even more interestingly when I type https://apps.facebook.com/myappname I get;
    HTML Code:
    HTTP Status 405 - Request method 'POST' not supported
    
    type Status report
    
    message Request method 'POST' not supported
    
    description The specified HTTP method is not allowed for the requested resource.
    Apache Tomcat/7.0.41
    when I change the controller to respon
    Code:
    @RequestMapping(value="/", method=RequestMethod.GET)
    to
    Code:
    @RequestMapping(value="/", method=RequestMethod.POST)
    I get the exception I mentioned in the previous post

    would really appreciate any help

    Comment


    • #3
      I'll definitely take a deeper look when I get a moment, but...

      I just ran the canvas sample locally and it worked perfectly. I'm not saying there's not a a bug. In fact, I'm already aware of one bug (https://jira.springsource.org/browse/SOCIALFB-128) that might be related to the problem you're having.

      That said, you are absolutely correct about the URLs being incorrect in the README. I'll be sure to fix those right away.

      Comment


      • #4
        What is the application context path? the root of my sample is http://localhost:8080/spring-social-canvas
        it is the only thing that comes to my mind

        Comment


        • #5
          Yes, that's the path. In fact, here's *exactly* how I have it configured in Facebook.

          Comment


          • #6
            I guess I find out the problem however can't decide whether it is a bug or not
            The problem is caused by the security exception of the clients (firefox, chrom etc). While running the sample I create my own private key and setup tomcat with it but for clients it is a security risk and it refuses the connection (I guess). When I add https://localhost:8443 to the trusted sites list on firefox it run the sample.
            However in my oppinion it should be handled either in CanvasSignInController or in UserInterceptor.
            Before M2 there was no such a problem I encountered with thus I have the feeling that the previous implementation was better

            Comment

            Working...
            X