Discussion:
jpa autodiscovery failing after uprade to M9
Kallin Nagelberg
2012-03-21 21:25:23 UTC
Permalink
Hey everyone,

I am trying to upgrade from milestone-2 to milestone-9 and have noticed
something peculiar. When running my tests none of my persistence classes
are found:

java.lang.IllegalArgumentException: Unknown entity: com....SimpleTestEntity
at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:626)

When I add them as class tags to persistence.xml they work, but I never had
to do that before. Is there some new classloader funkiness that could be
causing this? Any suggestions?

Cheers,
-Kal
Kallin Nagelberg
2012-03-21 21:35:06 UTC
Permalink
Going to answer my own question here.

Gradle (m2) used to mix 'resources' and classes into classes/main and
classes/test directory .
Now (m9) resources are split into their own directory during the build.

This presents a problem (at least for me!) due to situation described here:
http://forum.springsource.org/showthread.php?87243-Cannot-get-JPA-Spring-to-auto-scan-Entities.

"hibernate starts scanning from parent folder of where persistence.xml is
found."

So now with M9 persistence.xml is totally separated from all the class
files !



On Wed, Mar 21, 2012 at 2:25 PM, Kallin Nagelberg <
Post by Kallin Nagelberg
Hey everyone,
I am trying to upgrade from milestone-2 to milestone-9 and have noticed
something peculiar. When running my tests none of my persistence classes
com....SimpleTestEntity at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:626)
When I add them as class tags to persistence.xml they work, but I never
had to do that before. Is there some new classloader funkiness that could
be causing this? Any suggestions?
Cheers,
-Kal
Peter Niederwieser
2012-03-21 22:07:20 UTC
Permalink
See http://forums.gradle.org for the question and solution.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Twitter: @pniederw

--
View this message in context: http://gradle.1045684.n5.nabble.com/jpa-autodiscovery-failing-after-uprade-to-M9-tp5584163p5584231.html
Sent from the gradle-user mailing list archive at Nabble.com.

Loading...