[Hibernate-JIRA] Created: (ANN-763) Hibernate fails on startup when using IdClass and one of the id-properties is an embedded object.
by Arne Limburg (JIRA)
Hibernate fails on startup when using IdClass and one of the id-properties is an embedded object.
-------------------------------------------------------------------------------------------------
Key: ANN-763
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-763
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.4.0.CR2, 3.4.0.CR1, 3.3.1.GA
Environment: Hibernate 3.2.6 with HSQLDB, tested with Hibernate-Annotations 3.3.1.GA and 3.4.0.CR2
Reporter: Arne Limburg
To verify this I modified the entities for the CompositeIdTest:
I changed the Product class to be embeddable (by annotating it with @Embeddable instead of @Entity and annotating the property with @Basic instead of @Id) and the Reference in the OrderLinePK class from @ManyToOne @JoinColumn to @Embedded.
This resulted in the following exception:
org.hibernate.PropertyNotFoundException: field [name] not found on org.hibernate.test.annotations.cid.OrderLine
at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:122)
at org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:114)
at org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:137)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:133)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:43)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:38)
at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:52)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:50)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.tuple.PropertyFactory.buildStandardProperty(PropertyFactory.java:120)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:45)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1108)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1293)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.test.annotations.TestCase.buildSessionFactory(TestCase.java:51)
at org.hibernate.test.annotations.TestCase.setUp(TestCase.java:61)
at junit.framework.TestCase.runBare(TestCase.java:125)
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.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
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)
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (HHH-2442) ClassCastException loading from second level cache
by Marcio Moraes (JIRA)
ClassCastException loading from second level cache
--------------------------------------------------
Key: HHH-2442
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2442
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1, 3.2.2, 3.2.0.ga
Environment: Linux 2.6.15-27-686 #1 SMP PREEMPT Fri Dec 8 18:00:07 UTC 2006 i686 GNU/Linux
Reporter: Marcio Moraes
Priority: Blocker
I'm getting a error when using hibernate 3.2.2.ga with cache (JBoss-Cache) cluster.
When hibernate get a entity from second level cache it confuses the arrays of values against array of types.
So in some situations i got ClassCastException ...
Looking up CacheEntry code at assemble method i saw:
private static Object[] assemble(
final Serializable[] values,
final Object result,
final Serializable id,
final EntityPersister persister,
final Interceptor interceptor,
final EventSource session)
throws HibernateException {
//assembled state gets put in a new array (we read from cache by value!)
Object[] assembledProps = TypeFactory.assemble(
values,
persister.getPropertyTypes(),
session, result
);
The issue is values (Serializeble[]) is in wrong order compared with persister.getPropertyTypes() (Type[]).
If only one cache instance is running it doesnt occurs ...
I am using Linux.
Att,
Márcio Moraes
--
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
16 years, 5 months