WIldfly 40.0.1.Final: Deployment of persistent unit fails with org.hibernate.MappingException

35 views
Skip to first unread message

Gunter Zeilinger

unread,
Jun 29, 2026, 10:39:51 AM (2 days ago) Jun 29
to WildFly
WIldfly 40.0.1.Final: Deployment of persistent unit fails with:

2026-06-29 14:58:17,840 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "dcm4chee-arc-ear-5.35.0-psql.ear")]) - Stage: (VERIFY) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"dcm4chee-arc-ear-5.35.0-psql.ear#dcm4chee-arc\"" => "jakarta.persistence.PersistenceException: Unable to build Hibernate SessionFactory [persistence unit: dcm4chee-arc]
Caused by: jakarta.persistence.PersistenceException: Unable to build Hibernate SessionFactory [persistence unit: dcm4chee-arc]
Caused by: org.hibernate.MappingException: The increment size of the [ian_task_pk_seq] sequence is set to [50] in the entity mapping but the mapped database sequence increment size is [1]"}}


Looks like the mapping file specified in the persistence.xml:

<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1">
<persistence-unit name="dcm4chee-arc">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:/PacsDS</jta-data-source>
<mapping-file>META-INF/orm-sequence.xml</mapping-file>
<properties>
<property name="jakarta.persistence.database-product-name" value="PostgreSQL"/>
<property name="jakarta.persistence.database-major-version" value="10"/>
<property name="jakarta.persistence.database-minor-version" value="5"/>
<property name="hibernate.query.jpaql_strict_compliance" value="false"/>
</properties>
</persistence-unit>
</persistence>

including:

<entity class="org.dcm4chee.arc.entity.IanTask">
<sequence-generator name="ian_task_pk_seq" sequence-name="ian_task_pk_seq" allocation-size="1"/>
<attributes>
<id name="pk">
<column name="pk"/>
<generated-value strategy="SEQUENCE" generator="ian_task_pk_seq"/>
</id>
</attributes>
</entity>

does not get applied, and therefore conflicts with the created DB sequence:

create sequence ian_task_pk_seq start with 1 increment by 1;


Office Aizaz

unread,
Jun 29, 2026, 11:00:39 AM (2 days ago) Jun 29
to Gunter Zeilinger, WildFly
Hi Gunter,

I think you are missing the following annotation on your entity.

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ian_task_pk_seq")
    @SequenceGenerator(name = "ian_task_pk_seq", sequenceName = "ian_task_pk_seq", allocationSize = 1)

I think the issue is not the database config rather when your entity gets deployed with war, it conflicts with the database configuration.

Regards,
Fahad

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/fe0502f7-844a-4e32-9f3b-3e921fbb5c61n%40googlegroups.com.

Office Aizaz

unread,
Jun 29, 2026, 11:07:56 AM (2 days ago) Jun 29
to Gunter Zeilinger, WildFly
Sorry, I just saw that you are using the mapping-file in your persistence.xml. Forget my previous email.

Scott Marlow

unread,
10:50 AM (7 hours ago) 10:50 AM
to Gunter Zeilinger, WildFly
Which version of Hibernate ORM you are using?  Or just tell me if you are using WildFly or WildFly EE 10?  

Where is the "sequence is set to [50] in the entity mapping" coming from?  Did you check your entity class if it is coming from there?  

https://docs.hibernate.org/orm/7.0/migration-guide/#id-generators mentions some changes but I don't think they are relevant for your problem. 

Scott

Reply all
Reply to author
Forward
0 new messages