3 Replies Latest reply on Jan 13, 2014 1:33 PM by vishu#13

    Getting NullPointerException on IsUserLoggedIn() Randomly

    Trojan84 Level 1

      java.lang.NullPointerException at java.util.Hashtable.put(Unknown Source) at coldfusion.runtime.SecurityScopeTracker.setSecurity(SecurityScopeTracker.java:235) at coldfusion.runtime.SecurityScopeTracker.getSecurity(SecurityScopeTracker.java:124) at coldfusion.runtime.SecurityScopeTracker.getSecurityTableFromSession(SecurityScopeTracker. java:349) at coldfusion.security.UserUtils.getAuthMap(UserUtils.java:164) at coldfusion.security.UserUtils.cflogin_GetAuthUser(UserUtils.java:146) at coldfusion.security.UserUtils.getAuthUser(UserUtils.java:37) at coldfusion.runtime.CFPage.GetAuthUser(CFPage.java:1053) at coldfusion.runtime.CFPage.IsUserLoggedIn(CFPage.java:1011) at

       

      I get random errors saying isuserloggedin null as you can see?

       

      what is causing this i didn't know that could be null? is it like a bug? i have used this code for about 3 years now and only since we move dup to coldfusion 10 have i seen this but all it does is this

       

      <cfif IsUserLoggedIn()>

      <cfelse>

          <cflocation url="login.cfm" addtoken="false">

      </cfif>

       

      Help Please?

        • 1. Re: Getting NullPointerException on IsUserLoggedIn() Randomly
          vishu#13 Level 3

          I've seen this issue once in forums :http://forums.adobe.com/thread/1222540 though it is unanswered

           

          Seems like you have not done major changes except the CF upgrade and started facing this issue. Can you verify "Maintain Connections is checked or not"? Also, you used to check this option in earlier CF version or not?

           

          Thanks
          VJ

          • 2. Re: Getting NullPointerException on IsUserLoggedIn() Randomly
            Trojan84 Level 1

            yea i see that thread well i check maintain connections and its check same as before. Probably stuipd question but what would a datasource connections have to do with isuserloggedin() since that is a built in coldfusion function? or is there another maintain connections option.

            • 3. Re: Getting NullPointerException on IsUserLoggedIn() Randomly
              vishu#13 Level 3

              I am sorry for the same, I thought of it as another scenario No there no another maintain connections option.

               

              Is the scenario is something like this ?

               

              The user requests index.cfm for the first time  >    User gets assigned a new session (say session A)  >> User is not logged in so the login form is shown

               

              or

               

              The user (userA) logged in and a session (sessionA) is tied to this user A and  user opens a new browser session and requests index.cfm

               

              Can you try to remove all extra code from within the cflogin tag and use it outside the cflogin tag as such:

               

              </CFLOGIN>

              <CFIF NOT StructKeyExists( session,"surveyname") AND IsUserLoggedIn() >

                     .. move all the stuff that was in the cflogin for login successful here ...

              </CFIF>