wood burning stoves 2.0*
The moose likes Servlets and the fly likes javax.servlet.ServletException:  Cannot create bean of class... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "javax.servlet.ServletException:  Cannot create bean of class... " Watch "javax.servlet.ServletException:  Cannot create bean of class... " New topic
Author

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

anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
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

Joined: Jan 06, 2001
Posts: 977
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

Joined: Oct 19, 2000
Posts: 91
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

Joined: Jun 25, 2001
Posts: 15959
    
  19

Could you include more of the error message? There may be a hint there.


Customer surveys are for companies who didn't pay proper attention to begin with.
anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91

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)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: javax.servlet.ServletException: Cannot create bean of class...
 
Similar Threads
javax.servlet.jsp. JspException: Cannot find message resources under key
Tiles, putList and tiles-defs.xml
calling javabean from jsp
Error in deploying struts: Attribute name invalid according to the specified TLD
Urgent, please help