Spring JPA SagaRepository issue when going from 2.4.2 to 2.4.3

Hi List,

I’m updating Scynapse to make use of 2.4.3 (and add some stuff) but got an issue with using 2.4.3 in my application.
At startup, there is an exception thrown:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sagaRepository’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.axonframework.saga.repository.jpa.JpaSagaRepository]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: javax.persistence.EntityManagerFactory.addNamedQuery(Ljava/lang/String;Ljavax/persistence/Query;)V

That is not thrown using 2.4.2. This may be an issue that was already in my application and due to changes in 2.4.3 appears or may be an issue with 2.4.3.

I use spring to create my full axon application context and the saga definitions look like:

`
<axon:saga-manager id=“sagaManager” saga-repository=“sagaRepository” event-bus=“eventBus”
resource-injector=“sagaSpringResourceInjector”>
axon:types
com.heroesandfriends.project.ProjectAdminInvitationExpirationSaga
com.heroesandfriends.project.BridgeStoryToProjectSaga
com.heroesandfriends.project.RemoveStoryFromProjectSaga
com.heroesandfriends.skill.BridgeSkillToProjectSaga
</axon:types>
</axon:saga-manager>

<axon:jpa-saga-repository id=“sagaRepository” use-explicit-flush=“true” saga-serializer=“serializer”/>

`

Has something changed in the dependencies or configuration between 2.4.2 and 2.4.3 - or is something wrong with the wiring anyway ?

Kind regards,

Olger

Hi Olger,

Not sure if this question is still relevant for you but you probably need to update your hibernate-entitymanager version. E.g. to:

`

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.3.8.Final</version>
</dependency>

`

Best,
Rene