Resource Injection Problem

I have a problem to use JSF 1.2 with JPA in Tomcat 6.

Originally this project was using JSF 1.2 on Sun Application Server/Glassfish. This project also uses Java Persistent API to store data. There is a managed bean in request scope that uses the resource injection as follows:

@PersistenceContext(unitName="MyProjectPU")

private EntityManager em;

This project works fine on Sun Application Server/Glassfish.

Now I installed NetBeans 6.0M9 and Tomcat 6.0.13, and tried to deploy this project on Tomcat 6.0.13, but failed. I got NullPointer exception where em was used. It seemed that the resource injection did not work.

I had downloaded JSF 1.2_04-b10-p01, and put jars on TOMCAT/lib. The release notes of JSF 1.2_04 said it supports resource injection on Tomcat 6. However I'm not sure whether it only supports @Resource not JPA.

Do I need to install other jars to make it work?

[931 byte] By [lancelot.huanga] at [2007-11-27 5:10:45]
# 1
The release notes state:"Just drop in the JARs and leverage the resource injections that the container itself supports."Most likely Tomcat doesn't support that injection. If you want to use JPA and injections, I'd recommend using GlassFish as your container.
rlubkea at 2007-7-12 10:30:58 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...