Java. Lang. illegalargumentexception: No bean specified

Source: Internet
Author: User

Use struts1, And the actionform class is as follows:

Private string menutype; private clientuser user;... corresponding get and set methods...

The action class is as follows:

Public actionforward execute (actionmapping mapping, actionform form, httpservletrequest request, httpservletresponse response) {system. out. println ("========= enter the userinfoaction class =========="); userinfoform = (userinfoform) form ;}

However, when submitting a form, you may encounter the following problems:

========= Enter the userinfoaction class ========== 17:24:46 Org. apache. catalina. core. serious standardwrappervalve invoke: servlet. service () for servlet action threw exception Java. lang. illegalargumentexception: No bean specified at Org. apache. commons. beanutils. propertyutilsbean. getpropertydescriptor (propertyutilsbean. java: 751) at Org. apache. commons. beanutils. beanutilsbean. setproperty (beanutilsbean. java: 937) at Org. apache. commons. beanutils. beanutilsbean. populate (beanutilsbean. java: 811) at Org. apache. commons. beanutils. beanutils. populate (beanutils. java: 298) at Org. apache. struts. util. requestutils. populate (requestutils. java: 493) at Org. apache. struts. action. requestprocessor. processpopulate (requestprocessor. java: 816) at Org. apache. struts. action. requestprocessor. process (requestprocessor. java: 203) at Org. apache. struts. action. actionservlet. process (actionservlet. java: 1196) at Org. apache. struts. action. actionservlet. dopost (actionservlet. java: 432) at javax. servlet. HTTP. httpservlet. service (httpservlet. java: 637) at javax. servlet. HTTP. httpservlet. service (httpservlet. java: 717) at Org. apache. catalina. core. applicationfilterchain. internaldofilter (applicationfilterchain. java: 290) at Org. apache. catalina. core. applicationfilterchain. dofilter (applicationfilterchain. java: 206) at com. udrm. BMS. struts. beans. setcharacterencodingfilter. dofilter (setcharacterencodingfilter. java: 54) at Org. apache. catalina. core. applicationfilterchain. internaldofilter (applicationfilterchain. java: 235) at Org. apache. catalina. core. applicationfilterchain. dofilter (applicationfilterchain. java: 206) at Org. apache. catalina. core. standardwrappervalve. invoke (standardwrappervalve. java: 233) at Org. apache. catalina. core. standardcontextvalve. invoke (standardcontextvalve. java: 191) at Org. apache. catalina. core. standardhostvalve. invoke (standardhostvalve. java: 128) at Org. apache. catalina. valves. errorreportvalve. invoke (errorreportvalve. java: 102) at Org. apache. catalina. core. standardenginevalve. invoke (standardenginevalve. java: 109) at Org. apache. catalina. connector. coyoteadapter. service (coyoteadapter. java: 286) at Org. apache. coyote. http11.http11processor. process (http11processor. java: 845) at Org. apache. coyote. http11.http11protocol $ http11connectionhandler. process (http11protocol. java: 583) at org.apache.tomcat.util.net. jioendpoint $ worker. run (jioendpoint. java: 447) at java. lang. thread. run (unknown source)

If I do not submit a form, there is no error. As long as the form is submitted, there is an error. Obviously, this is the execute method of the action class. debug debugging shows that an error is reported when userinfoform = (userinfoform) form gets the form value. I found some information on the Internet, saying that in actionform, as long as it is the property of a custom object, we need to initialize the new object. That is, change the actionform:

Private string menutype; [color = Red] [B] private clientuser user = new clientuser (); // The value must be "new". [/B] [/color]... corresponding get and set methods...

Solution !!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.