Problem with cast - javassist_236 cannot be cast to
jsam Aug 27, 2013 4:51 PMHi everybody!
This is my first time here, and I apologize if my question has already been solved before, or is a stupid question. But I'm learning to develop. I searched for a solution to my problem and have not found in this site.
I have this code, to do a cast:
setRegraRepasse((RegraRepasse) (ligacaoPbx.getRegraRepasse()));
But, i'm receiving this log:
java.lang.ClassCastException: br.com.istmo.sbm.billing.regra.RegraAbstract_$$_javassist_236 cannot be cast to br.com.istmo.sbm.billing.regra.RegraRepasse
at br.com.istmo.framework.core.jms.DespachadorDeObjetos.processar(DespachadorDeObjetos.java:22)
at br.com.istmo.sbm.billing.ejb.ProcessadorDeMenssagemDespachavelMDB.execute(ProcessadorDeMenssagemDespachavelMDB.java:36)
at br.com.istmo.sbm.billing.ejb.ProcessadorDeMenssagemDespachavelMDB.execute(ProcessadorDeMenssagemDespachavelMDB.java:18)
at br.com.istmo.framework.core.ejb.ObjectMessageMDB.execute(ObjectMessageMDB.java:25)
at br.com.istmo.framework.core.ejb.AbstractMessageMDB.onMessage(AbstractMessageMDB.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at br.com.istmo.framework.core.ejb.OpenHibernateSessionInterceptor.prepareToUsehibernate(OpenHibernateSessionInterceptor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
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.ejb3.tx.BMTInterceptor.handleStateless(BMTInterceptor.java:71)
at org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:131)
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.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:249)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
at com.sun.proxy.$Proxy87.onMessage(Unknown Source)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:906)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
at java.lang.Thread.run(Thread.java:724)
I have a abstract class called RegraAbstract that implements an interface, and i have two sub class that extend RegraAbstract
This problem could be something related with some problem of mapping or configuration?
If something can help me, i thank.