java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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
    via by Emmanuel Bernard,
  • 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
    via by Bill Burke,
  • 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
    via by Emmanuel Bernard,
  • Consume a simple web service using mule
    via Stack Overflow by user2714010
    ,
    • 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)

    Users with the same issue

    tvrmsmith
    2 times, last one,
    Unknown User
    2 times, last one,
    bernardpaulus
    1 times, last one,
    Unknown visitor1 times, last one,
    Nikolay Rybak
    8 times, last one,
    74 more bugmates