I got a
Problem about useing hibernate under ibm jdk 1.3.1 (ship with websphere ) that is throws the exceptions:
Code:
java.lang.IllegalArgumentException: object is not an instance of declaring class
at java.lang.reflect.Method.invoke(Native Method)
at net.sf.hibernate.proxy.LazyInitializer.invoke(LazyInitializer.java:105)
at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:53)
at com.gdpr.pss.module.PSSTaskRow$$EnhancedByCGLIB$$0.equals()
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getAttribute(SRTServletRequest.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.HttpServletRequestProxy.getAttribute(HttpServletRequestProxy.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.HttpServletRequestProxy.getAttribute(HttpServletRequestProxy.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.HttpServletRequestProxy.getAttribute(HttpServletRequestProxy.java(Compiled Code))
at org.apache.jsp._produceTaskItem._jspService(_produceTaskItem.java:137)
But it is OK under sun jdk1.4.2 in jboss .
The *.hbm.xml is as follow
Code:
/********************************/
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.gdpr.pss.module.PSSTaskRow"
table="t_pss_task_row"
dynamic-update="false" proxy="com.gdpr.pss.module.PSSTaskRow">
<id name="taskRowSn" column="task_row_sn" type="long" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="taskSn" type="long" update="true" insert="true" column="task_sn"/>
<property name="cpSn" type="long" update="true" insert="true" column="cp_sn"/>
<property name="taskFieldSn" type="int" update="true" insert="true" column="task_field_sn"/>
<property name="planBeginDate" type="date" update="true" insert="true" column="plan_begin_date"/>
<property name="planEndDate" type="date" update="true" insert="true" column="plan_end_date"/>
<property name="actBeginDate" type="date" update="true" insert="true" column="act_begin_date"/>
<property name="actEndDate" type="date" update="true" insert="true" column="act_end_date"/>
<property name="taskContent" type="string" update="true" insert="true" column="task_content"/>
<property name="taskCondiction" type="string" update="true" insert="true" column="task_condiction"/>
<property name="delayCause" type="string" update="true" insert="true" column="delay_cause"/>
<property name="state" type="byte" update="true" insert="true" column="state"/>
<many-to-one name="taskField"
class="com.gdpr.pss.module.PSSTaskField"
cascade="none"
outer-join="auto"
update="false"
insert="false"
column="task_field_sn"/>
<many-to-one name="controlPoint"
class="com.gdpr.pss.module.PSSControlPoint"
cascade="none"
outer-join="auto"
update="false"
insert="false"
column="cp_sn"/>
<many-to-one name="produceTask"
class="com.gdpr.pss.module.PSSProduceTask"
cascade="none"
outer-join="auto"
update="false"
insert="false"
column="task_sn"/>
<set name="taskRowScores"
table="t_pss_task_row_score"
lazy="true"
inverse="false"
cascade="all-delete-orphan"
sort="unsorted">
<key column="task_row_sn"/>
<one-to-many class="com.gdpr.pss.module.PSSTaskRowScore"/>
</set>
</class>
</hibernate-mapping>
/********************************/
And the PSSTaskRow.java is as the most common cases.
But I warp the PSSTaskRowForm with PSSTaskRow as the delegate like thus to adapt for struts usage.
Code:
public class PSSTaskRowForm extends ActionForm
{
public PSSTaskRowForm(PSSTaskRow taskRow)
{
this.taskRow = taskRow;
}
public PSSTaskRowForm()
{
this.taskRow = new PSSTaskRow();
}
PSSTaskRow taskRow;
......ect methods
}
And I recomile the hibernate 2.03 under ibm jdk 1.3.1 ,but the problem still happend.
What shall I do to resolve this problem ?
Expecting your selfless help .
BenHuang from GuangZhou GuangDong China.
BenHuang@GDPR.COM