• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add Update problem in Hashtable

 
sumit sharmast
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you sir for your suggestion.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic