• ExtLibUtil.getCurrentSessionAsSigner() is null on first access.

    By Christian Güdemann 1 decade ago

    Hello Together

    I have a strange issue. And its very simple to reproduce.

    I have a XPage and on this XPages is a computed Field. I acces for the value a bean called testBean.getState(). In this bean I access the ExtLibUtil.getCurrenSessionAsSigner(). Then I  test if this session is null and make some returns:

    Cocde Sample of the testBean:

        public String getState() {
            StringBuffer sbCurrent = new StringBuffer("State");
            try {
                Session sesSigner = ExtLibUtil.getCurrentSessionAsSigner();
                fillSessionData("Signer Session             - ", sesSigner, sbCurrent);
            } catch (Exception e) {
                e.printStackTrace();
            }
            return sbCurrent.toString();
        }

        public void fillSessionData(String strType, Session sesCurrent, StringBuffer sb) {
            try {
                if (sesCurrent != null) {
                    sb.append(strType + " EffektiveUser : " + sesCurrent.getEffectiveUserName() + "
    ");
                    sb.append(strType + " Notes Version : " + sesCurrent.getNotesVersion() + "
    ");
                    sb.append(strType + " Plattform     : " + sesCurrent.getPlatform() + "
    ");
                } else {
                    sb.append(strType + " is null!\n");
                }
                sb.append("
    ");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

     

    The strange thing is. Whenn I stop the http server, start the server and access directly the application with that page. The first access send a "Signer - Session is null" back. Secound Access, everything is fine.

    This case is only a case to reproduce the behaivor, but in the realworld (like the myWebGate Application API) is this a big problem, because we do many call with signer rights :)

     

    Any Ideas how to handle this?

    • Only when signed with the server id

      By Christian Güdemann 1 decade ago

      A restriction. This happens only when signed with the server id

      • Can you attach an NSF?

        By Philippe Riand 1 decade ago

        Looking at the code, it can be because the context is not yet initialized, or it cannot get the signer.

        We need to understand you exact configuration here, so a faulty NSF will  help a lot.

        • And here the sample database

          By Christian Güdemann 1 decade ago

          Hello

          Here is the sample.

          - copy on the server

          - sign with the server id

          - make a build clean on the client

          - stop http and start http

          - access the session.xsp page

          • Looking into it

            By Paul Hannan 1 decade ago
          • I've no been able to reproduce this with the sample in 9.0 Beta

            By Paul Hannan 1 decade ago

             

            • I will try it also

              By Christian Güdemann 1 decade ago

              Hello Paul

              I will try it also on our Domino 9 Beta Maschine. But to be shure:

              - you have signed with the server id

              - you have stopped the http task

              - you have done a "clean" on the project

              - you have startet den http task

              It only happens the first time