Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!

  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting InstantiationException  RSS feed

Lakshmi Geetha
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have written a simple bean and am trying to use it in a jsp page.
i am getting the following exception.
please help in finding out the problem.
500 Servlet Exception
java.lang.InstantiationException: `allbeans.MyBean' has no public zero-arg
at _test._myjsp__jsp._jspService(/test/MyJSP.jsp:14)
at com.caucho.jsp.JavaPage.service(
at com.caucho.jsp.Page.subservice(
at com.caucho.server.http.FilterChainPage.doFilter(
at com.caucho.server.http.Invocation.service(
at com.caucho.server.http.CacheInvocation.service(
at com.caucho.server.http.ServletServer.serviceTop(
at com.caucho.server.http.HttpRequest.handleRequest(
at com.caucho.server.http.HttpRequest.handleConnection(

Resin 2.0.5 (built Fri Jan 11 08:29:05 PST 2002)

In my jsp page
<jsp:useBean id="myBean" class="allbeans.MyBean" scope="request" />
my bean class
package allbeans;
public class MyBean implements Serializable
public MyBean()
_name = "geetha";
public String getName()
return _name;
public void setName(String name)
_name = name;
private String _name;

Tim Holloway
Posts: 18531
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well obviously it DOES have a zero-argument public constructor.
1. Does the source filename EXACTLY (including upper/lower case) match the class name? This SHOULDN'T cause that exception (there's a different exception reserved for that, but maybe it didn't catch it).
2. Have you placed the class in WEB-INF/classes/allbeans/MyBean.class?
3. If so, recompile, move the class file to that location, and restart the server.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!