I am running jboss-4.0.1sp1 with the ejb3 preview under 1.5.0_02. I have a simple webapp running and am trying to use the EJB3 CMP from within a DAO pattern. Everything is running in the same vm and Im using the built in hypersonic db.
Once I startup jboss, my EJB deploys ok (at least, there are no exceptions thrown and nothing logged at the INFO level to indicate a problem). Have also deployed the Entity tutorial and from ANT, can make it run so I think the running jboss is configured correctly.
Here is the code I have problems with:
import javax.ejb.Inject;
import javax.persistence.EntityManager;
import com.dmd.ratecalc.LoanCalculation;
public class LoanCalculatorDao {
@Inject
private EntityManager manager;
public void store(LoanCalculation lc) throws Exception {
manager.persist(lc);
}
}
Stepping through the store(..) method, the manager field is null (I am running under eclipse but I have tried to run outside eclipse and get the same null prt exception).
Any ideas? Below is some of the console output:
15:21:48,821 INFO [Ejb3Module] found EJB3 Entity bean: com.dmd.ratecalc.LoanCalculation
15:21:49,571 INFO [Ejb3Module] EJB3 deployment time took: 1578
15:21:49,603 INFO [Ejb3Module] EJB3 jar using default hibernate.properties: {hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.hbm2ddl.auto=create-drop, hibernate.connection.datasource=java:/DefaultDS, hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory}
15:21:52,134 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.1sp1/server/all/deploy/dmd.ejb3