Two Laptop Bag
The moose likes Struts and the fly likes Exception creating bean of class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Exception creating bean of class" Watch "Exception creating bean of class" New topic

Exception creating bean of class

Rukmini Nagalla

Joined: Apr 29, 2005
Posts: 11
I am using tomcat 5.5. When I run a jsp page. I get an error saying:

javax.servlet.ServletException: Exception creating bean of class /WEB-INF/classes/LoginForm: {1}
Here is my struts-config.xml file:


<!-- Login form bean -->
<form-bean name="LoginBean" type="/WEB-INF/classes/LoginForm"/>
<form-bean name="RegistrationBean" type="/WEB-INF/classes/RegistrationForm" />
<!-- ************************************************ -->
<forward name="register" path="/Registration.jsp"/>
<!-- *********************************************** -->
<action path="/registration" type="/WEB-INF/classes/RegistrationAction" name="RegistrationBean" validate="false" scope="request" />
<action path="/login" type="/WEB-INF/classes/LoginAction" name="LoginBean" validate="false" scope="request">
<forward name="success" path="/mainpatient.jsp" />
<!-- *********************************************** -->
<message-resources parameter="ApplicationResources" null="false" />


Here is how I am calling action class in login.jsp:
<ht:form method="post" action="/login" focus="userName" >
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
the action type attribute should be the fully qualified class name (ie: java.lang.String) not it's location in your webapp structure.

in fact, that goes for all type attributes in your struts-config
Aman Verma

Joined: May 10, 2005
Posts: 15
u should write the form bean entry as,
<form-bean name="LoginBean" type="LoginForm"/> instead of
<form-bean name="LoginBean" type="/WEB-INF/classes/LoginForm"/>

I agree. Here's the link:
subject: Exception creating bean of class
It's not a secret anymore!