0 Replies Latest reply on Feb 29, 2004 1:17 PM by getagrip

    hibernate class cast problem

    getagrip

      I do the following as stated in the documentation:
      Context ctx = new InitialContext();
      SessionFactory factory = (SessionFactory)ctx.lookup("java:/DefaultDS");

      However the second line throws a ClassCastException because ctx.lookup
      returns an Object of type: org.jboss.resource.adapter.jdbc.WrapperDataSource

      so all I can do is:
      DataSource ds = (DataSource)ctx.lookup("java:/DefaultDS");

      How can I obtain a SessionFactory then?