Weblogic Session Issue.

Posted on 2005-04-27
Medium Priority
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(SessionData.java:504)
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
  • 2
LVL 10

Expert Comment

ID: 13884809

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

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

Author Comment

ID: 13886420
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

OzzMod earned 0 total points
ID: 13908156
Closed, 500 points refunded.
Community Support Moderator (Graveyard shift)

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview

839 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