You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jason H. Kim" <ja...@qett.com> on 2001/02/19 22:54:41 UTC
error creating ActionForm instance
Does anyone know when creation of ActionForm and Action instance fails??
I am running struts 1.0 on TOMCAT.
Thank you very much in advance. Following is the error log.
Loading application resources from resource
com.qett.time.ApplicationResources
Context log path="" :action: Initializing configuration from resource path
/WEB-INF/struts-config.xml
Context log path="" :action: Processing a GET for /login
Context log path="" :action: Setting locale 'en_US'
Context log path="" :action: Looking for ActionForm bean under attribute
'timeBean'
Context log path="" :action: Creating new ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Error creating ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Looking for Action instance for class
com.qett.time.servlet.AutoLoginAction
Context log path="" :action: Double checking for Action instance already
there
Context log path="" :action: Creating new Action instance
Context log path="" :action: Error creating Action instance for path
'/login', class name 'com.qett.time.servlet.AutoLoginAction'
Context log path="" :action: Processing a GET for /login
Context log path="" :action: Looking for ActionForm bean under attribute
'timeBean'
Context log path="" :action: Creating new ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Error creating ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Looking for Action instance for class
com.qett.time.servlet.AutoLoginAction
Context log path="" :action: Double checking for Action instance already
there
Context log path="" :action: Creating new Action instance
Context log path="" :action: Error creating Action instance for path
'/login', class name 'com.qett.time.servlet.AutoLoginAction'
Context log path="" :action: Processing a GET for /login
Context log path="" :action: Looking for ActionForm bean under attribute
'timeBean'
Context log path="" :action: Creating new ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Error creating ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Looking for Action instance for class
com.qett.time.servlet.AutoLoginAction
Context log path="" :action: Double checking for Action instance already
there
Context log path="" :action: Creating new Action instance
Context log path="" :action: Error creating Action instance for path
'/login', class name 'com.qett.time.servlet.AutoLoginAction'
Context log path="" :action: Processing a GET for /hour
Context log path="" :action: Looking for ActionForm bean under attribute
'timeBean'
Context log path="" :action: Creating new ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Error creating ActionForm instance of class
'com.qett.time.bean.TimeFormBean'
Context log path="" :action: Looking for Action instance for class
com.qett.time.servlet.HourInputAction
Context log path="" :action: Double checking for Action instance already
there
Context log path="" :action: Creating new Action instance
Context log path="" :action: Error creating Action instance for path
'/hour', class name 'com.qett.time.servlet.HourInputAction'
Thank you.
Jason H. Kim
Quatrix Emerging Technology Team
Phone: 314-993-5858 EXT: 137
RE: error creating ActionForm instance
Posted by "Jason H. Kim" <ja...@qett.com>.
I found out that I forgot to put log4j.jar file in lib folder, and after
putting it in, the problem went away.
There was no stacktrace about this exception anywhere - which made the
debugging rather time-consuming.
Thank you.
Jason H. Kim
Quatrix Emerging Technology Team
Phone: 314-993-5858 EXT: 137
-----Original Message-----
From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
Sent: Monday, February 19, 2001 4:59 PM
To: struts-user@jakarta.apache.org
Subject: Re: error creating ActionForm instance
"Jason H. Kim" wrote:
> Following is part of my formBean class:
>
> public class TimeFormBean extends ActionForm {
> private static final int MAX_SIZE = 50;
>
> protected long[] m_loIndexID;
/** ID of this index in the database. */
> protected String[] m_strIndexName; /** Full
name of this project, or Task
> according to flag set by m_boIsProject. */
>
> protected String[] m_strSundayHour; /** Hour
value put in for Sunday */
> protected String[] m_strMondayHour; /** Hour
value put in for Monday */
> protected String[] m_strTuesdayHour; /** Hour value put
in for Tuesday */
> protected String[] m_strWednesdayHour; /** Hour value put
in for Wednesday
> */
> protected String[] m_strThursdayHour; /** Hour value put
in for Thursday
> */
> protected String[] m_strFridayHour; /** Hour
value put in for Friday */
> protected String[] m_strStaurdayHour; /** Hour value put
in for Saturday
> */
>
> protected String[] m_strSundayComment; /** Comment put in
for Sunday */
> protected String[] m_strMondayComment; /** Comment put in
for Monday */
> protected String[] m_strTuesdayComment; /** Comment put in
for Tuesday */
> protected String[] m_strWednesdayComment; /** Comment put in
for Wednesday
> */
> protected String[] m_strThursdayComment; /** Comment put in
for Thursday */
> protected String[] m_strFridayComment; /** Comment put in
for Friday */
> protected String[] m_strStaurdayComment; /** Comment put in
for Saturday */
>
> protected Calendar m_oStartDay; /** Calendar object
representing Sunday */
> protected Calendar m_oEndDay; /** Calendar object
representing Saturday */
>
> protected boolean m_boIsProject; /** Set to true if this is
indexed by
> Project name. False if indexed by Task */
> protected boolean m_boSigned; /** True, if this
timesheet has been signed
> by this developer. Else otherwise.*/
> protected boolean m_boApproved; /** True, if this
timesheet has been
> signed by a manager. */
>
> static Category log4 =
Category.getInstance(TimeFormBean.class.getName());
>
> public TimeFormBean() {
> // I hate array
> super();
>
> m_loIndexID = new long[TimeFormBean.MAX_SIZE];
> m_strIndexName = new String[TimeFormBean.MAX_SIZE];
>
> m_strSundayHour = new String[TimeFormBean.MAX_SIZE];
> m_strMondayHour = new String[TimeFormBean.MAX_SIZE];
> m_strTuesdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strWednesdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strThursdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strFridayHour = new String[TimeFormBean.MAX_SIZE];
> m_strStaurdayHour = new String[TimeFormBean.MAX_SIZE];
>
> m_strSundayComment = new String[TimeFormBean.MAX_SIZE];
> m_strMondayComment = new String[TimeFormBean.MAX_SIZE];
> m_strTuesdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strWednesdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strThursdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strFridayComment = new String[TimeFormBean.MAX_SIZE];
> m_strStaurdayComment = new String[TimeFormBean.MAX_SIZE];
>
> m_oStartDay = null;
> m_oEndDay = null;
> m_boIsProject = true;
> m_boSigned = false;
> m_boApproved = false;
>
> PropertyConfigurator.configure(Global.LOG4J_PROPSFILE);
> }
>
> Thank you.
>
The only other thing I can think of is if the constructor throws an
exception of some sort -- but Tomcat should be
logging the stack trace if that happens. Is there any stack trace being
logged to the console window, or to a log
file?
>
> Jason H. Kim
Craig McClanahan
Re: error creating ActionForm instance
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Jason H. Kim" wrote:
> Following is part of my formBean class:
>
> public class TimeFormBean extends ActionForm {
> private static final int MAX_SIZE = 50;
>
> protected long[] m_loIndexID; /** ID of this index in the database. */
> protected String[] m_strIndexName; /** Full name of this project, or Task
> according to flag set by m_boIsProject. */
>
> protected String[] m_strSundayHour; /** Hour value put in for Sunday */
> protected String[] m_strMondayHour; /** Hour value put in for Monday */
> protected String[] m_strTuesdayHour; /** Hour value put in for Tuesday */
> protected String[] m_strWednesdayHour; /** Hour value put in for Wednesday
> */
> protected String[] m_strThursdayHour; /** Hour value put in for Thursday
> */
> protected String[] m_strFridayHour; /** Hour value put in for Friday */
> protected String[] m_strStaurdayHour; /** Hour value put in for Saturday
> */
>
> protected String[] m_strSundayComment; /** Comment put in for Sunday */
> protected String[] m_strMondayComment; /** Comment put in for Monday */
> protected String[] m_strTuesdayComment; /** Comment put in for Tuesday */
> protected String[] m_strWednesdayComment; /** Comment put in for Wednesday
> */
> protected String[] m_strThursdayComment; /** Comment put in for Thursday */
> protected String[] m_strFridayComment; /** Comment put in for Friday */
> protected String[] m_strStaurdayComment; /** Comment put in for Saturday */
>
> protected Calendar m_oStartDay; /** Calendar object representing Sunday */
> protected Calendar m_oEndDay; /** Calendar object representing Saturday */
>
> protected boolean m_boIsProject; /** Set to true if this is indexed by
> Project name. False if indexed by Task */
> protected boolean m_boSigned; /** True, if this timesheet has been signed
> by this developer. Else otherwise.*/
> protected boolean m_boApproved; /** True, if this timesheet has been
> signed by a manager. */
>
> static Category log4 = Category.getInstance(TimeFormBean.class.getName());
>
> public TimeFormBean() {
> // I hate array
> super();
>
> m_loIndexID = new long[TimeFormBean.MAX_SIZE];
> m_strIndexName = new String[TimeFormBean.MAX_SIZE];
>
> m_strSundayHour = new String[TimeFormBean.MAX_SIZE];
> m_strMondayHour = new String[TimeFormBean.MAX_SIZE];
> m_strTuesdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strWednesdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strThursdayHour = new String[TimeFormBean.MAX_SIZE];
> m_strFridayHour = new String[TimeFormBean.MAX_SIZE];
> m_strStaurdayHour = new String[TimeFormBean.MAX_SIZE];
>
> m_strSundayComment = new String[TimeFormBean.MAX_SIZE];
> m_strMondayComment = new String[TimeFormBean.MAX_SIZE];
> m_strTuesdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strWednesdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strThursdayComment = new String[TimeFormBean.MAX_SIZE];
> m_strFridayComment = new String[TimeFormBean.MAX_SIZE];
> m_strStaurdayComment = new String[TimeFormBean.MAX_SIZE];
>
> m_oStartDay = null;
> m_oEndDay = null;
> m_boIsProject = true;
> m_boSigned = false;
> m_boApproved = false;
>
> PropertyConfigurator.configure(Global.LOG4J_PROPSFILE);
> }
>
> Thank you.
>
The only other thing I can think of is if the constructor throws an
exception of some sort -- but Tomcat should be
logging the stack trace if that happens. Is there any stack trace being
logged to the console window, or to a log
file?
>
> Jason H. Kim
Craig McClanahan
RE: error creating ActionForm instance
Posted by "Jason H. Kim" <ja...@qett.com>.
Following is part of my formBean class:
public class TimeFormBean extends ActionForm {
private static final int MAX_SIZE = 50;
protected long[] m_loIndexID; /** ID of this index in the database. */
protected String[] m_strIndexName; /** Full name of this project, or Task
according to flag set by m_boIsProject. */
protected String[] m_strSundayHour; /** Hour value put in for Sunday */
protected String[] m_strMondayHour; /** Hour value put in for Monday */
protected String[] m_strTuesdayHour; /** Hour value put in for Tuesday */
protected String[] m_strWednesdayHour; /** Hour value put in for Wednesday
*/
protected String[] m_strThursdayHour; /** Hour value put in for Thursday
*/
protected String[] m_strFridayHour; /** Hour value put in for Friday */
protected String[] m_strStaurdayHour; /** Hour value put in for Saturday
*/
protected String[] m_strSundayComment; /** Comment put in for Sunday */
protected String[] m_strMondayComment; /** Comment put in for Monday */
protected String[] m_strTuesdayComment; /** Comment put in for Tuesday */
protected String[] m_strWednesdayComment; /** Comment put in for Wednesday
*/
protected String[] m_strThursdayComment; /** Comment put in for Thursday */
protected String[] m_strFridayComment; /** Comment put in for Friday */
protected String[] m_strStaurdayComment; /** Comment put in for Saturday */
protected Calendar m_oStartDay; /** Calendar object representing Sunday */
protected Calendar m_oEndDay; /** Calendar object representing Saturday */
protected boolean m_boIsProject; /** Set to true if this is indexed by
Project name. False if indexed by Task */
protected boolean m_boSigned; /** True, if this timesheet has been signed
by this developer. Else otherwise.*/
protected boolean m_boApproved; /** True, if this timesheet has been
signed by a manager. */
static Category log4 = Category.getInstance(TimeFormBean.class.getName());
public TimeFormBean() {
// I hate array
super();
m_loIndexID = new long[TimeFormBean.MAX_SIZE];
m_strIndexName = new String[TimeFormBean.MAX_SIZE];
m_strSundayHour = new String[TimeFormBean.MAX_SIZE];
m_strMondayHour = new String[TimeFormBean.MAX_SIZE];
m_strTuesdayHour = new String[TimeFormBean.MAX_SIZE];
m_strWednesdayHour = new String[TimeFormBean.MAX_SIZE];
m_strThursdayHour = new String[TimeFormBean.MAX_SIZE];
m_strFridayHour = new String[TimeFormBean.MAX_SIZE];
m_strStaurdayHour = new String[TimeFormBean.MAX_SIZE];
m_strSundayComment = new String[TimeFormBean.MAX_SIZE];
m_strMondayComment = new String[TimeFormBean.MAX_SIZE];
m_strTuesdayComment = new String[TimeFormBean.MAX_SIZE];
m_strWednesdayComment = new String[TimeFormBean.MAX_SIZE];
m_strThursdayComment = new String[TimeFormBean.MAX_SIZE];
m_strFridayComment = new String[TimeFormBean.MAX_SIZE];
m_strStaurdayComment = new String[TimeFormBean.MAX_SIZE];
m_oStartDay = null;
m_oEndDay = null;
m_boIsProject = true;
m_boSigned = false;
m_boApproved = false;
PropertyConfigurator.configure(Global.LOG4J_PROPSFILE);
}
Thank you.
Jason H. Kim
Quatrix Emerging Technology Team
Phone: 314-993-5858 EXT: 137
-----Original Message-----
From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
Sent: Monday, February 19, 2001 4:00 PM
To: struts-user@jakarta.apache.org
Subject: Re: error creating ActionForm instance
"Jason H. Kim" wrote:
> Does anyone know when creation of ActionForm and Action instance fails??
> I am running struts 1.0 on TOMCAT.
>
Are your classes public? Do they have a public no-arguments constructor?
Both of these rules are required in order for Struts to instantiate
instances
dynamically.
Craig McClanahan
Re: error creating ActionForm instance
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Jason H. Kim" wrote:
> Does anyone know when creation of ActionForm and Action instance fails??
> I am running struts 1.0 on TOMCAT.
>
Are your classes public? Do they have a public no-arguments constructor?
Both of these rules are required in order for Struts to instantiate instances
dynamically.
Craig McClanahan