JPA EntityManager is not initialized (null)
Im new to JPA
 I generated the following code using reverseEngineering tool (Hibernate).
But the entitymanager always null.
I do not know what to do please guide me. Is there anything that I should add to the persistence.xml? I searched a lot but could not find a suitable clue.
Thanx

    public class ModuleHome{

	private static final Log log = LogFactory.getLog(ModuleHome.class);
	
	@PersistenceContext
	private EntityManager entityManager;

	public void persist(Module transientInstance) {
		log.debug("persisting Module instance");
		try {
			entityManager.persist(transientInstance);
			log.debug("persist successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			System.out.println("Printing,,,,:"+re.getMessage());
			throw re;
		}
	}
	
	public void remove(Module persistentInstance) {
		log.debug("removing Module instance");
		try {
			entityManager.remove(persistentInstance);
			log.debug("remove successful");
		} catch (RuntimeException re) {
			log.error("remove failed", re);
			throw re;
		}
	}

	public Module merge(Module detachedInstance) {
		log.debug("merging Module instance");
		try {
			Module result = entityManager.merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public Module findById(int id) {
		log.debug("getting Module instance with id: " + id);
		try {
			Module instance = entityManager.find(Module.class, id);
			log.debug("get successful");
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			System.out.println("Error: "+re.getMessage());
			throw re;
		}
	}
}





and my persistance.xml is

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<persistence-unit name="CI_Monitor" transaction-type="JTA">
	
	<jta-data-source>java:MSSQL2008</jta-data-source>	
	<properties>
    		
          <property name="hibernate.archive.autodetection" value="class, hbm"/>
		  
	  <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
          <property name="hibernate.connection.url" value="jdbc:sqlserver://CSLK-CISVR\\CISVR:1433"/>
          <property name="hibernate.connection.username" value="username"/>
          <property name="hibernate.connection.password" value="pwd"/>
          
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

		
		 	
          <property name="hibernate.show_sql" value="true"/>
          <property name="hibernate.format_sql" value="true"/>
          <property name="use_sql_comments" value="true"/>

          <property name="hibernate.c3p0.min_size"
                    value="5"/>
          <property name="hibernate.c3p0.max_size"
                    value="20"/>
          <property name="hibernate.c3p0.timeout"
                    value="300"/>
          <property name="hibernate.c3p0.max_statements"
                    value="50"/>
          <property name="hibernate.c3p0.idle_test_period"
                    value="3000"/>
	  <property name="hibernate.dialect"
                    value="org.hibernate.dialect.SQLServerDialect"/>
	
	 <property name="hibernate.hbm2ddl.auto" value="update" /> 
      </properties>
   </persistence-unit>
</persistence>


please Im waiting for a help...
JPA EntityManager is not initialized (null)
===

Im new to JPA
 I generated the following code using reverseEngineering tool (Hibernate).
But the entitymanager always null.
I do not know what to do please guide me. Is there anything that I should add to the persistence.xml? I searched a lot but could not find a suitable clue.
Thanx

    public class ModuleHome{

	private static final Log log = LogFactory.getLog(ModuleHome.class);
	
	@PersistenceContext
	private EntityManager entityManager;

	public void persist(Module transientInstance) {
		log.debug("persisting Module instance");
		try {
			entityManager.persist(transientInstance);
			log.debug("persist successful");
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			System.out.println("Printing,,,,:"+re.getMessage());
			throw re;
		}
	}
	
	public void remove(Module persistentInstance) {
		log.debug("removing Module instance");
		try {
			entityManager.remove(persistentInstance);
			log.debug("remove successful");
		} catch (RuntimeException re) {
			log.error("remove failed", re);
			throw re;
		}
	}

	public Module merge(Module detachedInstance) {
		log.debug("merging Module instance");
		try {
			Module result = entityManager.merge(detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

	public Module findById(int id) {
		log.debug("getting Module instance with id: " + id);
		try {
			Module instance = entityManager.find(Module.class, id);
			log.debug("get successful");
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			System.out.println("Error: "+re.getMessage());
			throw re;
		}
	}
}





and my persistance.xml is

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
	<persistence-unit name="CI_Monitor" transaction-type="JTA">
	
	<jta-data-source>java:MSSQL2008</jta-data-source>	
	<properties>
    		
          <property name="hibernate.archive.autodetection" value="class, hbm"/>
		  
	  <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
          <property name="hibernate.connection.url" value="jdbc:sqlserver://CSLK-CISVR\\CISVR:1433"/>
          <property name="hibernate.connection.username" value="username"/>
          <property name="hibernate.connection.password" value="pwd"/>
          
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

		
		 	
          <property name="hibernate.show_sql" value="true"/>
          <property name="hibernate.format_sql" value="true"/>
          <property name="use_sql_comments" value="true"/>

          <property name="hibernate.c3p0.min_size"
                    value="5"/>
          <property name="hibernate.c3p0.max_size"
                    value="20"/>
          <property name="hibernate.c3p0.timeout"
                    value="300"/>
          <property name="hibernate.c3p0.max_statements"
                    value="50"/>
          <property name="hibernate.c3p0.idle_test_period"
                    value="3000"/>
	  <property name="hibernate.dialect"
                    value="org.hibernate.dialect.SQLServerDialect"/>
	
	 <property name="hibernate.hbm2ddl.auto" value="update" /> 
      </properties>
   </persistence-unit>
</persistence>


please Im waiting for a help...