org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.String MyEmbeddableId.foo] by reflection for persistent property [MyEmbeddableId#foo] : MyEmbeddableId@33675787

Hibernate JIRA | Giovanni Lovato | 3 months ago
  1. 0

    Entity with EmbeddedId fails retrieve from cache after deployment reload

    Stack Overflow | 3 months ago | Heruan
    org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.String MyEmbeddableId.foo] by reflection for persistent property [MyEmbeddableId#foo] : MyEmbeddableId@33675787
  2. 0

    I'm on WildFly 10, Hibernate 5.2.2 and a simple JAX-RS/JPA app with an entity like this: {code:java} @Entity @Cacheable public class MyEntity implements Serializable { @EmbeddedId private MyEmbeddableId id; // other fields, hashCode, equals, getters and setters } @Embeddable public class MyEmbeddableId implements Serializable { private String foo; private String bar; // hashCode, equals, getters and setters } {code} All works like expected, but if I reload the app (not restarting WildFly) then on entity load I get: {code} org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.String MyEmbeddableId.foo] by reflection for persistent property [MyEmbeddableId#foo] : MyEmbeddableId@33675787 at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:71) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58) at org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:414) at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:225) at org.hibernate.cache.infinispan.TypeEquivalance.hashCode(TypeEquivalance.java:24) at org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8.get(BoundedEquivalentConcurrentHashMapV8.java:2427) at org.infinispan.container.DefaultDataContainer.get(DefaultDataContainer.java:188) at org.infinispan.container.EntryFactoryImpl.innerGetFromContainer(EntryFactoryImpl.java:288) at org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:258) at org.infinispan.container.EntryFactoryImpl.wrapEntryForReading(EntryFactoryImpl.java:64) at org.infinispan.interceptors.EntryWrappingInterceptor.visitDataReadCommand(EntryWrappingInterceptor.java:132) at org.infinispan.interceptors.EntryWrappingInterceptor.visitGetKeyValueCommand(EntryWrappingInterceptor.java:123) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113) at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataReadCommand(PessimisticLockingInterceptor.java:71) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitGetKeyValueCommand(AbstractLockingInterceptor.java:77) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:345) at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:330) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107) at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76) at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:411) at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:403) at org.infinispan.cache.impl.AbstractDelegatingCache.get(AbstractDelegatingCache.java:286) at org.hibernate.cache.infinispan.access.InvalidationCacheAccessDelegate.get(InvalidationCacheAccessDelegate.java:61) at org.hibernate.cache.infinispan.entity.ReadOnlyAccess.get(ReadOnlyAccess.java:44) at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:32) at org.hibernate.event.internal.DefaultLoadEventListener.getFromSharedCache(DefaultLoadEventListener.java:651) at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:595) at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:462) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278) at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1218) at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1101) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639) at org.hibernate.type.EntityType.resolve(EntityType.java:431) at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:151) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1146) at org.hibernate.loader.Loader.processResultSet(Loader.java:1005) at org.hibernate.loader.Loader.doQuery(Loader.java:943) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349) at org.hibernate.loader.Loader.doList(Loader.java:2615) at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2460) at org.hibernate.loader.Loader.list(Loader.java:2422) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1458) at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1426) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1398) ... 120 more Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String field MyEmbeddableId.foo to MyEmbeddableId {code} If I restart WildFly, it works again. Also, if I disable caching all works fine also after deployment reload. Debugging, I've found that in {{org.hibernate.property.access.spi.GetterFieldImpl.get}}, after WildFly restart we have: {code:java} Class fieldDeclaringClass = field.getDeclaringClass(); Class ownerClass = owner.getClass(); fieldDeclaringClass.getName().equals(ownerClass.getName()) == true; fieldDeclaringClass.isAssignableFrom(ownerClass) == true; {code} and after deployment reload: {code:java} Class fieldDeclaringClass = field.getDeclaringClass(); Class ownerClass = owner.getClass(); fieldDeclaringClass.getName().equals(ownerClass.getName()) == true; fieldDeclaringClass.isAssignableFrom(ownerClass) == false; // !!! {code} I don't know how this can happen, two classes with the same name which are not the same class.

    Hibernate JIRA | 3 months ago | Giovanni Lovato
    org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.String MyEmbeddableId.foo] by reflection for persistent property [MyEmbeddableId#foo] : MyEmbeddableId@33675787
  3. 0

    Hibernate: Error accessing field [private java.lang.Integer ] by reflection for persistent property

    Stack Overflow | 6 months ago | Leo
    org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Integer TarifKlsk.fkTarif] by reflection for persistent property [TarifKlsk#fkTarif] : 1027303
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The Aries transaction control integration tests have an XA integration test where two persistence units are created and used in a two phase commit. The persistence units are defined in different bundles, but use the same name for their one and only Entity Type. This name is org.apache.aries.tx.control.itests.entity.Message. The Entity types are private to the bundle, and so each one is loaded by a different class loader. In summary, the types have the same name, but are not the same (i.e. one cannot be cast to another). These tests work reliably on OpenJPA and EclipseLink, however sometimes when running on Hibernate I see the tests fail. Having step debugged the root cause is the following exception: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [public java.lang.Integer org.apache.aries.tx.control.itests.entity.Message.id] by reflection for persistent property [org.apache.aries.tx.control.itests.entity.Message#id] : Message [id=null, message=Hello 1!] at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:43) at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:223) at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4601) at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4313) at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:226) at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:510) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:99) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:775) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:748) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:753) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1146) at org.apache.aries.tx.control.jpa.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:42) at org.apache.aries.tx.control.jpa.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:42) at org.apache.aries.tx.control.itests.XAJPATransactionTest.lambda$0(XAJPATransactionTest.java:292) at org.apache.aries.tx.control.itests.XAJPATransactionTest$$Lambda$38/892040710.call(Unknown Source) at org.apache.aries.tx.control.service.common.impl.AbstractTransactionControlImpl$TransactionBuilderImpl.doWork(AbstractTransactionControlImpl.java:155) at org.apache.aries.tx.control.service.common.impl.AbstractTransactionControlImpl$TransactionBuilderImpl.required(AbstractTransactionControlImpl.java:78) at org.apache.aries.tx.control.service.common.impl.AbstractTransactionControlImpl.required(AbstractTransactionControlImpl.java:243) at org.apache.aries.tx.control.itests.XAJPATransactionTest.testTwoPhaseCommit(XAJPATransactionTest.java:285) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:68) at org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:37) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124) at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97) at org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.invokeMethodOnService(RemoteFrameworkImpl.java:433) at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.invokeMethodOnService(RemoteFrameworkImpl.java:406) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) at sun.rmi.transport.Transport$1.run(Transport.java:178) at sun.rmi.transport.Transport$1.run(Transport.java:175) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:174) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Integer field org.apache.aries.tx.control.itests.entity.Message.id to org.apache.aries.tx.control.itests.entity.Message at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:58) at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36) at java.lang.reflect.Field.get(Field.java:387) at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:39) ... 65 more This exception indicates that the EntityManagerFactory has discovered the wrong type. I confirmed this by introspecting the MetaModel, which had loaded the Entity type from persistence unit xa-test-unit-1, not xa-test-unit-2. I have attached the persistence unit descriptors if those are of interest. My *guess* at the source of the problem is that the scanner has found the right file in the bundle, but by the time it comes to be loaded Hibernate has lost the context of which persistence unit the type should be loaded from. If Hibernate just uses the OSGiClassLoaderService then it will find the Entity from whichever persistence unit first registered. I am not sure why this only sometimes fails.

    Hibernate JIRA | 6 months ago | Tim Ward
    org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [public java.lang.Integer org.apache.aries.tx.control.itests.entity.Message.id] by reflection for persistent property [org.apache.aries.tx.control.itests.entity.Message#id] : Message [id=null, message=Hello 1!]
  6. 0

    I have two simple joined entities and next exception when I try to get their property: Hibernate: select tarifklsk0_.ID as ID1_12_0_, tarifklsk0_.FK_TARIF as FK_TARIF2_12_0_, tarifservp1_.FK_TARIF as FK_TARIF2_11_1_, tarifservp1_.ID as ID1_11_1_, tarifservp1_.ID as ID1_11_2_, tarifservp1_.FK_TARIF as FK_TARIF2_11_2_, tarifservp1_.N1 as N3_11_2_ from TR.TARIFXKLSK tarifklsk0_ left outer join TR.TARIF_SERV_PROP tarifservp1_ on tarifklsk0_.FK_TARIF=tarifservp1_.FK_TARIF where tarifklsk0_.ID=? Jun 13, 2016 7:38:26 AM org.hibernate.event.internal.DefaultLoadEventListener doOnLoad INFO: HHH000327: Error performing load command : org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Integer TarifKlsk.fkTarif] by reflection for persistent property [TarifKlsk#fkTarif] : 1027303 Exception in thread "main" org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Integer TarifKlsk.fkTarif] by reflection for persistent property [TarifKlsk#fkTarif] : 1027303 at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:43) ....skipped... Caused by: java.lang.IllegalArgumentException: Can not set java.lang.Integer field TarifKlsk.fkTarif to java.lang.Integer at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) My entities: TarifKlsk import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.BatchSize; @SuppressWarnings("serial") @Entity @Table(name = "TARIFXKLSK", schema="TR") public class TarifKlsk implements java.io.Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", updatable = false, nullable = false) private Integer id; @OneToMany(fetch = FetchType.EAGER) @JoinColumn(name="FK_TARIF", referencedColumnName="FK_TARIF") @BatchSize(size = 50) private Set<TarifServProp> tarifservprop = new HashSet<TarifServProp>(0); @Column(name = "FK_TARIF", updatable = false, nullable = false) private Integer fkTarif; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Set<TarifServProp> getTarifservprop() { return tarifservprop; } public void setTarifservprop(Set<TarifServProp> tarifservprop) { this.tarifservprop = tarifservprop; } public Integer getFkTarif() { return fkTarif; } public void setFkTarif(Integer fkTarif) { this.fkTarif = fkTarif; } } TarifServProp import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @SuppressWarnings("serial") @Entity @Table(name = "TARIF_SERV_PROP", schema="TR") public class TarifServProp implements java.io.Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", updatable = false, nullable = false) private Integer id; @Column(name = "FK_TARIF", updatable = false, nullable = false) private Integer fkTarif; public Integer getId() { return id; } @Column(name = "N1", updatable = false, nullable = false) private Integer n1; public void setId(Integer id) { this.id = id; } public Integer getFkTarif() { return fkTarif; } public void setFkTarif(Integer fkTarif) { this.fkTarif = fkTarif; } public Integer getN1() { return n1; } public void setN1(Integer n1) { this.n1 = n1; } } My test module: public static void main(String[] args) { SessionFactory sf = HibernateUtil.getSessionFactory(); Session sess = sf.openSession(); sess.beginTransaction(); TarifKlsk k2=sess.get(TarifKlsk.class, 1027303); for (TarifServProp t : k2.getTarifservprop()) { System.out.println("Tar="+t.getN1()); } System.out.println("End init"); What am I doing wrong? I've checked all fields of these entities and all of them named properly.... My POM.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.journaldev.hibernate</groupId> <artifactId>HibernateEHCacheExample</artifactId> <version>0.0.1-SNAPSHOT</version> <description>Hibernate Secondary Level Cache Example using EHCache implementation</description> <dependencies> <!-- Hibernate Core API --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>5.1.0.Final</version> </dependency> <!-- EHCache Core APIs --> <!-- http://mvnrepository.com/artifact/net.sf.ehcache/ehcache-core --> <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version>2.6.11</version> </dependency> <!-- http://mvnrepository.com/artifact/org.hibernate/hibernate-ehcache --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> <version>5.2.0.Final</version> </dependency> <!-- EHCache uses slf4j for logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.5</version> </dependency> </dependencies>

    Hibernate JIRA | 6 months ago | Leo
    org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Integer TarifKlsk.fkTarif] by reflection for persistent property [TarifKlsk#fkTarif] : 1027303

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.property.access.spi.PropertyAccessException

      Error accessing field [private java.lang.String MyEmbeddableId.foo] by reflection for persistent property [MyEmbeddableId#foo] : MyEmbeddableId@33675787

      at org.hibernate.property.access.spi.GetterFieldImpl.get()
    2. org.hibernate.property
      GetterFieldImpl.get
      1. org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:71)
      1 frame
    3. Hibernate
      ComponentType.getHashCode
      1. org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58)
      2. org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:414)
      3. org.hibernate.type.ComponentType.getHashCode(ComponentType.java:225)
      3 frames
    4. A Hibernate O/RM Module
      TypeEquivalance.hashCode
      1. org.hibernate.cache.infinispan.TypeEquivalance.hashCode(TypeEquivalance.java:24)
      1 frame
    5. Infinispan Commons
      BoundedEquivalentConcurrentHashMapV8.get
      1. org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8.get(BoundedEquivalentConcurrentHashMapV8.java:2427)
      1 frame
    6. Infinispan Core
      AbstractDelegatingCache.get
      1. org.infinispan.container.DefaultDataContainer.get(DefaultDataContainer.java:188)
      2. org.infinispan.container.EntryFactoryImpl.innerGetFromContainer(EntryFactoryImpl.java:288)
      3. org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:258)
      4. org.infinispan.container.EntryFactoryImpl.wrapEntryForReading(EntryFactoryImpl.java:64)
      5. org.infinispan.interceptors.EntryWrappingInterceptor.visitDataReadCommand(EntryWrappingInterceptor.java:132)
      6. org.infinispan.interceptors.EntryWrappingInterceptor.visitGetKeyValueCommand(EntryWrappingInterceptor.java:123)
      7. org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)
      8. org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
      9. org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:113)
      10. org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85)
      11. org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)
      12. org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
      13. org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitDataReadCommand(PessimisticLockingInterceptor.java:71)
      14. org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitGetKeyValueCommand(AbstractLockingInterceptor.java:77)
      15. org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)
      16. org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
      17. org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:345)
      18. org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:330)
      19. org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)
      20. org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
      21. org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107)
      22. org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76)
      23. org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85)
      24. org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40)
      25. org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
      26. org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:411)
      27. org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:403)
      28. org.infinispan.cache.impl.AbstractDelegatingCache.get(AbstractDelegatingCache.java:286)
      28 frames
    7. A Hibernate O/RM Module
      ReadOnlyAccess.get
      1. org.hibernate.cache.infinispan.access.InvalidationCacheAccessDelegate.get(InvalidationCacheAccessDelegate.java:61)
      2. org.hibernate.cache.infinispan.entity.ReadOnlyAccess.get(ReadOnlyAccess.java:44)
      2 frames
    8. Hibernate
      SessionImpl.list
      1. org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:32)
      2. org.hibernate.event.internal.DefaultLoadEventListener.getFromSharedCache(DefaultLoadEventListener.java:651)
      3. org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:595)
      4. org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:462)
      5. org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219)
      6. org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278)
      7. org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)
      8. org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)
      9. org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1218)
      10. org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1101)
      11. org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639)
      12. org.hibernate.type.EntityType.resolve(EntityType.java:431)
      13. org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:151)
      14. org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
      15. org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1146)
      16. org.hibernate.loader.Loader.processResultSet(Loader.java:1005)
      17. org.hibernate.loader.Loader.doQuery(Loader.java:943)
      18. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
      19. org.hibernate.loader.Loader.doList(Loader.java:2615)
      20. org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2460)
      21. org.hibernate.loader.Loader.list(Loader.java:2422)
      22. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502)
      23. org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
      24. org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
      25. org.hibernate.internal.SessionImpl.list(SessionImpl.java:1458)
      25 frames
    9. org.hibernate.query
      AbstractProducedQuery.list
      1. org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1426)
      2. org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1398)
      2 frames