0 Replies Latest reply on Nov 11, 2010 7:13 AM by sadique arslan

    How to integrate open id in seam application {openid.id} Target Unreachable identifier openid resolved to null

    sadique arslan Newbie
      I am trying to add open id functionality in my seam application for this i have created a page and write the following code. But when i execute my application it is failed to create openid object and generates following error .

      I have included my code snippet . please suggest me what configurations is needed to add openid4java library.

      17:24:03,544 WARNING [lifecycle] javax.el.PropertyNotFoundException: /login.xhtml @49,92 value="#{openid.id}": Target Unreachable, identifier 'openid' resolved to null
      javax.faces.FacesException: javax.el.PropertyNotFoundException: /login.xhtml @49,92 value="#{openid.id}": Target Unreachable, identifier 'openid' resolved to null
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:714)
              at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
              at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
              at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
              at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:720)
              at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:242)
              at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.el.PropertyNotFoundException: /login.xhtml @49,92 value="#{openid.id}": Target Unreachable, identifier 'openid' resolved to null
              at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)
              at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:92)
              at javax.faces.component.UIInput.getConvertedValue(UIInput.java:942)
              at javax.faces.component.UIInput.validate(UIInput.java:868)
              at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
              at javax.faces.component.UIInput.processValidators(UIInput.java:672)
              at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
              at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
              at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:711)
              ... 58 more
      17:24:03,546 SEVERE [lifecycle] JSF1054: (Phase ID: PROCESS_VALIDATIONS 3, View ID: /login.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1f33238]


      snippet from xhtml file is

      <s:decorate id="FOpenId" template="layout/edit.xhtml">
                                  <ui:define name="label">User :</ui:define> 
                                  <h:inputText id="txtOpenid" value="#{openIdMaster.newOpenId}" size="20" >
                                  <a:support event="onblur" reRender="FOpenId" bypassUpdates="true" ajaxSingle="true"/>
                                  </h:inputText>
                         </s:decorate>
                         <br/>
                          <div class="buttonBox">
                                  <h:commandButton id="submit" value="Add" action="#{openIdMaster.add}"/>
               </div>   

      snippet from bean is

      import java.io.IOException;
      import org.jboss.seam.annotations.*;
      import org.jboss.seam.security.openid.OpenId;
      import org.jboss.seam.security.openid.*;
      import javax.persistence.EntityManager;
      import javax.persistence.Query;
      import static org.jboss.seam.international.StatusMessage.Severity.INFO;
      import static org.jboss.seam.international.StatusMessage.Severity.ERROR;
      import java.util.List;

      @Name("openIdMaster")
      //@Install(precedence = Install.BUILT_IN, classDependencies = "org.openid4java.consumer.ConsumerManager")
      public class OpenIdMaster
      {

          private String newOpenId;
          @In private EntityManager entityManager;
          @In (create=true) private OpenId op;
         
          public void setNewOpenId(String s)
          {
              this.newOpenId = s;
          }
          public String getNewOpenId()
          {
              return this.newOpenId;
          }
         
          public String add() throws IOException
          {
             op.setId(newOpenId);
             op.login();
             return "success";
          }