Axonframework: Schema-validation: missing table [association_value_entry]

Created on 12 Feb 2020  路  6Comments  路  Source: AxonFramework/AxonFramework

I'm facing this issue:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [association_value_entry]

Seems like Axon can't create AssociationValueEntry entity. I'm using JPA with PostgreSQL driver on top of Spring Boot.

The error disappears if I remove axon-spring-boot-starter dependency.

I can provide example repo if needed.

Question

Most helpful comment

@smcvb thanks!

All 6 comments

A sample repo would be helpful @DavidArutiunian. Haven't come across this issue personally when using the axon-spring-boot-starter dependency, so validating my sample repo's with yours might provide the solution.

Hi @smcvb!
Any update on this issue? I can provide more info if you give me any ideas where to dig in. I think there is some issue with PostgreSQL support. Is axon tested for PostgreSQL compability?

Sorry for the wait @DavidArutiunian. You might have noticed we've released 4.3 this week; this took quite some time of my hand of course.

Is axon tested for PostgreSQL compability?

I use PostgreSQL by default most of the times, hence making your problem more interesting.
Once I've checked your repo, I'll notify you under this issue. :+1:

@DavidArutiunian, sorry for the long wait. I've been thorn with travel and other work as well, so I had to keep you waiting. My apologies for that.

However, I have found the problem with your application.
From your sample I noticed you are using FlyWay; definitely a good thing by the way.
Additionally, you have set the spring.jpa.hibernate.ddl-auto to validate.
Also reasonable, given that FlyWay will instantiate the tables for you.

The exception you're receiving indeed lies through the auto configuration of Axon.
Axon requires a set of entities to be created to be able to work, which are the association_value_entry, saga_entry and token_entry tables.
However, as you've set the ddl-auto, it is expected those tables are already present or created through FlyWay. Neither are the case at the moment, hence a faulty start up of the application.

To solve this you could go two ways:

  1. Add the Axon tables to a dedicated FlyWay script
  2. Change ddl-auto to update

Having said all this, I will be closing this issue with the tag "Question" attached to it.
If you happen to have further usage question on different topics, I recommend to post those on the usergroup or on StackOverflow using the axon tag.

Hope this helps you out!

@smcvb thanks!

Was this page helpful?
0 / 5 - 0 ratings