It's not a secret anymore!*
The moose likes Servlets and the fly likes Add Update problem in Hashtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Add Update problem in Hashtable" Watch "Add Update problem in Hashtable" New topic
Author

Add Update problem in Hashtable

sumit sharmast
Greenhorn

Joined: Jul 29, 2012
Posts: 15
Dear All,

I am getting the following error in the SERVLET CODE. Please help.

ERROR MESSAGE:

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.Error: Unresolved compilation problems:
The method addItem(String, LineItem) in the type Cart is not applicable for the arguments (LineItem)
The method removeItem(String, LineItem) in the type Cart is not applicable for the arguments (LineItem)

music.cart.DisplayCartServlet.doPost(DisplayCartServlet.java:87)
music.cart.DisplayCartServlet.doGet(DisplayCartServlet.java:114)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


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

Apache Tomcat/6.0.20
--------------------------------------------------------------------------------

LineItem.Java Code




Cart.Java Code


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

SERVLET CODE:


-----------------------------------------------------------------------------------


JDBC CODE:


sumit sharmast
Greenhorn

Joined: Jul 29, 2012
Posts: 15

Thank you sir for your suggestion.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

From your post:

root cause

java.lang.Error: Unresolved compilation problems:
The method addItem(String, LineItem) in the type Cart is not applicable for the arguments (LineItem)
The method removeItem(String, LineItem) in the type Cart is not applicable for the arguments (LineItem)

your Cart.java has addItem(String, LineItem) ,
but you try to inkove with single argument as addItem(t). it is same with removeItem.
sumit sharmast
Greenhorn

Joined: Jul 29, 2012
Posts: 15
Dear Mr. Seetharaman,

Thank you for your reply. What will be the correct argument inside the addItem method in the Servlet code, in place of addItem(t) ???

Can you correct it please. I would be very thankful.

Regards,

Sumit.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Add Update problem in Hashtable
 
Similar Threads
problem updating quantity field
Unable to import javabean class in servlet
Hashtable
static utility class from servlet
Connection Pooling - null pointer exception