aspose file tools*
The moose likes Struts and the fly likes javax.servlet.ServletException: BeanUtils.populate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "javax.servlet.ServletException: BeanUtils.populate" Watch "javax.servlet.ServletException: BeanUtils.populate" New topic
Author

javax.servlet.ServletException: BeanUtils.populate

Reshmi Kuttappan
Greenhorn

Joined: May 26, 2009
Posts: 17
Hi,

i am getting "javax.servlet.ServletException: BeanUtils.populate" error when i click on the 'Back' button on my jsp page.

following is the complete error:


i did some Google on this exception; but all i could find was the that the property in my form should be an indexed property. But i am not getting as to what it means

my Java Form code looks like below:


my JSP code looks like below:


my JSP code treats the values as indexed values; however am still getting the error
require help urgently.
Reshmi Kuttappan
Greenhorn

Joined: May 26, 2009
Posts: 17
can anyone help me??
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

hi reshmi. I am also facing the same. But i get the error when i refresh the search results page. I am also googled a lot, but didn't get any idea. If you get any scope please share.


my error page looks like this



javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:497)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.scalar.UTF8Filter.doFilter(UTF8Filter.java:20)
com.scalar.doctrac.filters.SSAuditTrialFilter.doFilter(SSAuditTrialFilter.java:80)


root cause

java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
java.util.ArrayList.RangeCheck(Unknown Source)
java.util.ArrayList.get(Unknown Source)
org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:433)
org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:340)
org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:684)
org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:884)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.scalar.UTF8Filter.doFilter(UTF8Filter.java:20)
com.scalar.doctrac.filters.SSAuditTrialFilter.doFilter(SSAuditTrialFilter.java:80)
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Can you please post your formbean and struts-config.xml?


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

my form looks like this




and struts-config.xml like this



any scope???
thanks in advance.
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Are you using mRoleList in your jsp page?
If yes, in your formbean, the getter and setter methods for mRoleList must follow the Java Bean naming conventions (link) since the logic iterate tag will get the values from the proper getter methods.
Please change the method name and check if it is working.
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

It Works!!!

Thanks Mr.Sumit Patil. Great work man. Thanks a lot.
Reshmi Kuttappan
Greenhorn

Joined: May 26, 2009
Posts: 17
following is how my form bean looks like:



my struts-config.xml looks like:


i tried changing the scope to session; but still am facing the error in my <logic:iterate> tag
my JSP code is already posted.
please help me since am not able to get any breakthrough with this error
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

Hi reshmi please check your browser source to get what is the name of List . If it is 'accountList' please change your setter/getter method name setAccountLists() and getAccountLists().
[*please note the additional 's'.]
Do not change the object name, it remains accountList. please try it , hope you rock.
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

Hi reshmi, Sorry to say that my previous message was little wrong.

I had found a new method to solve your problem. please add following code to web.xml file to handle the http error.



then create a new jsp file named as error500.jsp under jsp folder. and add the following code to it


hope your problem will solve. Have a nice work.
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Praveen Thaliyil wrote:...... and add the following code to it


Can you please explain how is this helpful in the above scenario
Praveen Thaliyil
Greenhorn

Joined: May 17, 2012
Posts: 10

hi sumit, its actually an exception handling method which i refer from a pdf. It actually capturing the control when a http 500 error occurs, and then points to the jsp file. The jsp directs the control to the url from which the error happened. So it actually work like a refresh page. Hope you got the idea.

Take care.
Sebastian Plata
Greenhorn

Joined: Sep 27, 2012
Posts: 1
Hi Mr.Sumit Patil

I am facing a similar , but i am getting the error when i made a second submit on the page, i have been looking, but i got nothing, my error looks like this:

[9/27/12 12:30:12:168 EDT] 00000055 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet action in application cobroJuridicoEAR. Exception created : javax.servlet.ServletException: BeanUtils.populate
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:469)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at co.gov.fna.cj.usuario.web.action.LoginFilter.doFilter(LoginFilter.java:64)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:78)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
Caused by: java.lang.IndexOutOfBoundsException: Index: 8, Size: 0
at java.lang.Throwable.<init>(Throwable.java:67)
at java.util.ArrayList.get(ArrayList.java:349)
at org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:433)
at org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:340)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:684)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:884)
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:467)
... 33 more

[9/27/12 12:30:12:171 EDT] 00000055 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[action]: java.lang.IndexOutOfBoundsException: Index: 8, Size: 0
at java.lang.Throwable.<init>(Throwable.java:67)
at java.util.ArrayList.get(ArrayList.java:349)
at org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:433)
at org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:340)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:684)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:884)
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:467)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at co.gov.fna.cj.usuario.web.action.LoginFilter.doFilter(LoginFilter.java:64)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:78)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)


My struts file is:



my form looks like:




and my jsp its:




i will appreciatte your help
 
jQuery in Action, 2nd edition
 
subject: javax.servlet.ServletException: BeanUtils.populate