You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brad Plies <br...@bulliondirect.com> on 2003/05/09 21:17:04 UTC

[New] Dyna*Form problems: NoSuchMethodERROR??

Having problems with DynaActionForm & DynaValidatorForm.  I cannot
get them to function at all.  Any of my pages that uses a Dyna*Form will
not load and will throw an ERROR.

Before answering with /WEB-INF/lib know that I have completely
reinstalled Tomcat to make sure my /commons/lib is clean and
have all the necessary JARs are located appropriately.

Here is a stack trace, notice it is a 'NoSuchMethodError'
and not a 'NoSuchMethodException' (which also exists in the package) nor
a 'ClassNotFoundException', that it occurs well within the API (the TagLib),
and the extra junk in the exception message 
"(Lorg/apache/struts/action/DynaActionFormClass;)V"

java.lang.NoSuchMethodError: 
org.apache.struts.action.DynaActionForm.setDynaActionFormClass(Lorg/apache/struts/action/DynaActionFormClass;)V
         at 
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormClass.java:240)
         at 
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:733)
         at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:594)
         at 
org.apache.jsp.chooseShipping_jsp._jspx_meth_html_form_0(chooseShipping_jsp.java:867)
         at 
org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:346)
         at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...

as well as in the webapp log:
...
----- Root Cause -----
javax.servlet.ServletException: Exception creating bean of class 
org.apache.struts.validator.DynaValidatorForm: {1}
         at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:530)
         at 
org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:357)
         at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...

The part that makes me mentally ill is that the struts-example.war which also
uses DynaValidatorForm for /logon works just fine.  So I spent a whole day
comparing the various configs side by side and cannot see any notable 
difference.
Observe below.

<!-- My FormBean -->
<form-bean
   name="shippingSelectionForm"
   type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="shippingMethod" type="java.lang.Integer" />
</form-bean>

<!-- Struts-Example FormBean -->
<form-bean
   name="logonForm"
   type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="username" type="java.lang.String"/>
   <form-property name="password" type="java.lang.String"/>
</form-bean>

<!-- My Action -->
<action
   path="/sales/shipping"
   type="myapp.SelectShippingAction"
   name="shippingSelectionForm"
   input="/sales/chooseShipping.do"
   scope="session">
     <forward name="success" path="/sales/confirm.do" />
     <forward name="failure" path=".error" />
</action>

<!-- Struts-Example Action -->
<action
   path="/logon"
   type="org.apache.struts.webapp.example.LogonAction"
   name="logonForm"
   scope="session"
   input="logon">
</action>

<!-- My JSP - Javascript removed for debugging -->
<html:form action="/sales/shipping" >
<table width="430" border="0" cellpadding="2" cellspacing="0">
   <tr>
      <td align="left" colspan="1" class="head">
           Shipping Method
      </td>
   </tr>
   <tr>
      <td align="left" width="430" class="body">
      <html:radio property="shippingMethod" value='1'/> Option1
      <html:radio property="shippingMethod" value='2'/> Option2
      <html:radio property="shippingMethod" value='3'/> Option3
      </td>
   </tr>
</table>
       <p>
       <table width="430" border="0">
         <tr>
           <td align="right">
           <html:submit value=" Continue " />
           </td>
         </tr>
       </table>
</html:form>


<!-- Struts-Example JSP -->
<html:form action="/logon" focus="username"
          onsubmit="return validateLogonForm(this);">
<table border="0" width="100%">
   <tr>
     <th align="right">
       <bean:message key="prompt.username"/>:
     </th>
     <td align="left">
       <html:text property="username" size="16" maxlength="18"/>
     </td>
   </tr>
   <tr>
     <th align="right">
       <bean:message key="prompt.password" bundle="alternate"/>:
     </th>
     <td align="left">
       <html:password property="password" size="16" maxlength="18"
                     redisplay="false"/>
     </td>
   </tr>
   <tr>
     <td align="right">
       <html:submit value="Submit"/>
     </td>
     <td align="left">
       <html:reset/>
     </td>
   </tr>
