0 Replies Latest reply on Jul 19, 2007 10:59 AM by SUNDARRAJAN SUYAMBOO

    Classcastexception

    SUNDARRAJAN SUYAMBOO Newbie

      Hi,
      I am using the simple insert/retrieval against postgres using hibernate 3.1rc1 and jboss 4.0.3SP1.

      My hbm.xml is below,<hibernate-mapping>





















      </hibernate-mapping>

      I am able to successfully store data , but during retrieval it throws java.lang.ClassCastException.

      OrderDTO orderdto = null;
      try{
      orderdto=(OrderDTO) retrieveObj(OrderDTO.class, id);
      } catch (ClassCastException e){
      e.printStackTrace();
      }

      When I checked the following,
      retObject instanceof OrderDTO) this line returns false
      retObject.getClass().getName() returns com.xpe.ecommerce.order.model.OrderDTO

      Can anyone give a hint? Is this because of reflection failure?

      Thanks
      Sun