-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: exception setting property value with CGLIB
PostPosted: Thu Oct 13, 2005 9:57 pm 
Newbie

Joined: Wed Feb 23, 2005 2:08 pm
Posts: 17
Any suggestions on why I am getting this and how to correct it? thanks in advance.

Scott




/**
* @hibernate.list table="ApplicationConsumer" inverse="true"
* cascade="all"
* @hibernate.collection-key column="consumerId"
* @hibernate.collection-index column="applicationNum"
* @hibernate.collection-many-to-many class="com.cl.entity.application.vo.Application"
* column="applicationId"
*
* @return List
*/
public java.util.List getApplications() {
return applications;
}


/**
* @hibernate.bag name="consumers"
* table="applicationConsumer"
* cascade="save-update"
* @hibernate.collection-key column="applicationId"
* @hibernate.collection-many-to-many class="com.cl.entity.consumer.vo.Consumer"
* column="consumerId"
*/
public java.util.Set getConsumers() {
return consumers;
}

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.05

Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="com.cl.entity.application.vo.Application"
table="Application"
lazy="false"
>

<id
name="oid"
column="oid"
type="java.lang.String"
unsaved-value="null"
>
<generator class="com.cl.entity.common.NativeHiLoGenerator">
<param name="table">id_container</param>
<param name="column">last_high_oid</param>
<param name="install_id">install_id</param>
<param name="max_lo">100000</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Application.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<version
name="version"
column="version"
type="int"
/>

<property
name="categoryCode"
type="java.lang.String"
update="true"
insert="true"
column="categoryCode"
not-null="true"
/>

<property
name="channelCode"
type="java.lang.String"
update="true"
insert="true"
column="channelCode"
/>

<property
name="comments"
type="java.lang.String"
update="true"
insert="true"
column="comments"
/>

<property
name="completionStatusCode"
type="java.lang.String"
update="true"
insert="true"
column="completionStatusCode"
not-null="true"
/>

<bag
name="consumers"
table="applicationConsumer"
lazy="false"
cascade="save-update"
>

<key
column="applicationId"
>
</key>

<many-to-many
class="com.cl.entity.consumer.vo.Consumer"
column="consumerId"
outer-join="auto"
/>

</bag>

<property
name="lifeCycleStatusCode"
type="java.lang.String"
update="true"
insert="true"
column="lifeCycleStatusCode"
not-null="true"
/>

<property
name="pointOfSaleId"
type="java.lang.String"
update="true"
insert="true"
column="pointOfSaleId"
/>

<property
name="salesPersonId"
type="java.lang.String"
update="true"
insert="true"
column="salesPersonId"
/>

<property
name="typeCode"
type="java.lang.String"
update="true"
insert="true"
column="typeCode"
not-null="true"
/>

<property
name="createdBy"
type="java.lang.String"
update="true"
insert="true"
column="createdBy"
not-null="true"
/>

<property
name="createdOn"
type="java.util.Date"
update="true"
insert="true"
column="createdOn"
not-null="true"
/>

<property
name="updatedBy"
type="java.lang.String"
update="true"
insert="true"
column="updatedBy"
/>

<property
name="updatedOn"
type="java.util.Date"
update="true"
insert="true"
column="updatedOn"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Application.xml
containing the additional properties and place it in your merge dir.
-->

<joined-subclass
name="com.cl.entity.application.vo.InstallLoanApp"
table="InstallLoanApp"
lazy="false"
>
<key
column="applicationId"
/>

<list
name="autoProducts"
table="InstallloanappAutoproduct"
lazy="true"
inverse="true"
cascade="none"
>

<key
column="applicationId"
>
</key>

<index
column="autoProductNum"
/>

<many-to-many
class="com.cl.entity.product.vo.AutoProduct"
column="productId"
outer-join="auto"
/>

</list>

<property
name="financingAmt"
type="float"
update="true"
insert="true"
column="financingAmt"
not-null="true"
/>

<property
name="ISOCurrencyCode"
type="java.lang.String"
update="true"
insert="true"
column="ISOCurrencyCode"
/>

<property
name="photoIdCheckCode"
type="java.lang.String"
update="true"
insert="true"
column="photoIdCheckCode"
/>

</joined-subclass>

</class>

</hibernate-mapping>


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="com.cl.entity.common.vo.Person"
table="Person"
lazy="false"
>

<id
name="oid"
column="oid"
type="java.lang.String"
unsaved-value="null"
>
<generator class="com.cl.entity.common.NativeHiLoGenerator">
<param name="table">id_container</param>
<param name="column">last_high_oid</param>
<param name="install_id">install_id</param>
<param name="max_lo">100000</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Person.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<version
name="version"
column="version"
type="int"
/>