</table>
</html:form>

To make sure I was on equal footing to the Struts-Example, I copied all of 
their JARs & taglibs over mine (commons, validator, struts) but
it still didn't work.   I even tried the latest releases and nightly builds 
of these components... same thing.  And yes, I made sure
I didn't have duplicates with different filenames.  I also tried replacing 
my html:radio elements with just an html:text, but
that didn't work either.  No archive anywhere, google search, or the like 
shows anyone ever having this same problem.

I'm at my wits end on this one.  I just don't understand why everyone else 
has such an easy time with
DynaForms.  Somebody please help.  Should this be sent to struts-dev? 

RE: [New] Dyna*Form problems: NoSuchMethodERROR??

Posted by Brian Briggman <b....@attbi.com>.
The setDynaActionFormClass() method is new as of Struts 1.1 - you probably
have an old struts.jar file somewhere in your CLASSPATH, leading to the
"java.lang.NoSuchMethodError"...

HTH,
Brian

-----Original Message-----
From: Brad Plies [mailto:bradley.plies@bulliondirect.com]
Sent: Friday, May 09, 2003 2:17 PM
To: struts-user@jakarta.apache.org
Subject: [New] Dyna*Form problems: NoSuchMethodERROR??


Having problems with DynaActionForm & DynaValidatorForm.  I cannot
get them to function at all.  Any of my pages that uses a Dyna*Form will
not load and will throw an ERROR.

Before answering with /WEB-INF/lib know that I have completely
reinstalled Tomcat to make sure my /commons/lib is clean and
have all the necessary JARs are located appropriately.

Here is a stack trace, notice it is a 'NoSuchMethodError'
and not a 'NoSuchMethodException' (which also exists in the package) nor
a 'ClassNotFoundException', that it occurs well within the API (the TagLib),
and the extra junk in the exception message
"(Lorg/apache/struts/action/DynaActionFormClass;)V"

java.lang.NoSuchMethodError:
org.apache.struts.action.DynaActionForm.setDynaActionFormClass(Lorg/apache/s
truts/action/DynaActionFormClass;)V
         at
org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionFormClass
.java:240)
         at
org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:733)
         at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:594)
         at
org.apache.jsp.chooseShipping_jsp._jspx_meth_html_form_0(chooseShipping_jsp.
java:867)
         at
org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:346)
         at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...

as well as in the webapp log:
...
----- Root Cause -----
javax.servlet.ServletException: Exception creating bean of class
org.apache.struts.validator.DynaValidatorForm: {1}
         at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:530)
         at
org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:357)
         at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...

The part that makes me mentally ill is that the struts-example.war which
also
uses DynaValidatorForm for /logon works just fine.  So I spent a whole day
comparing the various configs side by side and cannot see any notable
difference.
Observe below.

<!-- My FormBean -->
<form-bean
   name="shippingSelectionForm"
   type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="shippingMethod" type="java.lang.Integer" />
</form-bean>

<!-- Struts-Example FormBean -->
<form-bean
   name="logonForm"
   type="org.apache.struts.validator.DynaValidatorForm">
   <form-property name="username" type="java.lang.String"/>
   <form-property name="password" type="java.lang.String"/>
</form-bean>

<!-- My Action -->
<action
   path="/sales/shipping"
   type="myapp.SelectShippingAction"
   name="shippingSelectionForm"
   input="/sales/chooseShipping.do"
   scope="session">
     <forward name="success" path="/sales/confirm.do" />
     <forward name="failure" path=".error" />
</action>

<!-- Struts-Example Action -->
<action
   path="/logon"
   type="org.apache.struts.webapp.example.LogonAction"
   name="logonForm"
   scope="session"
   input="logon">
</action>

<!-- My JSP - Javascript removed for debugging -->
<html:form action="/sales/shipping" >
<table width="430" border="0" cellpadding="2" cellspacing="0">
   <tr>
      <td align="left" colspan="1" class="head">
           Shipping Method
      </td>
   </tr>
   <tr>
      <td align="left" width="430" class="body">
      <html:radio property="shippingMethod" value='1'/> Option1
      <html:radio property="shippingMethod" value='2'/> Option2
      <html:radio property="shippingMethod" value='3'/> Option3
      </td>
   </tr>
</table>
       <p>
       <table width="430" border="0">
         <tr>
           <td align="right">
           <html:submit value=" Continue " />
           </td>
         </tr>
       </table>
</html:form>


<!-- Struts-Example JSP -->
<html:form action="/logon" focus="username"
          onsubmit="return validateLogonForm(this);">
<table border="0" width="100%">
   <tr>
     <th align="right">
       <bean:message key="prompt.username"/>:
     </th>
     <td align="left">
       <html:text property="username" size="16" maxlength="18"/>
     </td>
   </tr>
   <tr>
     <th align="right">
       <bean:message key="prompt.password" bundle="alternate"/>:
     </th>
     <td align="left">
       <html:password property="password" size="16" maxlength="18"
                     redisplay="false"/>
     </td>
   </tr>
   <tr>
     <td align="right">
       <html:submit value="Submit"/>
     </td>
     <td align="left">
       <html:reset/>
     </td>
   </tr>
</table>
</html:form>

To make sure I was on equal footing to the Struts-Example, I copied all of
their JARs & taglibs over mine (commons, validator, struts) but
it still didn't work.   I even tried the latest releases and nightly builds
of these components... same thing.  And yes, I made sure
I didn't have duplicates with different filenames.  I also tried replacing
my html:radio elements with just an html:text, but
that didn't work either.  No archive anywhere, google search, or the like
shows anyone ever having this same problem.

I'm at my wits end on this one.  I just don't understand why everyone else
has such an easy time with
DynaForms.  Somebody please help.  Should this be sent to struts-dev?


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [New] Dyna*Form problems: NoSuchMethodERROR??

Posted by Jeff Kyser <kt...@comcast.net>.
Brad,

With DynaForms, I pretty much stick exclusively to java.lang.String,
letting BeanUtils.copyProperties handle conversions to other types.

Have you  tried it with a String instead of the Integer you have?

just curious,

-jeff

On Friday, May 9, 2003, at 02:17  PM, Brad Plies wrote:

> Having problems with DynaActionForm & DynaValidatorForm.  I cannot
> get them to function at all.  Any of my pages that uses a Dyna*Form  
> will
> not load and will throw an ERROR.
>
> Before answering with /WEB-INF/lib know that I have completely
> reinstalled Tomcat to make sure my /commons/lib is clean and
> have all the necessary JARs are located appropriately.
>
> Here is a stack trace, notice it is a 'NoSuchMethodError'
> and not a 'NoSuchMethodException' (which also exists in the package)  
> nor
> a 'ClassNotFoundException', that it occurs well within the API (the  
> TagLib),
> and the extra junk in the exception message  
> "(Lorg/apache/struts/action/DynaActionFormClass;)V"
>
> java.lang.NoSuchMethodError:  
> org.apache.struts.action.DynaActionForm.setDynaActionFormClass(Lorg/ 
> apache/struts/action/DynaActionFormClass;)V
>         at  
> org.apache.struts.action.DynaActionFormClass.newInstance(DynaActionForm 
> Class.java:240)
>         at  
> org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java: 
> 733)
>         at  
> org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:594)
>         at  
> org.apache.jsp.chooseShipping_jsp._jspx_meth_html_form_0(chooseShipping 
> _jsp.java:867)
>         at  
> org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:3 
> 46)
>         at  
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...
>
> as well as in the webapp log:
> ...
> ----- Root Cause -----
> javax.servlet.ServletException: Exception creating bean of class  
> org.apache.struts.validator.DynaValidatorForm: {1}
>         at  
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte 
> xtImpl.java:530)
>         at  
> org.apache.jsp.chooseShipping_jsp._jspService(chooseShipping_jsp.java:3 
> 57)
>         at  
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)...
>
> The part that makes me mentally ill is that the struts-example.war  
> which also
> uses DynaValidatorForm for /logon works just fine.  So I spent a whole  
> day
> comparing the various configs side by side and cannot see any notable  
> difference.
> Observe below.
>
> <!-- My FormBean -->
> <form-bean
>   name="shippingSelectionForm"
>   type="org.apache.struts.validator.DynaValidatorForm">
>   <form-property name="shippingMethod" type="java.lang.Integer" />
> </form-bean>
>
> <!-- Struts-Example FormBean -->
> <form-bean
>   name="logonForm"
>   type="org.apache.struts.validator.DynaValidatorForm">
>   <form-property name="username" type="java.lang.String"/>
>   <form-property name="password" type="java.lang.String"/>
> </form-bean>
>
> <!-- My Action -->
> <action
>   path="/sales/shipping"
>   type="myapp.SelectShippingAction"
>   name="shippingSelectionForm"
>   input="/sales/chooseShipping.do"
>   scope="session">
>     <forward name="success" path="/sales/confirm.do" />
>     <forward name="failure" path=".error" />
> </action>
>
> <!-- Struts-Example Action -->
> <action
>   path="/logon"
>   type="org.apache.struts.webapp.example.LogonAction"
>   name="logonForm"
>   scope="session"
>   input="logon">
> </action>
>
> <!-- My JSP - Javascript removed for debugging -->
> <html:form action="/sales/shipping" >
> <table width="430" border="0" cellpadding="2" cellspacing="0">
>   <tr>
>      <td align="left" colspan="1" class="head">
>           Shipping Method
>      </td>
>   </tr>
>   <tr>
>      <td align="left" width="430" class="body">
>      <html:radio property="shippingMethod" value='1'/> Option1
>      <html:radio property="shippingMethod" value='2'/> Option2
>      <html:radio property="shippingMethod" value='3'/> Option3
>      </td>
>   </tr>
> </table>
>       <p>
>       <table width="430" border="0">
>         <tr>
>           <td align="right">
>           <html:submit value=" Continue " />
>           </td>
>         </tr>
>       </table>
> </html:form>
>
>
> <!-- Struts-Example JSP -->
> <html:form action="/logon" focus="username"
>          onsubmit="return validateLogonForm(this);">
> <table border="0" width="100%">
>   <tr>
>     <th align="right">
>       <bean:message key="prompt.username"/>:
>     </th>
>     <td align="left">
>       <html:text property="username" size="16" maxlength="18"/>
>     </td>
>   </tr>
>   <tr>
>     <th align="right">
>       <bean:message key="prompt.password" bundle="alternate"/>:
>     </th>
>     <td align="left">
>       <html:password property="password" size="16" maxlength="18"
>                     redisplay="false"/>
>     </td>
>   </tr>
>   <tr>
>     <td align="right">
>       <html:submit value="Submit"/>
>     </td>
>     <td align="left">
>       <html:reset/>
>     </td>
>   </tr>
> </table>
> </html:form>
>
> To make sure I was on equal footing to the Struts-Example, I copied  
> all of their JARs & taglibs over mine (commons, validator, struts) but
> it still didn't work.   I even tried the latest releases and nightly  
> builds of these components... same thing.  And yes, I made sure
> I didn't have duplicates with different filenames.  I also tried  
> replacing my html:radio elements with just an html:text, but
> that didn't work either.  No archive anywhere, google search, or the  
> like shows anyone ever having this same problem.
>
> I'm at my wits end on this one.  I just don't understand why everyone  
> else has such an easy time with
> DynaForms.  Somebody please help.  Should this be sent to struts-dev? 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org