I have been working on a project for 6 months using net beans ide in order to develop an elearning web application.Everything worked fine inside net beans.(The project was from existing sources and i had to modify it,i didnt develop the entire application)I was using apache tomcat 7 in net beans.When i created the war file and deployed it nothing worked.I am getting null pointer exceptions in my session variables like i never give them a value.I am not able to understand what's the problem.Inside net beans i am using the same tomcat.
org.apache.jasper.JasperException: An exception occurred processing JSP page /System.jsp at line 31
28: Integer intObj = new Integer(project_id);
29: httpsession.setAttribute("project_id",intObj);
30: Hashtable projects=(Hashtable)session.getAttribute("projectsprofessor");
31: if((Integer)session.getAttribute("professor")<=1 &&
32: projects.get(project_id)==null)
33: {
34: request.getSession().setAttribute("errorMessage","This project belongs to another professor!");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException
org.apache.jsp.System_jsp._jspService(System_jsp.java:149)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
This happens to the most of my pages.The strange is that some session variables are not null. I cannot understand where to focus!
thank you.
//Edit:Solved!The problem was that In the sources i got they have forgot *.class files in WEB-INF folder so when i clean-and-build in NetBeans the new classes didn't compile and net beans used the previous sources from the WEB-INF folder.When i deleted manually all the .class files from WEB-INF/Classes in the next clean-build used the new files