[Opensource] problem with Expresso503 in Iplanet
Lirian Ostrovica
lirian.ostrovica at senecac.on.ca
Wed Apr 9 11:37:54 PDT 2003
I found it myself,
The problem is Iplanet not truly implementing the servlet specification.
Iplanet's implementation of servletRequest.setAttribute(key, value) throws NullPointerException when 'value' is null, while the
specification says :
"If the value passed in is null, the effect is the same as calling removeAttribute(java.lang.String). "
I fixed getErrorCollection() of ControllerRequest like :
public ErrorCollection getErrorCollection() throws ControllerException {
ErrorCollection ec = (ErrorCollection) getSession().getAttribute(Action.ERROR_KEY);
if (ec == null) {
ec = (ErrorCollection)getSession().getPersistentAttribute(Action.ERROR_KEY);
getSession().removePersistentAttribute(Action.ERROR_KEY);
if (ec != null) {
getSession().setAttribute(Action.ERROR_KEY,ec);
}
else {
getSession().removeAttribute(Action.ERROR_KEY);
}
}
}
Mike, if you consider this in the next release, Iplanet users (if any beside me) will be thankfull.
Lirian
> Hi,
>
> I have installed Expresso503 in Iplanet web server. (simply deployed expresso5-0-3-bin.war, with no changes on any config file)
> When I try to login, I get :
>
> ERROR [Thread-11] controller.Controller (Controller.java:1180) - Error in substate
> java.lang.NullPointerException
> at java.util.Hashtable.put(Hashtable.java:380)
> at com.iplanet.server.http.servlet.NSServletRequest.setAttribute(NSServletRequest.java:342)
> at com.jcorporate.expresso.core.controller.session.HTTPPersistentSession.setAttribute(HTTPPersistentSession.java:78)
> at com.jcorporate.expresso.core.controller.ControllerRequest.getErrorCollection(ControllerRequest.java:429)
> at com.jcorporate.expresso.services.controller.LoginController.runPromptLoginState(LoginController.java:945)
> and so on
>
> method getErrorCollection() of ControllerRequest looks like :
>
> public ErrorCollection getErrorCollection() throws ControllerException {
> ErrorCollection ec = (ErrorCollection) getSession().getAttribute(Action.ERROR_KEY);
> if (ec == null) {
> ec = (ErrorCollection)getSession().getPersistentAttribute(Action.ERROR_KEY);
> getSession().removePersistentAttribute(Action.ERROR_KEY);
> getSession().setAttribute(Action.ERROR_KEY,ec); // line 429
> }
> }
>
> It seams that in line 429 variable 'ec' comes as 'null' and this causes the NullPointerException.
>
> Does anyone has any clue on why this might happen ???
> really appreciate any help
>
> Lirian
>
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list