开发者

Java exception problem

开发者 https://www.devze.com 2023-01-11 10:31 出处:网络
I got this exception in time of running a 开发者_如何转开发web application in java. What does this mean?

I got this exception in time of running a 开发者_如何转开发web application in java. What does this mean?

exception.name = javax.servlet.ServletException: BeanUtils.populate


I guess you are using something which utilizes Jakarta BeanUtils (like Struts) and some method is throwing an exception.

Following may be reasons for same :

  1. The action attribute of an tag must match exactly the path attribute of the action definition in the struts-config.xml file. This is how Struts associates the ActionForm bean with the action.
  2. This error usually occurs when you have specified a form name that does not exist in your tag. For example, you specifiec and 'myForm' is not the name of a form associated with myAction in the struts-config file
  3. You get this message when Struts is unable to map the data in the HTML form to the properties in your ActionForm bean. Make sure each of the properties on your bean is either a String or a boolean. Do you have any properties of type java.util.Date or other objects? That might cause this error. Also check to see that you have public getters and setter for each of your properties.

Check:

http://www.coderanch.com/t/53114/Struts/ServletException-BeanUtils-populate

http://forums.sun.com/thread.jspa?threadID=632599

http://javaexceptions1.blogspot.com/2009/08/javaxservletservletexception.html


A short call to google's famous www-indexer (with:"ServletException: BeanUtils.populate") provided this result:

ServletException BeanUtils populate

The answer to that question over there at coderanch could help to solve your problem


Since this is a Struts related exception (and seeing that we don't know the cause of the exception), here are some possible reasons why you're getting the exception.

  • No Bean Specified. This means that there is no ActionForm defined in your Action.
  • Your bean properties you're copying from doesn't match the bean properties you're matching to.

Unless we know the cause of the exception, you'll just have to debug your code and see what is the fault.

0

精彩评论

暂无评论...
验证码 换一张
取 消