6 Replies Latest reply on Dec 12, 2005 3:05 PM by Nat Gross

    Can't deploy new cmp entity: ArrayIndexOutOfBoundsException

    Nat Gross Newbie

      I hope that this is simple but I have checked and re-checked.... searched and researched... and have no clue as to what the problem is.
      Jboss 4.0.3SP1 on Linux.
      I added 1 entity cmp 2 ejb to an existing [working ok] deployment and am getting an ambiguous error message upon deployment.
      The name of the new ejb is Logtrk2.
      Note: At this stage it is not even being called by any other class. I simply wanted to see it deploy and catch any simple errors first.

      ...
      15:22:04,048 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'PhraseRelations' to jndi 'PhraseRelations'
      15:22:04,238 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'PhraseMainText' to jndi 'PhraseMainText'
      15:22:04,331 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'Logtrk2' to jndi 'Logtrk2'
      15:22:04,374 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=Logtrk2,service=EJB
      java.lang.ArrayIndexOutOfBoundsException: 0
       at org.jboss.ejb.plugins.cmp.jdbc2.schema.EntityTable.start(EntityTable.java:220)
       at org.jboss.ejb.plugins.cmp.jdbc2.bridge.JDBCEntityBridge2.start(JDBCEntityBridge2.java:110)
       at org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2.startEntity(JDBCStoreManager2.java:479)
       at org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2.start(JDBCStoreManager2.java:180)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
       at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
       at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:428)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy485.start(Unknown Source)
       at org.jboss.ejb.EjbModule.startService(EjbModule.java:395)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
       at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:428)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy23.start(Unknown Source)
       at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:627)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy24.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      15:22:04,718 INFO [ProxyFactory] Bound EJB Home 'TypeAFacade' to jndi 'TypeAFacade'
      15:22:04,845 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'LogtrackControl' to jndi 'LogtrackControlLocal'
      15:22:04,982 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'Engine' to jndi 'EngineLocal'
      15:22:05,103 INFO [ProxyFactory] Bound EJB Home 'Engine' to jndi 'Engine'
      15:22:10,659 INFO [EJBDeployer] Deployed: file:/mnt/oldserver/ez/prog/appServers/jboss-4.0.3SP1/server/default/deploy/X1ejbM2.jar
      15:22:10,874 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:jndiName=Logtrk2,service=EJB
       State: FAILED
       Reason: java.lang.ArrayIndexOutOfBoundsException: 0
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:jndiName=Logtrk2,service=EJB
       State: FAILED
       Reason: java.lang.ArrayIndexOutOfBoundsException: 0
      
      

      I have rechecked the three .java files, the 3 DD's, and everything seems like 100%.
      I am certain I overlooked something simple.
      Please adivse.
      Thank you;
      -nat

        • 1. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
          Nat Gross Newbie

          In this and the following message I post the DD's and the class files. (Relevant sectins only!)
          This message has the DD's and the following the .java files and/or snippets.
          Aye, thanks again.
          nat

          ejb-jar.xml:

          <entity>
           <ejb-name>Logtrk2</ejb-name>
           <local-home>x1.db.Logtrk2Home</local-home>
           <local>x1.db.Logtrk2</local>
           <ejb-class>x1.db.Logtrk2Bean</ejb-class>
           <persistence-type>Container</persistence-type>
           <prim-key-class>java.lang.Integer</prim-key-class>
           <reentrant>False</reentrant>
           <cmp-version>2.x</cmp-version>
           <abstract-schema-name>Logtrk2</abstract-schema-name>
           <cmp-field>
           <field-name>iD</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>type</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>logtPhraseID</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>phraseID</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>numQry</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeLog</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeTrans</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>logtStartID</field-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeMS</field-name>
           </cmp-field>
          </entity>

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

          jboss.xml:
          <entity>
           <ejb-name>Logtrk2</ejb-name>
           <local-jndi-name>Logtrk2</local-jndi-name>
          </entity>

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

          jbosscmp-jdbc.xml:
          <entity>
           <ejb-name>Logtrk2</ejb-name>
           <table-name>Logtrk2</table-name>
           <cmp-field>
           <field-name>iD</field-name>
           <column-name>ID</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>type</field-name>
           <column-name>Type</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>logtPhraseID</field-name>
           <column-name>LogtPhraseID</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>phraseID</field-name>
           <column-name>PhraseID</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>numQry</field-name>
           <column-name>NumQry</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeLog</field-name>
           <column-name>TimeLog</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeTrans</field-name>
           <column-name>TimeTrans</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>logtStartID</field-name>
           <column-name>LogtStartID</column-name>
           </cmp-field>
           <cmp-field>
           <field-name>timeMS</field-name>
           <column-name>TimeMS</column-name>
           </cmp-field>
          </entity>
          


          • 2. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
            Nat Gross Newbie

            And here are the java files, to whoever cares to look at this.
            Local interface:

            package x1.db;
            
            import java.sql.Timestamp;
            import javax.ejb.EJBLocalObject;
            
            public interface Logtrk2 extends EJBLocalObject {
            
             public void setID(Integer iD);
             public Integer getID();
            
             public void setLogtPhraseID(Integer logtPhraseID);
             public Integer getLogtPhraseID();
            
             public void setLogtStartID(Integer logtParentID);
             public Integer getLogtStartID();
            
             public void setPhraseID(Integer phraseID);
             public Integer getPhraseID();
            
             public void setNumQry(Double nymQry );
             public Double getNumQry();
            
             public void setType(int type);
             public int getType();
            
             public void setTimeLog(Timestamp timeLog);
             public Timestamp getTimeLog();
            
             public void setTimeTrans(Timestamp timeTrans);
             public Timestamp getTimeTrans();
            
             public void setTimeMS(int timeMS);
             public int getTimeMS();
            }

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

            And the ejbCreate of the bean:
             public Integer ejbCreate(Integer iD, int type, Integer logtPhraseID, Integer phraseID ,Timestamp timeTX) throws CreateException {
             RamTimestamp rts = new RamTimestamp(); //this is a custom, similar-to, Timestamp class
             setID(iD);
             setType(type);
             setLogtPhraseID(logtPhraseID);
             setPhraseID(phraseID);
             Timestamp now = rts.getLogTime();
             setTimeLog(now);
             if (timeTX==null) timeTX=now;
             setTimeTrans(timeTX);
             return null;
             }

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

            And the Home thingajabig:
            package x1.db;
            
            import java.sql.Timestamp;
            import javax.ejb.CreateException;
            import javax.ejb.EJBLocalHome;
            import javax.ejb.FinderException;
            
            public interface Logtrk2Home extends EJBLocalHome {
            
             public Logtrk2 create(Integer iD, int type, Integer logtPhraseID, Integer phraseID ,Timestamp timeTX) throws CreateException;
             public Logtrk2 findByPrimaryKey(Integer iD) throws FinderException;
            }



            • 3. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
              Chris Burt Newbie

              I have the same problem. Entity beans that work perfectly well when deployed using the standard container config will not deploy in the cmp2.x jdbc2 pm container because of the ArrayIndexOutOfBoundsException given above.

              Has anybody been able to use the new container?

              • 4. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
                Nat Gross Newbie

                Oh. I am using the cmp2.x jdbc2 container with no problems, except for this entity bean.
                Maybe your problem is that you are mixing containers. I recall reading that you should not mix containers.
                However, in my case I am not mixing containers, just added this bean to an exisiting ejb-jar deployment, with the above results.

                -nat

                • 5. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
                  Chris Burt Newbie

                  I switched all the Entity beans in my deployment to use cmp2.x jdbc2 pm so I'm not mixing containers either.

                  Unless my eyes are failing me, your ejb-jar.xml seems to be missing a <primkey-field> element, and from looking at the JBoss code this problem seems to have something to do with PK fields. However, this isn't missing in my descriptors and the deployment still fails.

                  Let me know if this helps...

                  Chris

                  • 6. Re: Can't deploy new cmp entity: ArrayIndexOutOfBoundsExcept
                    Nat Gross Newbie

                    Yes! That was it!
                    Will keep you posted if a solution to your problem hits me.
                    By the way, are you on 4.03SP1? If not, it might make a difference for you. I don't know.

                    Thanks;
                    -nat