Thank you for your reply.
In deployment time, I get:
Could not resolve a persistence unit corresponding to the persistence-unit-ref-name [x] in scope of the module called [y]. Please verify your application.
The only programs need to access the PU under web-inf/lib is in the same jar file as the PU. The web application has it own PU and all codes use that PU.
[Message sent by forum member 'bobxu' (bobxu)]
http://forums.java.net/jive/thread.jspa?messageID=315267