1 Reply Latest reply on Apr 23, 2009 6:20 PM by frer

    Hibernate Entity Loader with ComponentTest

    frer

      Hi,


      I had a problem with using a s:convertEntity in one of my forms.  I then looked at the following post: My Link


      that helped me fix my problem in my deployed application.  I needed to add the line:


          <ui:hibernate-entity-loader session="persistenceSession"/>
      



      in my components.xml.


      But now, although my deployed application works, when I launch my TestNG tests, I get the following exception:


         [testng] Caused by: java.lang.RuntimeException: Error loading element HibernateEntityLoader with component name null and component class null
         [testng]     at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:352)
         [testng]     at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:227)
         [testng]     ... 18 more
         [testng] ... Removed 15 stack frames



      What am I missing?  Why is the application deploying and running correctly but still when I launch my tests, they fail.  BTW, if I comment the hibernate-entity-loader line, the tests pass.


      Here is the pertinent part of my components.xml:



      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
      ... 
          
          <persistence:hibernate-session-factory name="hibernateSessionFactory" cfg-resource-name="hibernate.cfg.xml" auto-create="true" />
          <persistence:managed-hibernate-session name="persistenceSession" auto-create="true" session-factory="#{hibernateSessionFactory}" />
          
          <ui:hibernate-entity-loader session="persistenceSession"/>
            
      ...
      </components>
      



      Thanks,


      François