Try changing the datasource name to something like "java:jboss/acmeDatasource" and your persistence.xml might need to move.
https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide mentions the valid locations:
- an EJB-JAR file
- the WEB-INF/classes directory of a WAR file
- a jar file in the WEB-INF/lib directory of a WAR file
- a jar file in the EAR library directory
- an application client jar file
That is just a guess, let us know where your persistence.xml is packaged in your app.
Thanks Scott. My persistence.xml is in an ejb-jar file. The jar file containing the entities are in the ear/lib directory. And the datasource is bound under java namespace....
From looking at the information in the above paste link, it looks like Hibernate is not able to scan the entities from the JAR URLS
Jar files URLs [
Managed classes names 
Clearly this is a bug that should be fixed somehow. I'm not sure yet how.
It would be nice if we could reproduce the issue with the jarfile unit test https://github.com/jbossas/jboss-as/tree/master/testsuite/integration/src/test/java/org/jboss/as/test/integration/jpa/jarfile...
To help investigate a little deeper with your application deployment, could you do a few things. AS 7.0.2 has a bug that prevents TRACE logging from being enabled, that is fixed in the nightly AS7 build (community.jboss.org/thread/167590).
Could you download the nightly build, enable JPA TRACE logging and try to deploy your application. Instructions for enabling TRACE logging are here https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide.
Please show the server.log with TRACE logging enabled. Even if you end up with TRACE logging for everything enabled, I'd still like to see the output.
Could you also create a JPA JIRA (bug report) for this in https://issues.jboss.org/browse/AS7? You should get credit for finding the issue. If not, I can create it. Let me know.
Thanks for reporting this.
Output from 'grep "TRACE \[org\.jboss\.jpa\]" ' is here http://pastie.org/2805026. It looks like we are having trouble scanning for entities from the jars.
Which tool did you use to generate the jarFiles?
Nothing special. The whole project is based on maven...I'm also using Arquillian for testing. In that case the entities are directly bundled in the archive (no jar-lib), and in it's working perfectly.
I wonder if it would recreate in your unit test or the as7 one https://github.com/jbossas/jboss-as/tree/master/testsuite/integration/src/test/java/org/jboss/as/test/integration/jpa/jarfile.
Example of packaging an EAR is here https://github.com/jbossas/jboss-as/blob/master/testsuite/integration/src/test/java/org/jboss/as/test/integration/jpa/packaging/PersistenceUnitPackagingTestCase.java if you want to try reproducing. I'm thinking we should probably try to reproduce in the previously linked (jarfile) test. If you want to do that or try locally, it would be good to know if it does recreate with Arquillian.
Otherwise, we will have to debug with a standalone test case.
I'm looking at the code again, to see if I can find the bug. The trace information is helpful but not sure if I will have enough information yet.
Another way, would be if I add more TRACE logging messages and point you to my GIT repo and you could build AS7 from sources, reproduce with your EAR and give me the output.
I already added an additional TRACE logging message that should help.