Hi. I don't know if this is the appropriate place to post because I still consider this as a beginners question., but still the problem is
servlet related. I have two classes ("ChatServlet.class" and "SAXHelper.class") which reside in package called "wm.macijewski". The servlet application ("ChatServlet.class") basically attempts to connect to database and retrieve some values, "SAXHelper.class" is a class which uses SAX API to retrieve some values from .XML document (as you might guess, these values are necessary information to connect to database). I have compiled these files with the following compiler options: "javac -d . SAXHelper.java" and javac -cp "/home/okti/apache-tomcat-7.0.32/lib/servlet-api.jar":"/home/okti/workspace/ChatServlet/src/wm/macijewski/" ChatServlet.java.
Copied those two .class files into "/home/okti/apache-tomcat-7.0.32/webapps/ChatServlet/WEB-INF/classes/wm/macijewski/". My WEB.xml file looks like this:
When i try to execute the servlet, I get:
java.lang.NullPointerException
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:186)
wm.macijewski.ChatServlet.createUser(ChatServlet.java:104)
wm.macijewski.ChatServlet.doGet(ChatServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
I'm pretty sure the problem is, that server cannot initiate (or find) my class. But why? For me, it looks like I have placed them in correct directories, that is: /classes/wm/macijewski, and if the server fails to find my class, so which one? is it ChatServlet.class or SAXHelper.class? Also, I don't think the problem is within my code, because I have tried doing this with "normal" applications and it works fine.
Any Help is greatly appreciated!