• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.servlet.ServletException: Cannot create bean of class...

 
anand chawla
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Guys
I m working on Tomcat server 3.2.3
I have my jsp files stored at following path:-
C:\jakarta-tomcat-3.2.3\webapps\examples\jsp\anand
and my beans are stored at following path
C:\jakarta-tomcat-3.2.3\webapps\examples\WEB-INF\classes\projsp
when i run the file i get the error
ServletException: Cannot create bean of class...
why does this happen
my jsp file is as follows
<html>
<title>Browse the Catalog</title>
<body>
<%@ page language="java" import="projsp.*" %>
<jsp:useBean id="Item" class="projsp.Item" />
<table>
<tr>
<td>Item Description<td>Price<td>Quantity in Hand
</tr>
<%

Vector items=Item.getItems();
out.print(items);

%>
<tr>
<td><input type=submit value="Add Selected items">
</tr>
</form>
</table>
</body>
</html>

why is this happening
please help
its so confusing
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problably some error in your bean. Remember that a bean must have an empty constructor(i.e- you can�t create a constructor that receives parameters for your bean).
 
anand chawla
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Pls help me out with this proble,..
Ther is nothing wrong with my bean or class.
pls anyone out ther...why do we get this error
all you jave gurus where are u...i m stuck.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you include more of the error message? There may be a hint there.
 
anand chawla
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this is the error i am getting please help...........
javax.servlet.ServletException: Cannot create bean of class Item
at jsp.anand._0002fjsp_0002fanand_0002fdispord_0002ejspdispord_jsp_15._jspService(_0002fjsp_0002fanand_0002fdispord_0002ejspdispord_jsp_15.java:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic