Link to home
Start Free TrialLog in
Avatar of ngujja
ngujja

asked on

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
ngujja
Avatar of ECollin
ECollin

Hi,

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 ?

Emmanuel
Avatar of ngujja

ASKER

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

ASKER

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
session.setAttribute(SESSION_USERID,userId)

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
ngujja
ASKER CERTIFIED SOLUTION
Avatar of OzzMod
OzzMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial