Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null Pointer Exception in jsp

 
Shashi Kant
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try printing your User-Agent header to make sure it isn't null.
 
Sunil Vasudevan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic