Spring JPA SagaRepository issue when going from 2.4.2 to 2.4.3

70 views
Skip to first unread message

Olger Warnier

unread,
Oct 21, 2015, 4:09:22 PM10/21/15
to Axon Framework Users
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"/>


   
<bean id="sagaSpringResourceInjector" class="org.axonframework.saga.spring.SpringResourceInjector"/>


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

René de Waele

unread,
Nov 6, 2015, 4:52:25 AM11/6/15
to Axon Framework Users
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
Reply all
Reply to author
Forward
0 new messages