-
1. Re: JBoss AS7 cannot find my persistence.xml
ozizka Jan 13, 2012 9:37 PM (in response to kc7bfi)DS souns like ur passing datasource name. EMF takes persistence unit name.
-
2. Re: JBoss AS7 cannot find my persistence.xml
alesj Jan 14, 2012 1:59 PM (in response to kc7bfi)Any idea what I might be doing wrong? Why it first finds the persistence.xml file but then fails to find it on the classpath?
Are you bundling the JPA impl with your app?
-
3. Re: JBoss AS7 cannot find my persistence.xml
kc7bfi Jan 14, 2012 2:22 PM (in response to alesj)Yes I am. It seems that having the persistence.xml in the META-INF directory of the SAR is not sufficient. I also have to have it in the JAR that contains the class that I am calling the createEntityManagerFactory() method. Not sure why this is the case. It seems that the SAR is not in the classpath so it cannot find the persistence.xml that is in the SARs META-INF directory.
-
4. Re: JBoss AS7 cannot find my persistence.xml
alesj Jan 14, 2012 2:55 PM (in response to kc7bfi)So you have strucutre like this?
my.sar
* lib
** my.jar
** <some-jpa-impl>.jar
* META-INF
** persistence.xml
Bundled JPA impl has issues, as I'm having similar issues when bundling DataNucleus impl as part of my .war.
I patched AS7 a bit to get around the issue: https://github.com/alesj/jboss-as/commit/278800e24f82c704fec0be14d7d7d2c956880600
(this is a custom branch, but the hack/workaround might give you some ideas)
-
5. Re: JBoss AS7 cannot find my persistence.xml
kc7bfi Jan 14, 2012 5:41 PM (in response to alesj)Close, but it is
my.sar
* my.jar
* some-jpa-impl.ja
* META-INF
** persistence.xml
In my SARs the jars are in the root and not under the lib directory. This is how I've done it under as5, should it be different in as7?
-
6. Re: JBoss AS7 cannot find my persistence.xml
alesj Jan 14, 2012 6:16 PM (in response to kc7bfi)No, it (the structure) used to be different for AS4, hence I thought you still use that .sar notion
(as it was originally a simpler way to deploy custom services, but we simplified that with MC).
But yeah, my guess would be you're having the same problem as me -- that PPResolverImpl doesn't understand / know your PP.
e.g. your PP is found as part of services/ search, but the AS7' PPresolver instance used in javax.persistence.Persistence doesn't know it
This definitely needs fixing, the question is just how soon. ;-)
-
7. Re: JBoss AS7 cannot find my persistence.xml
manarh Jan 18, 2012 3:08 PM (in response to alesj)Ales Justin wrote:
So you have strucutre like this?
my.sar
* lib
** my.jar
** <some-jpa-impl>.jar
* META-INF
** persistence.xml
Bundled JPA impl has issues, as I'm having similar issues when bundling DataNucleus impl as part of my .war.
I patched AS7 a bit to get around the issue: https://github.com/alesj/jboss-as/commit/278800e24f82c704fec0be14d7d7d2c956880600
(this is a custom branch, but the hack/workaround might give you some ideas)
Ales, is there an JIRA issue for that error - javax.persistence.PersistenceException: No Persistence provider for EntityManager ? I heard from a seam user the same about the same experience with Web application (WAR).