Results 1 to 1 of 1

Thread: Spring Data JPA not finding Persistence Exception Translator

  1. #1
    Join Date
    Feb 2009
    Posts
    9

    Default 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?
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •