Creator Team: bug?

Hi,

Ocassionally, I get this error:

Exception Details: java.lang.IndexOutOfBoundsException

Index: 0, Size: 0

Possible Source of Error:

Class Name: java.util.ArrayList

File Name: ArrayList.java

Method Name: RangeCheck

Line Number: 546

Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.

Stack Trace:

java.util.ArrayList.RangeCheck(ArrayList.java:546)

java.util.ArrayList.remove(ArrayList.java:389)

javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:271)

javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)

java.security.AccessController.doPrivileged(AccessController.java:-2)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)

org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)

org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)

java.security.AccessController.doPrivileged(AccessController.java:-2)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)

com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)

com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)

com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)

com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)

com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)

It should be noted that when I refresh the browser, that the application works well. I am running the app on Sun's App. Server.

Please advise

[4355 byte] By [nasheiaa] at [2007-11-26 15:39:18]
# 1
hellllllllllllllllllllllllllloooooooooooooooooooooooooooooooooooooo
nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 2
Hi!Are You sure that your ArrayList is not empty? Can you post here your code. It is hard to find possible problem without application.Thanks,Roman.
-Grif-a at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 3

Hi Roman,

Thanks for replying. For a moment there, I thought I was being blacklisted ;-}

In the application, I have a dddlist and a table. The values in the table are dependent on the ddlist value selected. In other words, if a user chooses ABC in the ddlist, the values in the table would be "A" ,"B" ,"C". However, if the user chooses DEF in the dropdown, then the values in the table would be "D","E","F"

It goes one step further...the selected value in the ddlist is coming from a previous page (passed thru the URL). However, the user can change the value, and the table is populated automatically. There is also a text box and a button if the user wants to search the existing options in the table.

Now for the code:

The pre-renderer method:

//pid: value from url

//SearchParam: value from textbox. It is set to % if user does not enter anything

if (pid != null && (SearchParam != null) ) {

//Sgroup_tblRowSet3: rowset that table is bound to

getSessionBean1().getSgroup_tblRowSet3().setObject(1, pid);

getSessionBean1().getSgroup_tblRowSet3().setObject(2,SearchParam);

getSessionBean1().getSgroup_tblRowSet3().setObject(3,SearchParam);

getSessionBean1().getSgroup_tblRowSet3().execute();

ddPG.setSelected(new Integer(pid));

}

getSgroup_tblDataProvider().refresh();

Any suggestions?

Thanks

nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 4
Hi!Are You sure that your ddlist had been initialized before You've tried to set selected it's item?Try to debug prerender() method and find out is your ddlist initialized?Thanks,Roman.
-Grif-a at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 5
I'm trying to do that now....What puzzles me though...is that it works well most of the time...only once in a while I get this error.
nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 6
I did debug the program, and yes, the list is initalized before the setSelected()
nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 7

Hi!

Why you perform getSessionBean1().getSgroup_tblRowSet3().execute();?

Why You don't use getSgroup_tblDataProvider().refresh();?

I can't understand where is problem, but try to call getSgroup_tblDataProvider().refresh(); instead of getSessionBean1().getSgroup_tblRowSet3().execute(); and only then call ddPG.setSelected(new Integer(pid));

Maybe something wrong with execution of RowSet.

Thanks,

Roman.

-Grif-a at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 8
I cannot use the getSgroup_tblDataProvider().refresh(); since at no point in time is the rowset executed.I need to execute it before I can refresh it. This is the rowset that populates the table.
nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 9

Hi!

I always do like this:

getSessionBean1().getMyRowSet().setObject(myIndex, myValue);

myDataProvider.refresh();

(myDataProvider is bound to myRowSet) and all works fine.

I'm not insist, I just try to figure out where is the problem. I thought maybe it is in execution of RowSet.

Thanks,

Roman.

-Grif-a at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 10

My main problem is that I don't know when the error will occur, so I don't know if it's fixed or not.

Another runtime error that I am sometimes getting is: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'consdb.tasu.tasu_menu'

Again, when I refresh the browser, all goes well. I am getting really frustrated with these runtime errors that happen whenever they want to.

nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 11
Hi!Try to deploy on another server (Tomcat for example). Maybe it's application server problem.Thanks,Roman.
-Grif-a at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...
# 12
I did deploy on Tomcat, thinking that it was server based error like u.Didn't see the "can't instantiate class error" as yet. However the error: "Index:0, Array:0" , I've seen
nasheiaa at 2007-7-8 21:57:39 > top of Java-index,Development Tools,Java Tools...