-
1. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 2, 2011 7:04 PM (in response to garcimouche)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.
Scott
-
2. Re: JPA Entities scanning issue (jar-file in persistence.xml)
garcimouche Nov 2, 2011 10:01 PM (in response to smarlow)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....
-
3. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 2, 2011 11:05 PM (in response to garcimouche)Can you show us the contents of the as7/standalone/log/server.log (http://pastie.org is fine).
-
4. Re: JPA Entities scanning issue (jar-file in persistence.xml)
garcimouche Nov 3, 2011 9:29 AM (in response to smarlow)sure
(I remove the weld service startup at the end to avoid exceeding limit)
-
5. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 9:55 AM (in response to garcimouche)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 [
vfs:/content/acmeapp-ear.ear/lib/acmeapp-release-domain-0.0.1-SNAPSHOT.jar/
vfs:/content/acmeapp-ear.ear/lib/acmeapp-lvs-domain-0.0.1-SNAPSHOT.jar/
vfs:/content/acmeapp-ear.ear/lib/acmeapp-rmd-domain-0.0.1-SNAPSHOT.jar/
vfs:/content/acmeapp-ear.ear/lib/acmeapp-cbsa-domain-0.0.1-SNAPSHOT.jar/
vfs:/content/acmeapp-ear.ear/lib/acmeapp-parties-domain-0.0.1-SNAPSHOT.jar/]
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...
-
6. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 10:07 AM (in response to smarlow)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.
Scott
-
7. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 10:21 AM (in response to smarlow)Franck,
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.
Scott
-
8. Re: JPA Entities scanning issue (jar-file in persistence.xml)
garcimouche Nov 3, 2011 10:37 AM (in response to smarlow)done here https://issues.jboss.org/browse/AS7-2497.
I'm downloading nightly build and keep you posted.
Thanks!
-
9. Re: JPA Entities scanning issue (jar-file in persistence.xml)
garcimouche Nov 3, 2011 11:21 AM (in response to smarlow)I've downloaded the file jboss-7.0.x.zip but in the archive this is the jboss-as-7.1.0.Alpha2-SNAPSHOT version!
Anyway I attache here the log opened up to the TRACE level.
-
server.log.zip 588.6 KB
-
-
10. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 11:42 AM (in response to garcimouche)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?
jarFiles[
lib/acmeapp-release-domain-0.0.1-SNAPSHOT.jar
lib/acmeapp-lvs-domain-0.0.1-SNAPSHOT.jar
lib/acmeapp-rmd-domain-0.0.1-SNAPSHOT.jar
lib/acmeapp-cbsa-domain-0.0.1-SNAPSHOT.jar
lib/acmeapp-parties-domain-0.0.1-SNAPSHOT.jar
]
-
11. Re: JPA Entities scanning issue (jar-file in persistence.xml)
garcimouche Nov 3, 2011 11:51 AM (in response to smarlow)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.
-
12. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 11:59 AM (in response to garcimouche)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.
-
13. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 12:09 PM (in response to smarlow)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.
-
14. Re: JPA Entities scanning issue (jar-file in persistence.xml)
smarlow Nov 3, 2011 12:23 PM (in response to smarlow)Franck,
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.
Scott