I'm trying to implement plain JPA in Spring as described here http://static.springframework.org/sp...rence/orm.html and in a few blogs I've been reading.
I found http://code.google.com/p/mvn2-spring-jpa and have been adapting/improving it as I go along and learn things.
Anyway - all was working fine until I realised the sample was not doing Exception Translation. I added the required PersistenceExceptionTranslationPostProcessor in my spring config and as soon as I added the @Repository annotation to Dao - then I get the following failure:
Looks like the personDao is not being injected correctly - but I can't seem to work out how this is happening. Any ideas?
SEVERE: Caught exception while allowing TestExecutionListener
to prepare test instance [net.usefulbits.PersonTest@17a4989]
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'net.usefulbits.PersonTest': Injection of resource methods failed;
nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named 'personDao' must be of type [net.usefulbits.dao.JpaPersonDao],
but was actually of type [$Proxy16]
My current code is all now on github on my develop branch:
this is the last bit of my sample I need to get working - then I'll merge to master and release.
Many thanks in advance.