After spending three weeks on this problem I finally found the answer. And the answer simply is Container Managed Persistence in JBOSS 7.1.1.Final
for the above project structure i.e. EAR and technologies is broken. It may be working for a WAR I'm not sure. But it doesn't work for an EAR based project.
Upgrade to EAP 6.1.0.Final
+ and it will work.
The difference in the 2 builds is that persistence.xml is read at the beginning by the container in the EAP 6.1.0
build but 7.1.1.Final
never attempts to read persistence.xml
and hence never creates an EntityManagerFactory
.
Hope this would help others.