Uploaded image for project: 'Agorava'
  1. Agorava
  2. AGOVA-33

NPE when no OAuthSession producer is found

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.6.1
    • Component/s: Core CDI impl
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Add to a class in your app and add the following method:

         @SessionScoped
         @Produces
         @LinkedIn
         @Current
         public OAuthSession produceOauthSession(@LinkedIn @Default OAuthSession session)
         {
            return session;
         }
      

      Show
      Add to a class in your app and add the following method: @SessionScoped @Produces @LinkedIn @Current public OAuthSession produceOauthSession(@LinkedIn @Default OAuthSession session) { return session; }

      Description

      If you omit the steps declared in "Produce a scoped OAuthSession" in http://agorava.org/doc/getting-started/ , the following exception is thrown:

      Caused by: java.lang.NullPointerException
      	at org.agorava.core.cdi.OAuthServiceImpl.getSession(OAuthServiceImpl.java:227) [agorava-core-impl-cdi-0.6.0.jar:]
      	at org.agorava.core.cdi.OAuthServiceImpl.isConnected(OAuthServiceImpl.java:207) [agorava-core-impl-cdi-0.6.0.jar:]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_39]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_39]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_39]
      	at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_39]
      	at javax.el.BeanELResolver.getValue(BeanELResolver.java:302) [jboss-el-api_2.2_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
      	at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1]
      	at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1]
      	at org.apache.el.parser.AstValue.getValue(AstValue.java:166) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      	at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-1.1.13.Final-redhat-1.jar:1.1.13.Final-redhat-1]
      	at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.1.19-redhat-1.jar:2.1.19-redhat-1]
      	... 33 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  antoinesabot-durand Antoine Sabot-Durand
                  Reporter:
                  gastaldi George Gastaldi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: