Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 still occurs #4260

Closed
ren-zhijun-oracle opened this issue Jul 12, 2017 · 23 comments
Closed
Assignees
Labels

Comments

@ren-zhijun-oracle
Copy link
Contributor

For a @ViewScoped page we are catching an exception in phase RESTORE_VIEW:
javax.faces.FacesException: Unexpected error restoring state for component with id gF:dgr_tabset:dgrStatus. Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.

The issue should have been fixed with #4011 in [2.1.29-05] which ports #3245 (JAVASERVERFACES-3241).

Our stacktrace looks very much the same as those mentioned in #3245: Stacktrace-ACME-2017-07-12.txt

The issue still occurs very often with [2.1.29-08] in our performance tests. And occasionally in production, in fact just a few minutes ago. Apparently the exception does not happen deterministically.

The cause is the following code in AttachedObjectListHolder.restoreState

        } else {
            // assume 1:1 relation between existing attachedObjects and state
            for (int i = 0, len = attachedObjects.length; i < len; i++) {
                T l = this.attachedObjects.get(i);
                if (l instanceof StateHolder) {
                    ((StateHolder) l).restoreState(context, attachedObjects[i]);
                }
            }
        }

this.attachedObjects is an empty list and thus throws the IndexOutOfBoundsException. This is the same code in all versions up to [2.3.2]. (Except for formatting of generics).

First of all I would like to point on the assumption that is documented in the comment. This assumption of an 1:1 relation is not fulfilled, so in my opinion the code should throw an IllegalStateException.

Neither could we find the root cause of the problem, nor do we have a simple test to reproduce the problem. Strong load seems to facilitate the problem.

@ren-zhijun-oracle
Copy link
Contributor Author

@skybber Commented
In my case the root cause of null value in attachedObjects is the previous save state of BeanValidator with initialStateMarked() == true - then null value is stored into attachedObjects.

@ren-zhijun-oracle
Copy link
Contributor Author

@xinyuan-zhang Commented
@skybber Could you please provide us a reproducer. Thanks.

@ren-zhijun-oracle
Copy link
Contributor Author

@skybber Commented
Unfortunatelly it happens on our large project (with big pages) and I have not enough time to make some deeper investigaton and to make smaler reproducible example now. But the couse of the problem is very clear as I've seen it when I've debugged the mojarra code.

@ren-zhijun-oracle
Copy link
Contributor Author

@BalusC Commented
This kind of exception can happen if UIComponent instances are shared across HTTP requests. This is explicitly discouraged in JSF spec section 3.1.5.

Most probably you're somewhere using <x:somecomponent binding="#{beanWhichIsNotRequestScoped.component}". This part has to be fixed.

Related reading: https://stackoverflow.com/q/14911158/157882

@ren-zhijun-oracle
Copy link
Contributor Author

@edburns Commented
Please see this important message regarding community contributions to
Mojarra.

https://javaee.groups.io/g/jsf-spec/message/30

Also, please consider joining that group, as that group has taken the
place of the old dev@javaserverfaces.java.net mailing list.

Thanks,

Ed Burns

@ren-zhijun-oracle
Copy link
Contributor Author

@arjantijms arjantijms self-assigned this Jul 28, 2019
@murathazer
Copy link

Hi, is there any progress or workaround for this issue? We bumped same exception under heavy server load and can't find a workaround.

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:657) at java.util.ArrayList.get(ArrayList.java:433) at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:146) at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1228) at com.sun.faces.application.view.FaceletPartialStateManagementStrategy$2.visit(FaceletPartialStateManagementStrategy.java:372) at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:127) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1456) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) at com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreView(FaceletPartialStateManagementStrategy.java:358) at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:113) at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:177) at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:99) at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:272) at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:133) at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:125) at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:81) at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) at org.omnifaces.viewhandler.RestorableViewHandler.restoreView(RestorableViewHandler.java:65) at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:125) at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:81) at org.springframework.faces.webflow.JsfViewFactory.getViewStateViewRoot(JsfViewFactory.java:131) at org.springframework.faces.webflow.JsfViewFactory.getViewRoot(JsfViewFactory.java:102) at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:86) at org.springframework.webflow.engine.ViewState.resume(ViewState.java:192) at org.springframework.webflow.engine.Flow.resume(Flow.java:537) at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259) at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:168) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:254) at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:55) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:141) at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:82) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

@sinhkej
Copy link

sinhkej commented Dec 30, 2021

We are using JSF 2.3 and Payara 5.2 also facing this issue.
In our system, this error occurs a lot.
It seems to reproduce the error when using a robot like Jmeter, Crawler to access the page(@ViewScoped page).
Is there any progress or workaround for this issue?

2021/12/14 15:25:38.923 ERROR - null
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657) ~[na:1.8.0_241]
at java.util.ArrayList.get(ArrayList.java:433) ~[na:1.8.0_241]
at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:146) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1228) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy$2.visit(FaceletPartialStateManagementStrategy.java:372) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:127) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1456) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIForm.visitTree(UIForm.java:355) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1468) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreView(FaceletPartialStateManagementStrategy.java:358) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:113) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:99) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:272) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:133) ~[jakarta.faces.jar:2.3.14.payara-p2]
at org.ocpsoft.rewrite.faces.RewriteViewHandler.restoreView(RewriteViewHandler.java:102) ~[rewrite-integration-faces-3.4.2.Final.jar:3.4.2.Final]
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) ~[jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) ~[jakarta.faces.jar:2.3.14.payara-p2]
at org.omnifaces.viewhandler.OmniViewHandler.restoreView(OmniViewHandler.java:106) ~[omnifaces-2.6.2.jar:2.6.2]
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:101) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:181) [jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76) ~[jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110) [jakarta.faces.jar:2.3.14.payara-p2]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177) [jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:707) [jakarta.faces.jar:2.3.14.payara-p2]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:451) [jakarta.faces.jar:2.3.14.payara-p2]
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1636) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:331) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100) [primefaces-6.0.jar:6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at com.c1s.common.filter.LoginFilter.doFilter(LoginFilter.java:280) [LoginFilter.class:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at com.c1s.common.filter.UrlHenkanFilter.doFilter(UrlHenkanFilter.java:605) [UrlHenkanFilter.class:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.4.2.Final.jar:3.4.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:816) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:527) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:497) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:379) [web-core.jar:na]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) [web-core.jar:na]
at org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler.handleResult(HttpRewriteResultHandler.java:42) [rewrite-servlet-3.4.2.Final.jar:3.4.2.Final]
at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:297) [rewrite-servlet-3.4.2.Final.jar:3.4.2.Final]
at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:198) [rewrite-servlet-3.4.2.Final.jar:3.4.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:253) [web-core.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:211) [web-core.jar:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) [web-core.jar:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [web-core.jar:na]
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757) [web-core.jar:na]
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577) [web-core.jar:na]
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) [web-glue.jar:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158) [web-core.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371) [web-core.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238) [web-core.jar:na]
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520) [kernel.jar:na]
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217) [kernel.jar:na]
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569) [nucleus-grizzly-all.jar:na]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549) [nucleus-grizzly-all.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_241]

@EugenFischer
Copy link

we have similar problem with jakarta.faces 2.3.15
but the main issue was usage of omifaces cache component where accidentally input field was used inside.
removing <o:cache> solve this IndexOutOfBoundsException in my case.

but may it's possible to adapt the code and provide some check instead run into IndexOutOfBoundsException ?

@murathazer
Copy link

@EugenFischer nice point, we also use omnifaces but not cache component only onloadScript component.

We use in our base template page like below;

<o:onloadScript>disableEnterForAllForms();pushUserInfo('#{visit.transInfo.username}')</o:onloadScript>

May be @BalusC can show us the right solution?

@sinhkej
Copy link

