Hi
Rickard �berg wrote:
>Hi!
>[EMAIL PROTECTED] wrote:
>>
>> Hi all
>>
>> I'm re-posting this again since I didn't get any response on that.
>>
>> findAll throws exception than trying get all data in table with more than
>one record .
>>
>> [Default] JRMPCI:invokeHome public abstract java.util.Collection com.ulybin.JobB
>> oerse.database.ad.ADHome.findAll() throws javax.ejb.EJBException,java.rmi.Remote
>> Exception,javax.ejb.FinderException
>> [JAWS] FindAll command executing: SELECT ad_id FROM ADBean
>> [JAWS] java.rmi.ServerException: Finder failed; nested exception is:
>> [JAWS] java.lang.ArrayIndexOutOfBoundsException
>> [JAWS] java.lang.ArrayIndexOutOfBoundsException
>> [JAWS] at org.hsql.jdbcResultSet.getObject(jdbcResultSet.java:703)
>> [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.handleResult(JDBCFi
>> nderCommand.java:96)
>If you read the source for JDBCFinderCommand it will try to get the
>primary key for your entity at this point. Do you have a composite key
>(i.e. your own pk class)?
Yes :
public class ADPK implements Serializable {
public long ad_id;
public ADPK() { }
public int hashCode() { return new Long(ad_id).hashCode(); }
public boolean equals(Object other) {
if(other instanceof ADPK)
{
ADPK okey=(ADPK)other;
return okey.ad_id==this.ad_id;
}
return false;
}
}
> Do you have the same fields in your Entity?
Yes:
public class ADBean implements EntityBean {
...
public long ad_id;
..
}
>Are they defined as CMP fields?
Yes:
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>ADBean</ejb-name>
<home>com.ulybin.JobBoerse.database.ad.ADHome</home>
<remote>com.ulybin.JobBoerse.database.ad.AD</remote>
<ejb-class>com.ulybin.JobBoerse.database.ad.ADBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>com.ulybin.JobBoerse.database.ad.ADPK</prim-key-class>
<reentrant>False</reentrant>
...
<field-name>ad_id</field-name>
</cmp-field>
...
</entity>
</enterprise-beans>
..
</ejb-jar>
>/Rickard
--
>Rickard �berg
>Email: [EMAIL PROTECTED]
>http://www.telkel.com
>http://www.jboss.org
>http://www.dreambean.com
Nahibin Serhiy
Software Developer
ULYBIN GmbH
http://www.ulybin.com
Phone: +38 0322 797 403
Phone/Fax: +38 0322 728 835
E-mail: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]