Rupesh Choubey wrote:
>
>
> Hi,
>
> I have a jsp page talking to a servlet running on weblogic which talks
> to another jsp. The second jsp has a useBean / getProperty tag which
> talks to a bean and gets some information.
>
> When I run this initially ( any number of times ) it works fine.
> However, if I leave it alone without touching anything and I try
> hitting the page again, it throws the following exception (and returns
> an internal server error 500 page).
>
> Fri Sep 03 13:49:31 EDT 1999:<E> <ServletContext-Servlets>
> java.lang.NullPointer
> Exception:
A null pointer exception means you tried to use an object reference that
was null. Without looking at the source code, it will be impossible to
give you any advice on what the problem is.
>
> at com.sapient.framework.app.usermaint.UserServlet.doGet
> UserServlet.java:29)
This is the place (line 29 of your servlet) that the error occurred --
examine the code there, and debug to determine which object reference
was null when you didn't expect it to be.
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:75)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:278)
> at
> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
> textImpl.java:230)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
> a:499)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:259)
> at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
> Fri Sep 03 13:49:33 EDT 1999:<I> <ServletContext-Servlets>
> weblogic.servlet.internal.InternalImageServlet: init
>
> One possible reason could be that the bean might have been
> passivated....but maybe its not even getting there since the servlet
> seems to die.......I have spent lots of time trying to figure this
> out......it works fine once i restart weblogic.....
Ordinary beans don't get passivated, unless your app server has special
support for this. If it does, then you might be better off asking for
help on the Weblogic support lists, because the circumstances will be
unique to that server.
Without seeing any code, this is just a guess - but it sounds like you
might be referencing variables in session scope, and the session timed
out. If that is true, the later request will be in a new session, and
there will not be any user variables stored there. It is up to you to
program defensively to deal with this situation by checking the
references you get back from session.getValue().
MyObject object = session.getValue("myKey");
if (object != null) {
; // Use it normally
} else {
; // Either some servlet removed this object
; // from the session, or the session timed
; // out and this is a new one. Deal with it
; // as appropriate for your application.
}
>
>
> Thanks in advance for your help.
>
> Rupesh.
Craig McClanahan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html