4 Replies Latest reply on Sep 8, 2006 9:39 AM by Chua Khoon Yong

    Seam + Portlet + EntityManager

    Chua Khoon Yong Novice

      dear all,

      I got some problems with Entity Manager and still troubleshooting, hope you could help.

      What i did was to make a sample war file by piecing the seam examples together:

      1. First use example/portal and add facelets and tomahawk support

      2. Modify to include EJB3 (changing component.xml, persistence.xml, jboss-beans, ejb-jar.xml). I refer to example/issues for the EJB3 portion.

      I encountered problem when retrieving the entitymanager which seems to be null after i compare variable "em" with null.

      @PersistenceContext(unitName="entityManager")
      private EntityManager em;


      I couldn't find whats wrong with those xml files (which is reference from example/issues)

      (1) I would like to ask if we would deploy EJB3 using WAR file?
      See http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/entityconfig.html
      section 3.3.

      If this is the case, then how to deploy portlet using EAR file, so that could use EJB3. What happens to the context root for application.xml?

      (2) Or deploy with 2 files: EJB3 in EAR and another WAR file for the web?

      I'm still new to JBoss so please bear with me if i ask simply questions.

      By the way, my main purpose is to use seam + portlet + facelets + tomahawk + ejb3. Best if someone can give a sample on this :)

      Many thanks.