1 Reply Latest reply on May 7, 2003 8:49 AM by Juha Lindfors

    jboss 3.2 - CMP 2.0 entity- index out of bounds error

    daseinw Newbie

      I've racked my brains forever trying to figure out what I'm doing wrong here. Whenever I attempt to deploy this CMP entity bean, I always get the following error:

      [ObjectName: jboss.j2ee:jndiName=MovieBean,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: java.lang.StringIndexOutOfBoundsException: String index out of range: 0]

      Can ANYONE lend some help/insight?
      I've also attached the source if that would help....



      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
      <enterprise-beans>

      <ejb-name>MovieBean</ejb-name>
      com.hmco.college.bbsf.ejb.MovieBeanHome
      com.hmco.college.bbsf.ejb.MovieBeanRemote
      <local-home>com.hmco.college.bbsf.ejb.MovieBeanLocalHome</local-home>
      com.hmco.college.bbsf.ejb.MovieBeanLocal
      <ejb-class>com.hmco.college.bbsf.ejb.MovieBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>MovieBean</abstract-schema-name>
      <cmp-field>
      <field-name>courseID</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>courseOwner</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>passkeyText</field-name>
      </cmp-field>
      <cmp-field>
      <field-name>passkeyRole</field-name>
      </cmp-field>
      <primkey-field>courseID</primkey-field>
      <!-- query -->

      <query-method>
      <method-name>findByCourseOwner</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      <![CDATA[SELECT OBJECT(a) FROM MovieBean AS a WHERE a.courseOwner = ?1]]>
      </ejb-ql>

      <!-- query -->

      <query-method>
      <method-name>findByPasskeyRole</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      <![CDATA[SELECT OBJECT(a) FROM MovieBean AS a WHERE a.passkeyRole = ?1]]>
      </ejb-ql>

      <!-- query -->

      <query-method>
      <method-name>findByPasskeyText</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      <![CDATA[SELECT OBJECT(a) FROM MovieBean AS a WHERE a.passkeyText = ?1]]>
      </ejb-ql>

      <!-- query -->

      <query-method>
      <method-name>findAllCourses</method-name>
      <method-params>
      <method-param></method-param>
      </method-params>
      </query-method>
      <ejb-ql>
      <![CDATA[SELECT OBJECT(a) FROM MovieBean AS a WHERE a.courseID IS NOT NULL]]>
      </ejb-ql>

      <resource-ref>
      <res-ref-name>jdbc/DefaultDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>

      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>MovieBean</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Supports</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>