Uploaded image for project: 'Hibernate ORM'
  1. HHH-12893

JAXB exception using SchemaExport with Envers and Java 9+

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: 5.3.3
    • Fix versions: None
    • Components: hibernate-envers
    • Labels:
      None
    • Environment:
      Java 9 or Java 10
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When using org.hibernate.tool.hbm2ddl.SchemaExport programmatically, if there are Envers entities involved the DDL generation fails with this exception:

      javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.hibernate.org/xsd/orm/hbm", local:"hibernate-mapping"). Expected elements are <{}hibernate-mapping>
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent (UnmarshallingContext.java:744)
          at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError (Loader.java:262)
          at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError (Loader.java:257)
          at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement (Loader.java:124)
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement (UnmarshallingContext.java:1149)
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement (UnmarshallingContext.java:574)
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement (UnmarshallingContext.java:556)
          at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement (InterningXmlVisitor.java:75)
          at com.sun.xml.bind.v2.runtime.unmarshaller.StAXEventConnector.handleStartElement (StAXEventConnector.java:261)
          at com.sun.xml.bind.v2.runtime.unmarshaller.StAXEventConnector.bridge (StAXEventConnector.java:130)
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0 (UnmarshallerImpl.java:460)
          at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal (UnmarshallerImpl.java:435)
          at org.hibernate.boot.jaxb.internal.AbstractBinder.jaxb (AbstractBinder.java:181)
          at org.hibernate.boot.jaxb.internal.MappingBinder.doBind (MappingBinder.java:62)
          at org.hibernate.boot.jaxb.internal.AbstractBinder$1.run (AbstractBinder.java:108)
          at org.hibernate.boot.jaxb.internal.AbstractBinder$1.run (AbstractBinder.java:104)
          at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind (AbstractBinder.java:112)
          at org.hibernate.boot.jaxb.internal.AbstractBinder.bind (AbstractBinder.java:60)
          at org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl$1.addDocument (AdditionalJaxbMappingProducerImpl.java:94)
          at org.hibernate.envers.configuration.internal.EntitiesConfigurator.configure (EntitiesConfigurator.java:111)
          at org.hibernate.envers.boot.internal.EnversServiceImpl.doInitialize (EnversServiceImpl.java:154)
          at org.hibernate.envers.boot.internal.EnversServiceImpl.initialize (EnversServiceImpl.java:118)
          at org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl.produceAdditionalMappings (AdditionalJaxbMappingProducerImpl.java:101)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete (MetadataBuildingProcess.java:297)
          at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build (MetadataBuildingProcess.java:84)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build (MetadataBuilderImpl.java:474)
          at org.hibernate.boot.internal.MetadataBuilderImpl.build (MetadataBuilderImpl.java:85)
          at org.hibernate.boot.MetadataSources.buildMetadata (MetadataSources.java:180)
      

      The same DDL is exported without any exception with Java 8.

      Sample test case: https://github.com/heruan/hibernate-ddl-generator

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: