org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.metadata.onetoone.SerialNumberPk.brand

Hibernate JIRA | Emmanuel Bernard | 1 decade ago
  1. 0

    I'm probably blind, but I can't find the problem. I have a onetoone assocation between classes having a composite pk (through pk classes) (see attachment) And I get a org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.metadata.onetoone.SerialNumberPk.brand at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:117) at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:169) at org.hibernate.engine.EntityKey.hashCode(EntityKey.java:55) at java.util.HashMap.hash(HashMap.java:264) at java.util.HashMap.put(HashMap.java:382) at java.util.HashSet.add(HashSet.java:194) at org.hibernate.impl.PersistentContext.addNonExist(PersistentContext.java:890) at org.hibernate.impl.SessionImpl.addNonExist(SessionImpl.java:1750) at org.hibernate.loader.Loader.registerNonExists(Loader.java:467) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:275) at org.hibernate.loader.Loader.doQuery(Loader.java:366) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:193) at org.hibernate.loader.Loader.loadEntity(Loader.java:1151) at org.hibernate.loader.EntityLoader.load(EntityLoader.java:111) at org.hibernate.loader.EntityLoader.load(EntityLoader.java:97) at org.hibernate.persister.BasicEntityPersister.load(BasicEntityPersister.java:2304) at org.hibernate.event.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:352) at org.hibernate.event.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:333) at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:158) at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:131) at org.hibernate.event.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:230) at org.hibernate.event.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:114) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:706) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:701) at org.hibernate.test.metadata.onetoone.OneTest.testTest(OneTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.hibernate.test.TestCase.runTest(TestCase.java:131) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused 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 org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:103) ... 48 more

    Hibernate JIRA | 1 decade ago | Emmanuel Bernard
    org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.metadata.onetoone.SerialNumberPk.brand
  2. 0

    I'm probably blind, but I can't find the problem. I have a onetoone assocation between classes having a composite pk (through pk classes) (see attachment) And I get a org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.metadata.onetoone.SerialNumberPk.brand at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:117) at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:169) at org.hibernate.engine.EntityKey.hashCode(EntityKey.java:55) at java.util.HashMap.hash(HashMap.java:264) at java.util.HashMap.put(HashMap.java:382) at java.util.HashSet.add(HashSet.java:194) at org.hibernate.impl.PersistentContext.addNonExist(PersistentContext.java:890) at org.hibernate.impl.SessionImpl.addNonExist(SessionImpl.java:1750) at org.hibernate.loader.Loader.registerNonExists(Loader.java:467) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:275) at org.hibernate.loader.Loader.doQuery(Loader.java:366) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:193) at org.hibernate.loader.Loader.loadEntity(Loader.java:1151) at org.hibernate.loader.EntityLoader.load(EntityLoader.java:111) at org.hibernate.loader.EntityLoader.load(EntityLoader.java:97) at org.hibernate.persister.BasicEntityPersister.load(BasicEntityPersister.java:2304) at org.hibernate.event.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:352) at org.hibernate.event.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:333) at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:158) at org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:131) at org.hibernate.event.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:230) at org.hibernate.event.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:114) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:706) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:701) at org.hibernate.test.metadata.onetoone.OneTest.testTest(OneTest.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.hibernate.test.TestCase.runTest(TestCase.java:131) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused 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 org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:103) ... 48 more

    Hibernate JIRA | 1 decade ago | Emmanuel Bernard
    org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.hibernate.test.metadata.onetoone.SerialNumberPk.brand
  3. 0

    Look at JBoss cvs head under the unit test ejbthree-316. Run the test twice and you will see the problem. Here is what happens: Extended PC being passivated by a SFSB: 1. persist a Customer 2. SFSB times out and gets passivated. Session is passivated as well 3. Find the customer This works on first pass, but if I redeploy same SFSB/EntityManager combo and run the test again, then I get IllegalStateExceptions at step #3 on the second run of the test. Is Hibernate caching any reflection objects? Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.jboss.ejb3.test.re gression.ejbthree316.Customer.id at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171) at org.hibernate.tuple.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:176) at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3256) at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:46) at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:140) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:97) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.j ava:76) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877) at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:201) at org.jboss.ejb3.entity.ManagedEntityManagerFactory$SessionSynchronization.beforeCompletion(ManagedEntityManagerFac tory.java:89) at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:3032) at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:2590) at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:1177) ... 20 more Caused 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 org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145) ... 34 more

    Hibernate JIRA | 1 decade ago | Bill Burke
    gression.ejbthree316.Customer.id
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    why WS client doesn't work in the same project where WS is ?

    Oracle Community | 1 decade ago | 843833
    java.lang.IllegalArgumentException: object is not an instance of declaring class
  6. 0

    [AXIS-1931] Webservice call results in error "does not match signature" - ASF JIRA

    apache.org | 5 months ago
    java.lang.IllegalArgumentException: object is not an instance of declaring class

    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. java.lang.IllegalArgumentException

      object is not an instance of declaring class

      at sun.reflect.NativeMethodAccessorImpl.invoke0()
    2. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    3. Hibernate
      EntityKey.hashCode
      1. org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:103)
      2. org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:117)
      3. org.hibernate.type.ComponentType.getHashCode(ComponentType.java:169)
      4. org.hibernate.engine.EntityKey.hashCode(EntityKey.java:55)
      4 frames
    4. Java RT
      HashSet.add
      1. java.util.HashMap.hash(HashMap.java:264)
      2. java.util.HashMap.put(HashMap.java:382)
      3. java.util.HashSet.add(HashSet.java:194)
      3 frames
    5. Hibernate
      SessionImpl.addNonExist
      1. org.hibernate.impl.PersistentContext.addNonExist(PersistentContext.java:890)
      2. org.hibernate.impl.SessionImpl.addNonExist(SessionImpl.java:1750)
      2 frames
    6. Hibernate
      EntityLoader.load
      1. org.hibernate.loader.Loader.registerNonExists(Loader.java:467)
      2. org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:275)
      3. org.hibernate.loader.Loader.doQuery(Loader.java:366)
      4. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:193)
      5. org.hibernate.loader.Loader.loadEntity(Loader.java:1151)
      6. org.hibernate.loader.EntityLoader.load(EntityLoader.java:111)
      7. org.hibernate.loader.EntityLoader.load(EntityLoader.java:97)
      7 frames
    7. Hibernate
      SessionImpl.get
      1. org.hibernate.persister.BasicEntityPersister.load(BasicEntityPersister.java:2304)
      2. org.hibernate.event.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:352)
      3. org.hibernate.event.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:333)
      4. org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:158)
      5. org.hibernate.event.DefaultLoadEventListener.load(DefaultLoadEventListener.java:131)
      6. org.hibernate.event.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:230)
      7. org.hibernate.event.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:114)
      8. org.hibernate.impl.SessionImpl.get(SessionImpl.java:706)
      9. org.hibernate.impl.SessionImpl.get(SessionImpl.java:701)
      9 frames
    8. org.hibernate.test
      OneTest.testTest
      1. org.hibernate.test.metadata.onetoone.OneTest.testTest(OneTest.java:40)
      1 frame
    9. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    10. org.hibernate.test
      TestCase.runTest
      1. org.hibernate.test.TestCase.runTest(TestCase.java:131)
      1 frame
    11. com.intellij.rt
      JUnitStarter.main
      1. com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
      1 frame
    12. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    13. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      1 frame