• Post Reply Bookmark Topic Watch Topic
  • New Topic

why am i getting null pointer exception?

 
Saravanan. Shanmugam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a new servlet. when i tried to get ServletConfig using this.getServletConfig() or getServletConfig() i'm getting nullpointer exception.. Any idea on why am i getting this?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch
do you override init(config) ? <edit>and trying to access getInitParameter ?</edit> if yes, call super.init(config) as a first statement . else override init which dont have argument.

by the way : Carefully Choose One Forum
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved from MD forum.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
 
Somnath Mallick
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without your code its impossible to tell what's going wrong and where.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!