• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting NullPointerException on IsUserLoggedIn() Randomly

Community Beginner ,
Jan 13, 2014 Jan 13, 2014

Copy link to clipboard

Copied

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?

Views

581

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 13, 2014 Jan 13, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2014 Jan 13, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 13, 2014 Jan 13, 2014

Copy link to clipboard

Copied

LATEST

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation