Could u specify this more? Where is the error in my application? I attached a tiny piece of sample code in my mail (if you scroll down). We (two guys) are looking to find this error for over 6 hours now.
Thanks a lot! -- Fehlerfreie Software wirkt weniger komplex und diskreditiert damit den Entwickler! ----- Original Message ----- From: "James Mitchell" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Thursday, December 19, 2002 5:49 PM Subject: RE: beanutils populate problem with formbeans and vectors Es kommt von Ihrer eigenen Anwendung! -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup > -----Original Message----- > From: Michael Olszynski [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 19, 2002 11:38 AM > To: Struts Users Mailing List > Subject: Re: beanutils populate problem with formbeans and vectors > > > Does anybody have an idea, where this exception is from. I�m > still working on it...... > > Thaks a lot, Michael > -- > Fehlerfreie Software wirkt weniger komplex und diskreditiert > damit den Entwickler! > ----- Original Message ----- > From: "Michael Olszynski" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, December 19, 2002 11:48 AM > Subject: Re: beanutils populate problem with formbeans and vectors > > > > Hi Richard, > > > > thanks for your help. I tried what u wrote me, but it > didn�t work. I > > get following exception: > > > > > > 11:36:32,775 ERROR [Engine] > > ApplicationDispatcher[/Zeiterfassung_Applikation] Se > > rvlet.service() for servlet jsp threw exception > > org.apache.jasper.JasperException > > at > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper > > .java:248) > > at > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 > > 89) > > at > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp > > atcher.java:684) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD > > ispatcher.java:575) > > at > > > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis > > patcher.java:498) > > at > > > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary > > .java:820) > > at > > > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jav > > a:395) > > at > > org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:191) > > at > > > org.apache.jsp.template_jsp._jspx_meth_template_get_4(template_jsp.ja > > va:221) > > at > > > org.apache.jsp.template_jsp._jspx_meth_html_html_0(template_jsp.java: > > 118) > > at > org.apache.jsp.template_jsp._jspService(template_jsp.java:62) > > at > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper > > .java:204) > > at > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 > > 89) > > at > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp > > atcher.java:684) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD > > ispatcher.java:575) > > at > > > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis > > patcher.java:498) > > at > > > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary > > .java:820) > > at > > > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jav > > a:395) > > at > > > org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:1 > > 55) > > at > > > org.apache.jsp.index_jsp._jspx_meth_template_insert_0(index_jsp.java: > > 108) > > at org.apache.jsp.index_jsp._jspService(index_jsp.java:71) > > at > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper > > .java:204) > > at > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2 > > 89) > > at > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) > > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp > > atcher.java:684) > > > > > ************************************************************** > ************** > > ** > > > > Here ist the Code I wrote: > > > > FormBean: > > > > public class TimeProofFormBean extends ActionForm { > > > > > > public FormBeanVector getTimeProofList() { > > return this.timeProofList; > > } > > > > public void setTimeProofList( Vector v ) { > > this.timeProofList = new FormBeanVector ( > TimeProofTableBean.class, > > v); > > } > > > > public FormBeanVector getDayBeanList() { > > return this.dayBeanList; > > } > > > > public void setDayBeanList( Vector v ) { > > this.dayBeanList = new FormBeanVector(DayBean.class,v); > > } > > > > private FormBeanVector timeProofList = new > > FormBeanVector(TimeProofTableBean.class); > > private FormBeanVector dayBeanList = new > FormBeanVector(DayBean.class); > > > > } > > > ************************************************************** > ************* > > My own vector: > > > > public class FormBeanVector extends Vector { > > > > // Empty constructor, just to set the type of class > > public FormBeanVector( Class _contentClass ) { > > if( _contentClass == null ) { > > System.out.println("this.contentClass = Object.class"); > > this.contentClass = Object.class; > > } > > else { > > System.out.println("this.contentClass = " + > > _contentClass.getName()); > > this.contentClass = _contentClass; > > > > } > > } > > > > // Constructor for the java.util.vector type > > public FormBeanVector( Class _contentClass, java.util.Vector > > vector ) > { > > // Call my own constructor > > this( _contentClass ); > > this.addAll( vector ); > > System.out.println("konstruktor mit vectoerchen"); > > } > > > > public Object get( int index ) { > > System.out.println("public Object get( int index ): "+index); > > if( index >= this.size() ) { > > try { > > return contentClass.newInstance(); > > } > > catch( Exception x ) { > > x.printStackTrace(); > > } > > } > > return this.get( index ); > > } > > > > > > public Object set( int index, Object value ) { > > System.out.println("public Object set( int index, > Object value ): > > "+index); > > int size = this.size(); > > if( index >= size ) { > > // Be sure to have enough elements in the vector > > for( int i = size; i <= index; i++ ) { > > try { > > this.add( contentClass.newInstance() ); > > } > > catch( Exception x ) { > > x.printStackTrace(); > > } > > } > > } > > // Call set from java.util.vector to set the element > > return super.set( index, value ); > > } > > > > private Class contentClass; > > } > > > > ******************************************************************** > > an example jsp code: > > <logic:iterate id="dayBeanList" indexId="listIdx" > name="timeProofForm" > prope > > rty="dayBeanList"> > > <td align="center" bgcolor="#8DBBE6"> > > <a class="<bean:write name="dayBeanList" > > property="cssClass"/>" href="projekterfassung.do?day=<bean:write > > name="dayBeanList" property="parameter"/>"> > > <bean:write name="dayBeanList" property="date"/></a> > > </td> > > </logic:iterate> > > > > > > can you find the error I get? > > > > > > Thanks Michael > > -- > > Fehlerfreie Software wirkt weniger komplex und > diskreditiert damit den > > Entwickler! > > ----- Original Message ----- > > From: "Yee, Richard K,,DMDCWEST" <[EMAIL PROTECTED]> > > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> > > Sent: Wednesday, December 18, 2002 7:38 PM > > Subject: RE: beanutils populate problem with formbeans and vectors > > > > > > Michael, > > The problem is that the get method is being called when your > > Collection is empty. This is causing the ArrayIndexOutOfBounds > > exception that you are seeing. What I have done to prevent this > > problem is to code my > getXXXXX(int > > index) and setXXXX(int index, Object obj) methods like this: > > > > public Object getMyVector(int index) { > > if (index >= myVector.size()) > > return ""; > > return myVector.get(index); > > } > > > > public void setMyVector(int index, Object value) { > > int size=myVector.size(); > > if (index >= size) { > > for(int i=size; i<=index; i++) { > > myVector.add(""); > > } > > } > > myVector.set(index,value); > > } > > > > For the get method, I just return an empty string if the index is > > bigger than the current size of the vector. For the set method, I > > increase the > size > > of the vector up to the index if the current size is smaller, > > otherwise I just set the value that the index points to. This > > alleviates the need to pre-fill the Vector in the constructor. > > > > This solution also works with indexed properties in an html > form too. > > > > Regards, > > > > Richard > > > > > > > -----Original Message----- > > > From: Michael Olszynski [SMTP:[EMAIL PROTECTED]] > > > Sent: Wednesday, December 18, 2002 9:08 AM > > > To: 'Struts Users Mailing List' > > > Subject: beanutils populate problem with formbeans and vectors > > > > > > Hi, > > > > > > I�ve always get an Exception, when I try to change my > scope in the > > > struts-config.xml from "session" to "request". I think > the problem > > > is that I have a getter and setter for a vector in > my > > > formbean. > > > Everything works well with the scope "session". My > formbean is also > > > working if i completly remove the getter/setter vector out of my > > > bean > and > > > my jsp�s. > > > But I�d like to use a bean in a scope session with a > getter/setter > > > for vectors. Anybody has a clue about this problem. I read some > > > things in > the > > > mailarchive, but that didn�t help me. > > > > > > This is the error: > > > javax.servlet.ServletException: BeanUtils.populate > > > at > > > > org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980) > > > at > > > > org.apache.struts.action.RequestProcessor.processPopulate(Requ > estProcessor > > > .java:779) > > > at > > > > org.apache.struts.action.RequestProcessor.process(RequestProce > ssor.java:24 > > > 6) > > > at > > > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:12 > > > 92) > > > at > > > > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt > er(Applicati > > > onFilterChain.java:247) > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli > cationFilter > > > Chain.java:193) > > > at > > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW > rapperValve. > > > java:260) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardContextValve.invoke(StandardC > ontextValve. > > > java:191) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.valves.CertificatesValve.invoke(Certificat > esValve.java > > > :246) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardContext.invoke(StandardContex > t.java:2396) > > > at > > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHost > Valve.java:1 > > > 80) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi > spatcherValv > > > e.java:170) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport > Valve.java:1 > > > 72) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValv > e.java:469) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn > gineValve.ja > > > va:174) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.connector.http.HttpProcessor.process(HttpP > rocessor.jav > > > a:1040) > > > at > > > > org.apache.catalina.connector.http.HttpProcessor.run(HttpProce > ssor.java:11 > > > 51) > > > at java.lang.Thread.run(Thread.java:536) > > > > > > root cause > > > > > > java.lang.ArrayIndexOutOfBoundsException: Array index out > of range: > > > 0 at java.util.Vector.get(Vector.java:713) > > > at > > > > org.apache.commons.beanutils.PropertyUtils.getIndexedProperty( > PropertyUtil > > > s.java:503) > > > at > > > > org.apache.commons.beanutils.PropertyUtils.getIndexedProperty( > PropertyUtil > > > s.java:410) > > > at > > > > org.apache.commons.beanutils.PropertyUtils.getNestedProperty(P > ropertyUtils > > > .java:749) > > > at > > > > org.apache.commons.beanutils.PropertyUtils.getProperty(Propert > yUtils.java: > > > 780) > > > at > > > > org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:79 > > > 3) > > > at > > > > org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726) > > > at > > > > org.apache.struts.util.RequestUtils.populate(RequestUtils.java:978) > > > at > > > > org.apache.struts.action.RequestProcessor.processPopulate(Requ > estProcessor > > > .java:779) > > > at > > > > org.apache.struts.action.RequestProcessor.process(RequestProce > ssor.java:24 > > > 6) > > > at > > > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:12 > > > 92) > > > at > > > > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt > er(Applicati > > > onFilterChain.java:247) > > > at > > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli > cationFilter > > > Chain.java:193) > > > at > > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW > rapperValve. > > > java:260) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardContextValve.invoke(StandardC > ontextValve. > > > java:191) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.valves.CertificatesValve.invoke(Certificat > esValve.java > > > :246) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardContext.invoke(StandardContex > t.java:2396) > > > at > > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHost > Valve.java:1 > > > 80) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi > spatcherValv > > > e.java:170) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport > Valve.java:1 > > > 72) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValv > e.java:469) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:641) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn > gineValve.ja > > > va:174) > > > at > > > > org.apache.catalina.core.StandardPipeline$StandardPipelineValv > eContext.inv > > > okeNext(StandardPipeline.java:643) > > > at > > > > org.apache.catalina.core.StandardPipeline.invoke(StandardPipel > ine.java:480 > > > ) > > > at > > > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995 > > > ) > > > at > > > > org.apache.catalina.connector.http.HttpProcessor.process(HttpP > rocessor.jav > > > a:1040) > > > at > > > > org.apache.catalina.connector.http.HttpProcessor.run(HttpProce > ssor.java:11 > > > 51) > > > at java.lang.Thread.run(Thread.java:536) > > > > > > Thanks Michael > > > -- > > > Fehlerfreie Software wirkt weniger komplex und > diskreditiert damit > > > den Entwickler! > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > > > > -- > To unsubscribe, e-mail: > <mailto:struts-user-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

