File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes prb from Hemant Deshmukh... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "prb from Hemant Deshmukh... " Watch "prb from Hemant Deshmukh... " New topic
Author

prb from Hemant Deshmukh...

Akshatha Nayak
Ranch Hand

Joined: Jul 15, 2004
Posts: 53
hi guys
i got this program from hemant deshmukh / chapter 04
it has 2 servlets LoginServlet & AccountServlet .. html request file Login.html & web .xml

here is LoginServlet




AccountServlet





Login.html





web.xml




and here is the error - 500


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
AccountServlet.doPost(AccountServlet.java:30)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
LoginServlet.doPost(LoginServlet.java:28)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note The full stack trace of the root cause is available in the Tomcat logs.


i dont know what the prb is ... can anybody pls help me ?

Thankx in advance


Only those who will risk going too far, Can possibly find out how far one can go! <br />happiness is journey and not destination<br /> <br />A Nayak<br />----------------------------------<br />SCJP 1.4<br />SCWCD 1.3<br />SCBCD 1.3
Akshatha Nayak
Ranch Hand

Joined: Jul 15, 2004
Posts: 53
in AccountServlet

in init() method .. its changed to
public void init(){
data.put("ann",new String[]{"1/2/04:1000.00","3/3/04: 6000.00","4/4/04: 30000.00"});
data.put("john",new String[]{"1/2/04:100.00","3/3/04: 9000.00","4/4/04: 4000.00"});
data.put("mary",new String[]{"1/2/04:100.00","3/3/04: 6000.00","4/4/04: 7000.00"});
}

even then i'm getting the same prb ..error 500
Jayanthi Mani
Greenhorn

Joined: Dec 08, 2000
Posts: 25
Hi,
I think I remember this error... I think in "AccountServlet.java" - just try changing
String[] records=(String[]) data.get("userid");
to
String[] records=(String[]) data.get(userid);

ie. no quotes around "userid"
There should be errata posted for Deshmukh book too. Just search the web.

Thanks,
Jayanthi.
Akshatha Nayak
Ranch Hand

Joined: Jul 15, 2004
Posts: 53
Thankx alot Jayanthi... it worked ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: prb from Hemant Deshmukh...
 
Similar Threads
Session Invalidate
Code Review - ChatServlet
servlet not being called from html
HTTP Status 404 - /ch1/Serv1/
Servlet is not running