This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-eac42b7e-9fd2-4a8f-920a-a7e8263f59c6 XWIKI-25585 Open

Derby and H2 blocks in hibernate.cfg.xml are left over after XWIKI-21551 and are missing the mailsender mapping

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-b5994cfd-e09c-4b46-9b22-e2937d453124 Eleni created this issue on 23/Oct/26 17:22
 
Summary: Derby and H2 blocks in hibernate.cfg.xml are left over after XWIKI-21551 and are missing the mailsender mapping
Issue Type: cid:jira-generated-image-avatar-eac42b7e-9fd2-4a8f-920a-a7e8263f59c6 Bug
Affects Versions: 15.10-rc-1
Assignee: Unassigned
Components: Distribution
Created: 23/Oct/26 17:22
Priority: cid:jira-generated-image-static-major-260f068f-d295-4e43-9db3-53fdf52cfd8b Major
Reporter: Eleni
Description:

The WEB-INF/hibernate.cfg.xml file shipped in the XWiki WAR still contains a Derby block and an H2 block. These blocks are incomplete: they do not contain the mailsender.hbm.xml mapping that all the other blocks (MySQL, PostgreSQL, Oracle, etc.) have.

Because of this, the mailsender_events table used by org.xwiki.mail.MailStatus has no Hibernate mapping on Derby and H2.

Steps to reproduce

  1. Download or build any XWiki distribution from 15.10 onwards.
  2. Open WEB-INF/hibernate.cfg.xml in the WAR.
  3. Compare the <mapping> lines of the Derby or H2 block with the MySQL block.

Expected: the blocks contain the same mappings, including mailsender.hbm.xml.
Actual: mailsender.hbm.xml is missing from the Derby and H2 blocks.

Cause: XWIKI-21551 intentionally removed the metadata of unsupported databases (Derby and H2) from the poms. This included xwiki.db.derby.extraMappings and xwiki.db.h2.extraMappings in xwiki-platform-distribution/pom.xml, which contained mailsender.hbm.xml.

The removal was not finished. Two things were left behind:

  • The pom still references the removed properties:
<xwikiDbHbmDerbyExtraMappings>${xwiki.db.derby.extraMappings}</xwikiDbHbmDerbyExtraMappings>
<xwikiDbHbmH2ExtraMappings>${xwiki.db.h2.extraMappings}</xwikiDbHbmH2ExtraMappings>
  • The template xwiki-platform-tool-configuration-resources/src/main/resources/hibernate.cfg.xml.vm still generates the Derby and H2 blocks.