0 Replies Latest reply on Feb 12, 2003 7:28 PM by Sham

    Hibernate Mapping Exception

    Sham Newbie


      I am using Jboss and Hibernate together. My bean looks like

      Datastore ds = Hibernate.createDatastore().storeFile("D:/jboss/bin/mymapping.hbm.xml");
      System.out.println("Enter 2nd Line");

      Context ctx = new InitialContext();
      System.out.println("Enter 1st Line");
      SessionFactory sf = (SessionFactory) ctx.lookup("java:/HibernateFactory");
      System.out.println("Enter 2nd Line");
      Session sess = sf.openSession();
      System.out.println("Enter 3rd Line");
      User user = (User)sess.load(User.class, new Long(10));

      It didnt execute the sf.openSession() as I am getting an error
      cirrus.hibernate.MappingException: Resource: D:/jboss/bin/mymapping.hbm.xml not found
      (My Jboss dir is D:/jboss and mapping in the bin folder)
      I have my mapping file in the same BIN folder and error occurred. How do this come?

      PS:- while loading the hibernate-service.xml i got the following message

      22:13:50,670 INFO [DatastoreImpl] Mapping resource: D:\jbossbin\mymapping.hbm.xml
      22:14:13,630 INFO [HibernateServiceMBean] Could not build SessionFactory using the MBean classpath - will try again using client classpath

      Thanks in Advance,