This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add Update problem in Hashtable