nullpointerexception while calling servlets installed on tomcat


Web tier: servlets, JSP, Web frameworks: nullpointerexception while calling servlets installed on tomcat

  1. I am getting nullpointerexception while callinga servlet(which has a jdbc connection) installed on tomcat. but the servlet is working fine while i run it on jdeveloper. i think the problem is with jdbc connection.its not able to find out the driver(iam using a oracle thin driver).do i need to configure any file or edit any scripts?
  2. Hi !!

    Initialize all instance as well as local variables with some values(if u have default otherwise null).

    Try it.
  3. i think you may be right in regards to tomcat's inability to locate oracle's driver. try referencing the driver in your system classpath or put the file in the tomcat/lib directory.

    i was able to get a servlet to work using oracle as my DB for fun, but that was awhile back... if, after you put the driver in the classpath and it still doesn't work, let me know and i'll try to give you my example code and settings...

    good luck!
  4. Check up all your variables, which includes the resultset.Put a System.out.println( before and after the resultset before closing the resultset) , you can trap it.

    Good luck. I had the same problem and i found that it was because of the resultset.Good luck.