Announcement Announcement Module
Collapse
No announcement yet.
Spring Data JPA not finding Persistence Exception Translator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data JPA not finding Persistence Exception Translator

    Hi... I have put together a simple demo Spring Data JPA application using the new release 1.2.0. Basically, I create a Java configuration with three beans: entityManagerFactory, dataSource and transactionManager (exactly like specified in the documentation). I created a simple Entity class and a Repository that extends CrudRepository.

    My Test class fails to load the application Context because it states that a 'persistence exception translator is not found'. I modified the Configuration class to create a LocalContainerEntityManagerFactoryBean as a separate bean instead and now it works.

    I am hoping that the upload works, because I have attached a very simple maven project that illustrates the problem. Simply change the Tests class to use the AppConfig2.class as its @ContextConfiguration.

    I have used the AppConfig technique in the past with 'plain" jpa DAO classes (not using Spring Data JPA) and it finds the exception translator just fine.

    Can anyone shed any light on this?
Working...
X