1 Reply Latest reply on May 30, 2006 8:32 AM by Dirk Haase

    Is this a Java Or JBoss bug?

    Shai Bentin Newbie

      On EJbPostCreate I get an
      "IndexOutOfBoundsexception: Index: 0, Size: 0"

      The following is the complete EjbPostCreate method code that fails:

      public void ejbPostCreate(StatusLocal statusLocal, Long userId)
      throws javax.ejb.CreateException, ApplicationException {
       Iterator relations;
       relations = statusLocal.getReasons().iterator();
       while (relations.hasNext()) {
       ReasonLocal reasonLocal = (ReasonLocal) relations.next();
       ReasonLocalHome reasonLocalHome = (ReasonLocalHome) reasonLocal.getEJBLocalHome();
       this.getReasons().add(reasonLocalHome.create(reasonLocal, userId));

      The dump points to the second line:
      relations = statusLocal.getReasons().iterator();

      here is a part of the Dump:
      java.lang.IndexOutOfBoundsException: Index:0, Size:0
      at java.util.ArrayList.RangeCheck(ArrayList.java:546)
      at java.util.ArrayList.get(ArrayList.java:321)
      at com.emi.framework.bo.model.StatusBean.ejbPostCreate(StatusBean.java:120)

      This code was written a long time ago with JDK 1.4.2 and is now running under JDK1.5.0_06 on Solaris.