• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Null Pointer Exception in jsp

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I am getting NullPointerException when try to access Login.jsp

I had debug through the jsp and following line throwing the exception.



This error comes when I deployed the application on WAS 6.0, but it is running fine in WAS 5.0

What may be the problem?
[ March 14, 2007: Message edited by: Shashikant Dahatonde ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try printing your User-Agent header to make sure it isn't null.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With the code snippet that you have provided, seems that request.getHeader("User-Agent") is returned null.

Can you try logging or printing the value of request.getHeader("User-Agent")?

This should be checked with WAS 6.0 support(It is strange...)
 
Shashi Kant
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Thanks for replying.

I had tried printing the value of "request.getHeader("User-Agent")"

It prints "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"

So the returns True.

I also tried putting in try catch block. And here only i get the NullPointerException.

Please help soon
 
Sunil Vasudevan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you print your entire code? Have you set response = null anywhere by mistake?

If the same code is working in WAS 5.1 and not in WAS 6.0, then the best bet is to check with Websphere guys.

WAS 6.0 was notorious for bugs. Which version of WAS are you using. I mean the minor version (Example: 6.0.2.17 etc)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic