0 Replies Latest reply on Aug 7, 2007 6:19 PM by Eric Ellis

    Session scope causes ArrayIndexOutOfBoundsException

    Eric Ellis Newbie

      Looks like a bug. I'm not a contributor or anything. Should this be added to JIRA?

      This error came up when I first viewed my home page (containing a bean using the @Scope(ScopeType.SESSION) annotation) using Firefox, then switched to a new session with Konqueror hitting the same page.


      12:47:17,285 INFO [Contexts] starting up: org.jboss.seam.security.identity
      12:47:17,287 INFO [Contexts] starting up: org.jboss.seam.web.session
      12:47:17,300 ERROR [[/]] Session event listener threw exception
      java.lang.ArrayIndexOutOfBoundsException: 149
      at org.jboss.seam.contexts.BasicContext.getNames(BasicContext.java:60)
      at org.jboss.seam.contexts.Contexts.startup(Contexts.java:270)
      at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:187)
      at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:127)
      at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:44)
      at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
      at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369)
      at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:827)
      at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291)
      at org.apache.catalina.connector.Request.doGetSession(Request.java:2295)
      at org.apache.catalina.connector.Request.getSession(Request.java:2066)
      at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
      at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
      at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:545)
      at com.sun.faces.context.SessionMap.getSession(ExternalContextImpl.java:1002)
      at com.sun.faces.context.SessionMap.get(ExternalContextImpl.java:962)
      at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:48)
      at org.jboss.seam.Component.getInstance(Component.java:1734)
      at org.jboss.seam.Component.getInstance(Component.java:1712)
      at org.jboss.seam.web.Session.getInstance(Session.java:122)
      at org.jboss.seam.contexts.FacesLifecycle.beginRequest(FacesLifecycle.java:53)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeRestoreView(SeamPhaseListener.java:361)
      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:139)
      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
      at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)
      at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)


      ----------------------------------------------------------

      The code says:

      public String[] getNames()

      {

      //yes, I know about the toArray() method,

      //but there is a bug in the RI!

      Set keySet = map.keySet();

      String[] array = new String[ keySet.size() ];

      int i=0;

      for (String key: keySet)

      {

      array[i++] = key;

      }

      return array;

      }

      -------------------------------

      Guess this bug in RI is causing a bug in Seam.


      By the way, this didn't seem to cause any problems in rendering the page.