• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 761
  • Last Modified:

Weblogic Session Issue.

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
  • 2
1 Solution

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 ?

ngujjaAuthor Commented:
No I have'nt checked this. It's my best guess. I will make sure about it.
ngujjaAuthor Commented:
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
Closed, 500 points refunded.
Community Support Moderator (Graveyard shift)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now