8 Replies Latest reply on Jun 11, 2010 6:06 PM by Tim Bennen

    Audited tables can not be created

    Tim Bennen Newbie

      Hello all!

       

      I wrote this topic to the Hibernate forum, but now I think it would be better to discuss my question here.

      (https://forum.hibernate.org/viewtopic.php?t=1005115)

       

      I use the latest Hibernate version available in my J2EE project. I can do a schema export, all database tables will be created without using Envers.

      Now I want to audit 2 and 3 table fields / class attributes of 2 database tables.

      So I audited them with @Audited and do a import "import org.hibernate.envers.Audited;"

       

      I also can create database tables witout the audited tables. But how can I create the audited tables?

      I read this Quickstart http://docs.jboss.org/envers/docs/index.html#quickstart and I put these lines into my hibernate config file:

       

      <property name="hibernate.ejb.event.post-insert"
         value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener"  />
      <property name="hibernate.ejb.event.post-update"
         value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener"  />
      <property name="hibernate.ejb.event.post-delete"
         value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener"  />
      <property  name="hibernate.ejb.event.pre-collection-update"
         value="org.hibernate.envers.event.AuditEventListener" />
      <property name="hibernate.ejb.event.pre-collection-remove"
         value="org.hibernate.envers.event.AuditEventListener" />
      <property name="hibernate.ejb.event.post-collection-recreate"
         value="org.hibernate.envers.event.AuditEventListener" />
      

       

       

      Doing this an I will recreate my database tables, I get this error in my eclipse IDE:

      !ENTRY org.hibernate.eclipse.console 4 4 2010-06-09 22:42:27.428
      !MESSAGE  Problems while reading database schema
      !SUBENTRY 1  org.hibernate.eclipse.console 4 150 2010-06-09 22:42:27.428
      !MESSAGE  org.hibernate.console.HibernateConsoleRuntimeException: Could not load  AnnotationConfiguration
      !STACK 0
      org.hibernate.console.HibernateConsoleRuntimeException:  Could not load AnnotationConfiguration
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:728)
       at  org.hibernate.console.ConsoleConfiguration.access$1(ConsoleConfiguration.java:717)
       at  org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:338)
       at  org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
       at  org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:320)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:63)
       at  org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
       at  org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
      Caused  by: org.hibernate.MappingException: invalid configuration
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:435)
       at  org.hibernate.console.ConsoleConfiguration.configureStandardConfiguration(ConsoleConfiguration.java:770)
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:722)
       ... 9 more
      Caused by: org.xml.sax.SAXParseException: Attribute  "value" must be declared for element type "property".
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:785)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at  com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at  com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at org.dom4j.io.SAXReader.read(SAXReader.java:465)
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:433)
       ... 11 more
      !SUBENTRY 2 org.hibernate.eclipse.console 4 150  2010-06-09 22:42:27.430
      !MESSAGE  org.hibernate.console.HibernateConsoleRuntimeException: Could not load  AnnotationConfiguration
      !STACK 0
      org.hibernate.console.HibernateConsoleRuntimeException:  Could not load AnnotationConfiguration
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:728)
       at  org.hibernate.console.ConsoleConfiguration.access$1(ConsoleConfiguration.java:717)
       at  org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:338)
       at  org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
       at  org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:320)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:63)
       at  org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
       at  org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
      Caused  by: org.hibernate.MappingException: invalid configuration
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:435)
       at  org.hibernate.console.ConsoleConfiguration.configureStandardConfiguration(ConsoleConfiguration.java:770)
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:722)
       ... 9 more
      Caused by: org.xml.sax.SAXParseException: Attribute  "value" must be declared for element type "property".
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:785)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at  com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at  com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at org.dom4j.io.SAXReader.read(SAXReader.java:465)
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:433)
       ... 11 more
      !SUBENTRY 2 org.hibernate.eclipse.console 4 150  2010-06-09 22:42:27.430
      !MESSAGE org.hibernate.MappingException:  invalid configuration
      !STACK 0
      org.hibernate.MappingException:  invalid configuration
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:435)
       at  org.hibernate.console.ConsoleConfiguration.configureStandardConfiguration(ConsoleConfiguration.java:770)
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:722)
       at  org.hibernate.console.ConsoleConfiguration.access$1(ConsoleConfiguration.java:717)
       at  org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:338)
       at  org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
       at  org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:320)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:63)
       at  org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
       at  org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
      Caused  by: org.xml.sax.SAXParseException: Attribute "value" must be declared  for element type "property".
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:785)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at  com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at  com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at org.dom4j.io.SAXReader.read(SAXReader.java:465)
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:433)
       ... 11 more
      !SUBENTRY 2 org.hibernate.eclipse.console 4 150  2010-06-09 22:42:27.430
      !MESSAGE org.xml.sax.SAXParseException:  Attribute "value" must be declared for element type "property".
      !STACK  0
      org.xml.sax.SAXParseException: Attribute "value" must be declared  for element type "property".
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
       at  com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
       at  com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
       at  com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:785)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
       at  com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
       at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
       at  com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
       at  com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
       at  com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
       at  com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
       at org.dom4j.io.SAXReader.read(SAXReader.java:465)
       at  org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:433)
       at  org.hibernate.console.ConsoleConfiguration.configureStandardConfiguration(ConsoleConfiguration.java:770)
       at  org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:722)
       at  org.hibernate.console.ConsoleConfiguration.access$1(ConsoleConfiguration.java:717)
       at  org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:338)
       at  org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
       at  org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:320)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:105)
       at  org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:63)
       at  org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
       at  org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

       

      So, what's going wrong here? What should I do that I can create the audited tables and can use them?

       

      Thanks a lot in advance & Best Regards PHANTOMIAS

        • 1. Re: Audited tables can not be created
          Adam Warski Master

          Hmm, no idea about the eclipse thing, but it looks fine. How are you creating the schema?

           

          Adam

          • 2. Re: Audited tables can not be created
            Hernán Chanfreau Master

            Hello!

             

            The original cause is a SAXParseException, so it´s a syntactic checking error on the xml...

            I would try to check basic things like the dtd linked to the xml, old jars in classpath, re-writing the same xml...

             

             

            Regards, Hernán.

            • 3. Re: Audited tables can not be created
              Tim Bennen Newbie

              @Adam Warski: Hm, I created via "Run Schema Export" via Hibernate/Eclipse.

               

              Here is my full XML:

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                                       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
              <hibernate-configuration>
               <session-factory name="session">
                <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
                <property name="connection.url">jdbc:mysql://localhost/mydb</property>
                <property name="connection.username">root</property>
                <property name="connection.password"></property>
                <property name="connection.pool_size">1</property>
                <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
                <property name="current_session_context_class">thread</property>
                <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
                <property name="show_sql">true</property>
                <property name="hbm2ddl.auto">update</property>
                <mapping class="com.foo.bar.Test"/>
                <!-- ... more mappings -->
               </session-factory>
              
              
              
                  <property name="hibernate.ejb.event.post-insert"
                           value="org.hibernate.ejb.event.EJB3PostInsertEventListener,org.hibernate.envers.event.AuditEventListener" />
                 <property name="hibernate.ejb.event.post-update"
                           value="org.hibernate.ejb.event.EJB3PostUpdateEventListener,org.hibernate.envers.event.AuditEventListener" />
                 <property name="hibernate.ejb.event.post-delete"
                           value="org.hibernate.ejb.event.EJB3PostDeleteEventListener,org.hibernate.envers.event.AuditEventListener" />
                 <property name="hibernate.ejb.event.pre-collection-update"
                           value="org.hibernate.envers.event.AuditEventListener" />
                 <property name="hibernate.ejb.event.pre-collection-remove"
                           value="org.hibernate.envers.event.AuditEventListener" />
                 <property name="hibernate.ejb.event.post-collection-recreate"
                           value="org.hibernate.envers.event.AuditEventListener" />
              
              
              
              </hibernate-configuration>
              
              

              Oh, and now I see an error, it is displayed via Eclipse:

              ERROR: 32:122 Attribute "value" must be declared for element type "property".
              ERROR: 34:122 Attribute "value" must be declared for element type "property".
              ERROR: 36:122 Attribute "value" must be declared for element type "property".
              ERROR: 38:70 Attribute "value" must be declared for element type "property".
              ERROR: 40:70 Attribute "value" must be declared for element type "property".
              ERROR: 42:70 Attribute "value" must be declared for element type "property".
              ERROR: 44:27 The content of element type "hibernate-configuration" must match "(session-factory,security?)".
              

              What does this error mean?

               

              Best Regards PHANTOMIAS

              • 4. Re: Audited tables can not be created
                Hernán Chanfreau Master

                Hello!

                 

                I think I´ve found something. Some points first:

                 

                - The dtd is not well defined, when I put it into my eclipse automatically I see an error there.

                - I think you have the xml-dtd validation disabled on your workspace.

                 

                If you replace this:

                 

                 

                <!

                DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN

                http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd

                >

                 

                 

                 

                with this:

                 

                <!

                DOCTYPE hibernate-configuration PUBLIC

                 

                "-//Hibernate/Hibernate Configuration DTD//EN"

                 

                "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

                 

                 

                 

                 


                and the dtd validation is enabled, there are a lot of syntactic errors.

                The quick guide you followed is based on persistent.xml file defined for jpa 2.0.

                Here is an example that I hope will help you!

                Regards, Hernán.


                • 5. Re: Audited tables can not be created
                  Tim Bennen Newbie

                  Okay, thanks a lot. Now I have this config file, see attached and I get this error in Eclipse opeing the xml:

                   

                  ERROR: 62:20 The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".

                   

                  What's wrong here? Is the name of session-facory name="session" not okay?

                   

                  Best Regards.

                  • 6. Re: Audited tables can not be created
                    Hernán Chanfreau Master

                    Hi!

                     

                    It seems that mapping tags must be after property tags and before anyother.

                    A recom

                     

                    endation: enable xml-dtd checking, it's much more easier!


                    Regards. Hernán.

                    • 7. Re: Audited tables can not be created
                      Tim Bennen Newbie

                      Hello!

                       

                      I can do a validation if I do a right click on the file and select validate. Is this what you mean?

                      I did not find in the preferences of Eclipse to enable this.

                       

                      But you are right, I changed the order and now I did not get an error anymore.

                      I can "Run SchemaExport", but, there are no "audit-tables"...

                      Did I forget something?

                       

                      Best Regards.

                      • 8. Re: Audited tables can not be created
                        Tim Bennen Newbie

                        It works... I have to do (several times) do a refresh and a reload of the configuration and "Run SchemaExport".

                        Now I have the _AUD tables and it seems to work with my integration test. If I update something on the original table which is audited, the audited table is filled with the old data.

                         

                        Perfect