John Sisk wrote:

> Hi,
>
> This is the start of the stacktrace I get when I try the Tomcat (v
> 4.0-b-5)CookieExample servlet. Worked fine on Tomcat 3.2 win98/win2k, broke
> when I upgraded to 4.0. Has anyone else seen/fixed this before I start
> digging?
>
> A Servlet Exception Has Occurred
> java.lang.NullPointerException
>  at CookieExample.doGet(CookieExample.java:53)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>
> Regards
> John Sisk

Hi :-)  I am not sure, in  CookieExample.java from Tc4.0-b5:

         ...
        Cookie[] cookies = request.getCookies();   //line52
        if (cookies.length > 0) {                               //line53
         ...

so I think the reason  is:
 with some reason, "cookies" is null, so you got a NullPointerException.


Bo
may.19, 2001




Reply via email to