[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3600?page=c...
]
Adam Warski resolved HHH-3600.
------------------------------
Assignee: Adam Warski
Resolution: Duplicate
Fix Version/s: 3.4
Duplicate of HHH-3594.
exception while saving bidirectional association
-------------------------------------------------
Key: HHH-3600
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3600
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: hql+collection
Environment: spring 2.5, envers 1.1.0.GA-hibernate-3.3, hibernate 3.3.1, hsqldb
1.8.0.7
Reporter: Itai Peleg
Assignee: Adam Warski
Priority: Critical
Fix For: 3.4
Attachments: envers.zip
when adding the listeners
<listener type="post-collection-recreate"
class="org.jboss.envers.event.VersionsEventListener"/>
<listener type="pre-collection-remove"
class="org.jboss.envers.event.VersionsEventListener"/>
<listener type="pre-collection-update"
class="org.jboss.envers.event.VersionsEventListener"/>
the bidirectional association between entities cause an exception that thrown while
saving the revision entities.
2008-11-12 08:21:56,957 ERROR [JDBCTransaction] - exception calling user Synchronization
org.hibernate.PropertyAccessException: could not get a field value by reflection getter
of com.digit
altrowel.model.extractions.organization.Employment.createdByStepExecution at
org.hibernate.property.
DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:58)
at
org.hibernate.property.DirectPropertyAccessor$DirectGetter.getForInsert(DirectPropertyAccessor.j
ava:63)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValuesToInsert(AbstractEntityTupliz
er.java:294)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValuesToInsert(PojoEntityTuplizer.java:
239)
at
org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValuesToInsert(AbstractEntityP
ersister.java:3696)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListen
er.java:290)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204
)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.
java:130)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultS
aveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEvent
Listener.java:56)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEv
entListener.java:195)
at
org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.ja
va:50)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEvent
Listener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
at
org.jboss.envers.synchronization.work.PersistentCollectionChangeWorkUnit.perform(PersistentColle
ctionChangeWorkUnit.java:67)
at
org.jboss.envers.synchronization.VersionsSync.executeInSession(VersionsSync.java:120)
at
org.jboss.envers.synchronization.VersionsSync.beforeCompletion(VersionsSync.java:144)
at
org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsBeforeTransactionCompletion(JDBCTrans
action.java:274)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:140)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionMana
ger.java:655)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(Abstrac
tPlatformTransactionManager.java:709)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatfo
rmTransactionManager.java:678)
at
com.digitaltrowel.test.AbstractTransactionalSpringContextTest$TransactionContext.endTransaction(
AbstractTransactionalSpringContextTest.java:243)
at
com.digitaltrowel.test.AbstractTransactionalSpringContextTest.endTransaction(AbstractTransaction
alSpringContextTest.java:201)
at
com.digitaltrowel.test.AbstractTransactionalSpringContextTest.commit(AbstractTransactionalSpring
ContextTest.java:195)
at
com.digitaltrowel.test.data.DataGenerationTest.testCreateData(DataGenerationTest.java:55)
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.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:163)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java
:233)
at
org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(Spri
ngMethodRoadie.java:333)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie
.java:217)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
at
org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4Cla
ssRunner.java:142)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.IllegalArgumentException: Can not set
com.digitaltrowel.model.batch.metadata.Ba
tchStepExecution field
com.digitaltrowel.model.versionedentity.VersionedEntity.createdByStepExecutio
n to java.util.HashMap
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.jav
a:146)
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.jav
a:150)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:358)
at
org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:55)
... 48 more
see attached test case.
Note that the test pasted but exception written in the stack trace!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira