Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of stake.out.entry.FileData.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of stake.out.entry.FileData.id
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of stake.out.entry.FileData.idCaused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
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:597)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:169)
... 35 more

解决方案 »

  1.   

    stake.out.entry.FileData.id  这里出错了
    你检查一下
    java.lang.IllegalArgumentException:
      

  2.   

    字面理解是那样的    应该是关联的时候出错的 去掉关联 数据正常插入,现在就是不知道哪出错了
      <set name="fileData" 
                 table="sys_file" 
                 inverse="true" 
                 cascade="save-update"> 
                 <key column="sys_id"/> 
                 <many-to-many class="stake.out.entry.JSystem" 
                               column="f_id"/> 
       </set> 
           <set name="systems" 
                 table="sys_file"
                 cascade="save-update"> 
                <key column="f_id"/> 
                <many-to-many class="stake.out.entry.FileData" 
                              column="sys_id"/>            
             </set>