java.lang.ClassCastException: java.lang.String

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.

  • Trying to use the SelectGenerator as Primary ID of record is populated via a trigger and getting the following error. java.lang.String java.lang.ClassCastException: java.lang.String at org.hibernate.type.LongType.set(LongType.java:40) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44) at org.hibernate.id.SelectGenerator.bindParameters(SelectGenerator.java:51) at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:41) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2149) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:238) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:158) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424) .......... I narrowed this down to the fact that the code assumes that the uniqueKeyPropertyType is the same type as the ID. I personally think that this is slightly restrictive and so have amended the code accordingly. ............. The next thrown exception is as follows: java.sql.SQLException: ResultSet.next was not called at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:3202) at oracle.jdbc.driver.OracleStatement.getLongValue(OracleStatement.java:4341) at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:529) at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1540) at org.hibernate.type.LongType.get(LongType.java:26) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68) at org.hibernate.id.SelectGenerator.getResult(SelectGenerator.java:57) at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:44) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2149) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:238) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:158) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424) at hsbc.greaterniku.model.RITFTest.testCreateRITF(RITFTest.java:56) 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:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) 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.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:656) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:558) .................. Obviously this is because ResultSet.next isn't being called ;-) I have amended the code again but am not totally convinced that I have put the rs.next() call in the correct place. Please accept my apologies if I have not posted this in the correct way, but this is the first time I have contributed to an Opensource project.
    via by Malcolm Green,
  • Trying to use the SelectGenerator as Primary ID of record is populated via a trigger and getting the following error. java.lang.String java.lang.ClassCastException: java.lang.String at org.hibernate.type.LongType.set(LongType.java:40) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44) at org.hibernate.id.SelectGenerator.bindParameters(SelectGenerator.java:51) at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:41) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2149) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:238) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:158) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424) .......... I narrowed this down to the fact that the code assumes that the uniqueKeyPropertyType is the same type as the ID. I personally think that this is slightly restrictive and so have amended the code accordingly. ............. The next thrown exception is as follows: java.sql.SQLException: ResultSet.next was not called at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:3202) at oracle.jdbc.driver.OracleStatement.getLongValue(OracleStatement.java:4341) at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:529) at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1540) at org.hibernate.type.LongType.get(LongType.java:26) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68) at org.hibernate.id.SelectGenerator.getResult(SelectGenerator.java:57) at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:44) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2149) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:238) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:158) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424) at hsbc.greaterniku.model.RITFTest.testCreateRITF(RITFTest.java:56) 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:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) 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.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:656) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:558) .................. Obviously this is because ResultSet.next isn't being called ;-) I have amended the code again but am not totally convinced that I have put the rs.next() call in the correct place. Please accept my apologies if I have not posted this in the correct way, but this is the first time I have contributed to an Opensource project.
    via by Malcolm Green,
  • Spring hibernate template list as a parameter
    via Stack Overflow by Hurda
    ,
  • idBag Generator Class Cast Exception
    via Stack Overflow by Draukadin
    ,
  • I have the following hierarchy of entities MedicalPersonnel (abstract class) (InheritanceType.JOINED) >--- Nurse (concret class) >--- Physician (concrett class) and relation MedicalPersonnel (OneToMany) MedicalDoc When I've tried MedicalPersonnel mp; /* get a persisted and detached instance of MedicalPersonnel and assign with mp */ mp = em.merge(mp); //ClassCastException Error stack trace: Exception in thread "main" javax.ejb.EJBException: java.lang.ClassCastException: ro.iqbyte.arhimed.model.core.common.entities.adm.Nurse at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227) at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106) at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239) Caused by: java.lang.ClassCastException: ro.iqbyte.arhimed.model.core.common.entities.adm.Nurse at org.hibernate.type.LongType.set(LongType.java:42) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65) at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1514) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1576) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.loadEntity(Loader.java:1785) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85) at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1565) at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365) at org.hibernate.type.EntityType.resolve(EntityType.java:306) at org.hibernate.type.EntityType.replace(EntityType.java:207) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:431) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:282) at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:246) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:99) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:51) at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:679) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:663) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:667) at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:201) at org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:181) at com.titan.services.TitanServiceBean.visitNurse(TitanServiceBean.java:122) at com.titan.services.TitanServiceBean.visitMedicalPersonnel(TitanServiceBean.java:116) 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:585) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112) at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166) at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227) at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106) at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239) at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:190) at org.jboss.remoting.Client.invoke(Client.java:525) at org.jboss.remoting.Client.invoke(Client.java:488) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:78) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88) at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102) at $Proxy0.visitMedicalPersonnel(Unknown Source) at ro.iqbyte.arhimed.model.teste.Main.visitMedicalPersonnel(Main.java:196) at ro.iqbyte.arhimed.model.teste.Main.main(Main.java:71)
    via by Antonel Pazargic,
  • I'm using Hibernate EntityManager 3.2CR2 inside JBoss EJB3 CR9. I'm invoking em.merge() with a detached object. The detached object has a 1:1 relationship with another detached object. The fetch strategy is the default strategy for 1:1 relationships. However, merge() fails and yields the stack trace below. When I enforce loading the referenced (and also detached) object, e.g. by em.find(), then there is no problem in invoking merge() afterwards. javax.ejb.EJBException: java.lang.ClassCastException: de.hska.kundenverwaltung.db.Firmenkunde at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:167) at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78) at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263) at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106) at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239) Caused by: java.lang.ClassCastException: de.hska.kundenverwaltung.db.Firmenkunde at org.hibernate.type.LongType.set(LongType.java:42) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65) at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1513) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1575) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.loadEntity(Loader.java:1784) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85) at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1581) at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365) at org.hibernate.type.EntityType.resolve(EntityType.java:306) at org.hibernate.type.EntityType.replace(EntityType.java:207) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:437) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:340) at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:267) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:120) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53) at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
    via by Juergen Zimmermann,
    • java.lang.ClassCastException: java.lang.String at org.hibernate.type.LongType.set(LongType.java:40) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62) at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44) at org.hibernate.id.SelectGenerator.bindParameters(SelectGenerator.java:51) at org.hibernate.id.AbstractPostInsertGenerator.getGenerated(AbstractPostInsertGenerator.java:41) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2149) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:238) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:158) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:104) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:429) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:424)

    Users with the same issue

    mortalman7
    mortalman71 times, last one,