sinhkej commented Feb 7, 2022

@EugenFischer, @murathazer
We also use omnifaces but not cache component, only use <o:conditionalComment> and <o:importConstants> component
We don't think this issue is related to onifacses.

@mnriem
Copy link
Contributor

mnriem commented Feb 18, 2022

Relabeling as 2.3 as folks are saying it is an issue in 2.3 releases as well. Note that attaching a reproducer using only Mojarra will make it easier for the maintainers to address the issue.

@mnriem mnriem added 2.3 and removed pre-2.3 labels Feb 18, 2022
melloware added a commit to melloware/mojarra that referenced this issue May 24, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
melloware added a commit to melloware/mojarra that referenced this issue May 24, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
@melloware
Copy link
Contributor

Submitted PR. In the IF branch above it its checking if (this.attachedObjects != null) { but not in the else branch

@BalusC
Copy link
Contributor

BalusC commented May 29, 2022

@melloware : I'm not seeing how that fixes the issue. Probably you meant to check if (this.attachedObjects.length > 0) { or better if (this.attachedObjects.length == attachedObjects.length) {

A reproducer would still be useful so it could be covered in IT / TCK.

@melloware
Copy link
Contributor

You are right this only prevents possible NPE. I will update the PR

@BalusC
Copy link
Contributor

BalusC commented May 29, 2022

Scratch above commit, the ticket number was wrong, it's actually for #5072

melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
@melloware
Copy link
Contributor

OK I added && this.attachedObjects.length == attachedObjects.length to the if I still want to leave the NULL check in there though,

melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
melloware added a commit to melloware/mojarra that referenced this issue May 29, 2022
Signed-off-by: melloware <mellowaredev@gmail.com>
arjantijms added a commit that referenced this issue Jun 2, 2022
Fix #4260: AttachedObjectListHolder IndexOutOfBounds fix 4.0
arjantijms added a commit that referenced this issue Jun 2, 2022
Fix #4260: AttachedObjectListHolder IndexOutOfBounds fix 3.0
arjantijms added a commit that referenced this issue Jun 2, 2022
Fix #4260: AttachedObjectListHolder IndexOutOfBounds fix 2.3
@NicolaIsotta
Copy link
Contributor

NicolaIsotta commented Oct 18, 2022

3.0.2 is affected too. Can the fix be ported to 3.x?
NB: actually 3.* is missing all 2.3.18 fixes since the latest release, 3.0.2, is based on 2.3.17. Is there a reason? Is 3.* dead?

@melloware
Copy link
Contributor

3.0.2 is affected too. Can the fix be ported to 3.x? NB: actually 3.* is missing all 2.3.18 fixes since the latest release, 3.0.2, is based on 2.3.17. Is there a reason? Is 3.* dead?

It is fixed in 3.0 it just has not been released to Maven Central.

@arjantijms
Copy link
Contributor

I'll take a look at doing a 3.0 release later this week if there's demand. Until now 3.0.x has not been released as much since seemingly few people cared about it. All the requests were for 2.3.x and 4.x.

@BalusC
Copy link
Contributor

BalusC commented Oct 18, 2022

Arjan, it needed to be released nonetheless. I have been diligently upmerging all 2.x fixes into 3.x as well. We personally and on our private jobs indeed do not care about 3.x but there are definitely people out caring about this. Mojarra must be independent from our personal/professional preferences. As long as Jakarta EE 9 has not been marked EOL.

@mnriem
Copy link
Contributor

mnriem commented Oct 18, 2022

@BalusC Are you volunteering to do Mojarra releases? Arjan really is stretched too thin across all things Jakarta EE so I completely understand why he is opting to only do releases where there is a demand.

@BalusC
Copy link
Contributor

BalusC commented Oct 18, 2022

I've over the past year asked at least twice for the exact plan/process/automatability, yes. Until now it's not terribly clear to me.

I completely understand why he is opting to only do releases where there is a demand.

Me too but I do not agree this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants