Hi.
I'm using Hibernate 1.2.3, Spring framework 1.0.1, MySQL 4.xxx and Tomcat 4.1.27
I've been getting a java.lang.IndexOutOfBoundsException when executing a function inside a DAO.
A small part of the DEBUG-trace:
13:10:10,296 DEBUG BatcherImpl:241 - preparing statement
13:10:10,296 DEBUG BooleanType:46 - binding 'false' to parameter: 1
13:10:10,296 DEBUG Cascades:341 - id unsaved-value strategy NULL
13:10:10,296 DEBUG ClassType:46 - binding 'ks.rah.avik2.domain.Function' to parameter: 2
13:10:10,312 DEBUG SerializableType:46 - binding '2c6d8085f3f2808eeae1f6e1aeece1eee7aeccefeee7bb0b64104c0fa35f828081ca8 85f6e1ecf5e5f8f28090eae1f6e1aeece1eee7aecef5ede2e5f2062c159d8b14600b828080f8f08080808080808085' to parameter: 3
13:10:10,312 DEBUG BooleanType:46 - binding 'true' to parameter: 4
13:10:10,312 DEBUG JDBCTransaction:82 - rollback
13:10:10,312 DEBUG SessionImpl:572 - transaction completion
13:10:10,312 DEBUG JDBCTransaction:103 - re-enabling autocommit
13:10:10,312 DEBUG SessionImpl:560 - closing session
13:10:10,312 DEBUG SessionImpl:3327 - disconnecting session
13:10:10,328 DEBUG BatcherImpl:203 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:10:10,328 DEBUG BatcherImpl:261 - closing statement
13:10:10,328 DEBUG SessionImpl:572 - transaction completion
13:10:10,328 ERROR DispatcherServlet:364 - Could not complete request
java.lang.ArrayIndexOutOfBoundsException: 3
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:1955)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:1977)
at com.mysql.jdbc.PreparedStatement.setBoolean(PreparedStatement.java:361)
at net.sf.hibernate.type.BooleanType.set(BooleanType.java:32)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:674)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:713)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
The function:
public List findCommentedEvents(Function func) throws DataAccessException{
return getHibernateTemplate().find("from Event e where " +
"e.bossentryflg = ? "+
"and e.owner = ? and e.visible = ?",
new Object[]{new Boolean("true"), func, new Boolean("true")},
new Type[]{Hibernate.BOOLEAN, Hibernate.OBJECT, Hibernate.BOOLEAN});
}
Function mapping.
<hibernate-mapping>
<class
name="ks.rah.avik2.domain.Function"
table="function"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="id"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="native">
</generator>
</id>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="funcdesc"
/>
<bag
name="functionnaires"
table="functionnaires"
lazy="false"
inverse="false"
cascade="save-update"
>
<key
column="func_fk"
/>
<composite-element
class="ks.rah.avik2.domain.support.UserFunctionNode"
>
<many-to-one
name="user"
class="ks.rah.avik2.domain.AvikUser"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="user_fk"
/>
<property
name="from"
type="date"
update="true"
insert="true"
column="fromdate"
/>
<property
name="until"
type="date"
update="true"
insert="true"
column="todate"
/>
<property
name="current"
type="boolean"
update="true"
insert="true"
column="iscurrent"
/>
</composite-element>
</bag>
<property
name="active"
type="boolean"
update="true"
insert="true"
column="active"
/>
</class>
</hibernate-mapping>
Any ideas why I get the funny 3:rd argument in the bind trace?
Sincerely,
/Cantor
|