Originally Posted by
Pratyush
Go to line number 119 (as clearly mentioned in the stacktrace) of your servlet class named AddRewardsPages.java and check for the variable in that line which is used. That variable must be null. Try printing the variable and run the application again so as to see what it is returning.
Thanks.
I'll get right on it.
--- Update ---
Originally Posted by
carbLoading2012
Thanks.
I'll get right on it.
Wait, what exactly do you mean to print it?
Here is my code where this is happening
if (valid) {
Reward reward = new Reward(new Integer(pledgeAmount), rewardDescription, request.getSession(true).getAttribute("USER").toString());
Line 119. --> project.addReward(reward);
request.getSession(true).setAttribute("PROJECT", project);
pledgeAmount = "";
rewardDescription = "";
}
}
--- Update ---
Alright...
I received the error on a different part of the application...
ava.lang.NullPointerException
servlet.Projects.doGet(Projects.java:171)
servlet.Projects.doPost(Projects.java:201)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
servlet.AddReward.doPost(AddRewardsPages.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722
What do I do with this?
The same thing that was recommended in a previous thread.