[JBoss Cache: Core Edition] - Re: ava.lang.ClassCastException: java.lang.ClassNotFoundExce
by northgorky
Greetings.
I've done some more runs. One (labeled pause), just sat for about two minutes, and then crashed on the next click. Write through an exception during an update, but continued working, briefly. Then crashed.
If you need more 'Data points', or additional info, let me know. In addition, I am in Texas, and willing to come out to Atlanta, if anyone wants a 'hands on', to through a Debugger on this system.
Steve
Links for additional logs;
http://j2eeguys.com/~steve/JBoss/server.pause.20080326.log
http://j2eeguys.com/~steve/JBoss/server.read.20080326.log
http://j2eeguys.com/~steve/JBoss/server.write.20080326.log
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139069#4139069
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139069
18 years
[EJB 3.0] - JPQL polymorphic query
by juanm_med
I have a class hierarchy of 3 Entities, one of which is the superclass for the others:
@Entity
@Table(name="PER")
@Inheritance(strategy=InheritanceType.JOINED)
@SequenceGenerator(name="SeqIdPer", sequenceName="SEQIDPER")
public abstract class Person implements Serializable {
...
}
@Entity
@Table(name="PHYPER")
@PrimaryKeyJoinColumn(name="IDPHYPER")
public class PhysicalPerson extends Person {
..
}
@Entity
@Table(name="MORALPER")
@PrimaryKeyJoinColumn(name="IDMORALPER")
public class MoralPerson extends Person {
...
}
When I execute the following JPQL:
String strPerQuery = "SELECT OBJECT(per) FROM Person per where per.idPer = ?";
query=em.createQuery(strPerQuery);
query.setParameter(1, idPerson);
Person resPer = (Person)query.getSingleResult();
I get an object of the class Person, but I cannot downcast it to any of the subclasses. For example, even when I know that the person I sought is an instance of PhysicalPerson, the following cast throws a ClassCastException:
PhysicalPerson phyPer = (PhysicalPerson )resPer;
Even more, when I print the runtime class of the object using resPer.getClass(), I get the following class:
mypackage.Person_$$_javassist_16
Shouldn't the query be polymorphic, and return an object of the subclass?
I'm using JBoss 5 beta 4.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139068#4139068
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139068
18 years