<many-to-one
name="businessEntity"
class="com.cl.entity.organization.vo.BusEntity"
cascade="all"
outer-join="auto"
update="true"
insert="true"
column="busEntityId"
/>

<property
name="cellPhone"
type="java.lang.String"
update="true"
insert="true"
column="cellPhone"
/>

<property
name="firstName"
type="java.lang.String"
update="true"
insert="true"
column="firstName"
/>

<property
name="fullName"
type="java.lang.String"
update="true"
insert="true"
column="fullName"
/>

<property
name="homePhone"
type="java.lang.String"
update="true"
insert="true"
column="homePhone"
/>

<property
name="lastName"
type="java.lang.String"
update="true"
insert="true"
column="lastName"
/>

<many-to-one
name="loginInfo"
class="com.cl.entity.system.vo.LoginInfo"
cascade="all"
outer-join="auto"
update="true"
insert="true"
column="loginInfoId"
/>

<property
name="middleName"
type="java.lang.String"
update="true"
insert="true"
column="middleName"
/>

<property
name="prefix"
type="java.lang.String"
update="true"
insert="true"
column="prefix"
/>

<property
name="suffix"
type="java.lang.String"
update="true"
insert="true"
column="suffix"
/>

<property
name="workPhone"
type="java.lang.String"
update="true"
insert="true"
column="workPhone"
/>

<property
name="fax"
type="java.lang.String"
update="true"
insert="true"
column="fax"
/>

<property
name="pager"
type="java.lang.String"
update="true"
insert="true"
column="pager"
/>

<property
name="createdBy"
type="java.lang.String"
update="true"
insert="true"
column="createdBy"
not-null="true"
/>

<property
name="createdOn"
type="java.util.Date"
update="true"
insert="true"
column="createdOn"
not-null="true"
/>

<property
name="updatedBy"
type="java.lang.String"
update="true"
insert="true"
column="updatedBy"
/>

<property
name="updatedOn"
type="java.util.Date"
update="true"
insert="true"
column="updatedOn"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Person.xml
containing the additional properties and place it in your merge dir.
-->

<joined-subclass
name="com.cl.entity.consumer.vo.Consumer"
table="Consumer"
lazy="false"
>
<key
column="consumerId"
/>

<list
name="applications"
table="ApplicationConsumer"
lazy="false"
inverse="true"
cascade="all"
>

<key
column="consumerId"
>
</key>

<index
column="applicationNum"
/>

<many-to-many
class="com.cl.entity.application.vo.Application"
column="applicationId"
outer-join="auto"
/>

</list>

<property
name="bankAccountCode"
type="java.lang.String"
update="true"
insert="true"
column="bankAccountCode"
/>

<bag
name="contacts"
table="consumerContact"
lazy="false"
cascade="all"
>

<key
column="consumerId"
>
</key>

<one-to-many
class="com.cl.entity.common.vo.Contact"
/>

</bag>

<property
name="dateOfBirth"
type="date"
update="true"
insert="true"
column="dateOfBirth"
not-null="true"
/>

<property
name="driversLicenseNum"
type="java.lang.String"
update="true"
insert="true"
column="driversLicenseNum"
/>

<property
name="driversLicenseStateCode"
type="java.lang.String"
update="true"
insert="true"
column="driversLicenseStateCode"
/>

<property
name="socialSecurityNum"
type="java.lang.String"
update="true"
insert="true"
column="socialSecurityNum"
not-null="true"
/>

<property
name="usResidentCode"
type="java.lang.String"
update="true"
insert="true"
column="usResidentCode"
not-null="true"
/>

<bag
name="addresses"
table="consumerConsumeraddress"
lazy="false"
cascade="all"
>

<key
column="consumerId"
>
</key>

<one-to-many
class="com.cl.entity.consumer.vo.ConsumerAddress"
/>

</bag>

<bag
name="employmentDetails"
table="consumerEmpdetail"
lazy="false"
cascade="all"
>

<key
column="consumerId"
>
</key>

<one-to-many
class="com.cl.entity.consumer.vo.EmpDetail"
/>

</bag>

</joined-subclass>

</class>

</hibernate-mapping>




Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.cl.entity.application.vo.Application.setConsumers; nested exception is org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.cl.entity.application.vo.Application.setConsumers
at com.cl.entity.consumer.dao.ConsumerDAOHibernate.saveConsumer(ConsumerDAOHibernate.java:111)
at com.cl.entity.consumer.dao.ConsumerDAOTest.testSaveConsumer(ConsumerDAOTest.java:268)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


Name and version of the database you are using:Oracle 10g

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 3:39 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Hi,

as your stacktrace says:

Quote:
exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info)


You should place a file hibernate.properties
in your classpath. The contents:
Code:
hibernate.cglib.use_reflection_optimizer=false


Then you will get a stacktrace which may be easier to
understand. This helped me several times.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.