Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3736

JBoss AS 4.0.5.CR1 does not include jaxen, which is required for using Hibernate XML mapping

XMLWordPrintable

    • Workaround Exists
    • Hide

      Copy the jaxen-1.1-beta-7.jar to the server/default/lib (or other server configuration's lib directory).

      Show
      Copy the jaxen-1.1-beta-7.jar to the server/default/lib (or other server configuration's lib directory).

      Hibernate XML mapping requires using the org.dom4j.Document, as shown in this example:

      org.dom4j.Document document = saxReader.read(inputXML);

      List users = document.selectNodes("//product");

      try {

      Session session = HibernateUtil.sessionFactory.openSession();

      Transaction transaction = session.beginTransaction();
      Session dom4jSession = session.openSession(EntityMode.DOM4J);

      Iterator iter = users.iterator();
      while (iter.hasNext())

      { Object next = iter.next(); dom4jSession.saveOrUpdate("demo.Product", next ); }

      // end while
      transaction.commit();
      session.close();

      If any other type of Document is used for the dom4jSession.saveOrUpdate() call, it throws an exception.

      Using SAXReader.read() throws a NoClassDefFound error using JBoss 4.0.5.CR1, unless jaxen (jaxen-1.1-beta-7.jar from the Hibernate 3.2.cr4 download) is added the the server configuration's lib directory.

      I submit that jaxen is required to use the XML Mapping facility of Hibernate, and that it's missing from JBoss 4.0.5.CR1.

              dandread1@redhat.com Dimitrios Andreadis
              proudchief_jira Don Smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: