Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25585

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 15.10-rc-1
    • Distribution
    • None
    • Unknown

    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.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ecojocariu Eleni
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: