Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-216

hbm.xml hibernate files not deployed...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • EJB 3.0 RC1
    • EJB 3.0 Beta 1
    • None
    • None

      I started with hibernate files (.java and .hbm.xml) which I wanted to deploy on jboss using ejb3. There were no annotations on any of the Java objects.
      If I am correct, jboss should read the hibernate files when the .par or .ejb3 is deployed.
      When deploying a .par or .ejb3 with hbm.xml files, none of the hbm.xml files were being inspected. This kept resulting in a deploytime complaint on the command line console about a NULL entitymanagerfactory.

      The work around was to create a 'dummy' object with the @Entity annotation. On finding this the ejb3 deployer then behaved as expected.
      The cause appears to be found in the org.jboss.ejb3.Ejb3Module.java file.
      The list hbmXmlFiles is successfully loaded in the method create service with .hbm.xml files found by the archive browser.
      Later, in the method deploy(), the 'entities' list is loaded ONLY if an @Entity annotated object is found.
      Finally, in the method initializeManagedEntityManagerFactory() the entity manager factory is loaded with the discovered .hbm.xml files ONLY IF the check 'if (entities.size() == 0) return;' fails. This can only occur if an @Entity annotated object was found in the .par (or .ejb3).

      To be honest I have no idea if this is correct or incorrect behaviour or if this really is a new issue (I couldnt find anything else about it on JIRA) and I'm not an expert by any means. Just hope it helps.

            patriot1burke@gmail.com Bill Burke (Inactive)
            nct_jira Naveen Thakur (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: