I have two classes in my project Document and BigDocument, both are mapping with inheritance in the logic way with Hibernate. On the other hand I don't use any MVC framework so I use only plain servlets, for this reason I extend my servlets from FrameworkServlet which give me the WebAplicationContext for working with my beans in the context.xml file.
Everything works fine when I use the base class Document, but when I use the child BigDocument I get a ClasCastException error.... pls help me!
Consider the following code:
In the last line I get the ClassCastException....., this error don't happen when I test this code in a main method. :shock:
GestorCartera gestorCartera = (GestorCartera) getWebApplicationContext().getBean("gestorCartera");
Documento documento = gestorCartera.seleccionarDocumento(18094818096L);
BigDocument bigDocument = (BigDocument )documento;