2 Replies Latest reply on Jul 30, 2005 11:09 AM by Aaron

    hibernate class not found?

    luis valenzuela Newbie

      Just a simple question, just starting out with jboss and hibernate so be gentle.

      I currently have two hibernate classes in my har file which share a <many-to-one> association, but hibernate doesn't seem to recognise the classes unless they are in the same package.

      When I try to deploy the two classes in separate packages in the same har file, I get a class not found exception even though the class has been mapped.

      Not a big problem but I really wanted to keep each class in a separate package for readabilty when the number of classes increases.

      here's the output

      12:41:47,171 INFO [Configuration] Searching for mapping documents in jar: user.har
      12:41:47,171 INFO [Configuration] Found mapping documents in jar: com/uni/address/Address.hbm.xml
      12:41:47,187 INFO [Binder] Mapping class: com.uni.address.Address -> Address
      12:41:47,187 INFO [Configuration] Found mapping documents in jar: com/uni/student/Student.hbm.xml
      12:41:47,187 INFO [Binder] Mapping class: com.uni.student.Student -> Student
      12:41:47,218 ERROR [Configuration] Could not compile the mapping document
      net.sf.hibernate.MappingException: Could not find class: Address

      and here's the association in the student.hbm.xml file

      <many-to-one name="address"