Weblogic Session Issue.

Posted on 2005-04-27
Last Modified: 2013-12-10
Hi All

I had developed the entire application on WSAD and deployed on WAS 5.0 successfully. I also migrated the application to Weblogic 8.1 succussfully.

In one of my property files (which the app picks up at the starting time) I have an option if the user can skip login. We did'nt have problem when skip login was true, now when we select it to be true, we get error. This is not happening in WAS however.

Now here's what's happening, when the root servlet loads it finds out that the skip login is false so it initializes a session for the user. All the user information is stored in a file called user.xml sitting under data path. Even if the skip login was true it initializes a session but without user information.

Iam getting the following error:
java.lang.IllegalArgumentException: Key for session.setAttribute() is null
           at weblogic.servlet.internal.session.SessionData.setAttribute(
this is the piece of code which throws the eror:
session.setAttribute(SESSION_USERID, userId);

SESSION_USERID is declared in a Java class as: public static final String SESSION_USERID = "userid";
userId is got from the user.xml file.

There is nothing wrong with the code, it's tried and tested one.
Is it a weblogic issue? Do I have to tweak anything in the dep descriptor files.

Thanks a bunch
Question by:ngujja
    LVL 10

    Expert Comment


    are you sure that this issue is located at this point in the application.
    Did you check the value of SESSION_USERID (logs) before the setattribute ?


    Author Comment

    No I have'nt checked this. It's my best guess. I will make sure about it.

    Author Comment

    Sorry I raised a false alarm. I found out the problem.
    In our previous release, we had:
    session.setAttribute(userId, SESSION_USERID) instead it's supposed to be

    We corrected that in the new release.

    Websphere was throwing an error about the Illegal value but was allowing to continue showing the login page. We did'nt test it on Weblogic then, now we found that Weblogic is'nt as forgiving. In our new release we corrected that error and WAS 5.0 and WLS 8.1 both dont throw any error and both work fine.

    I dont know if this question should be deleted, maybe this can be helpful to someone to find out how WLS and WAS can be inconsistent in error handling. Also I would like to get refund, I will post a message in this regard in the refund section of EE.

    Thanks ECollin

    Accepted Solution

    Closed, 500 points refunded.
    Community Support Moderator (Graveyard shift)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    -Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
    Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now