3 Replies Latest reply: Apr 30, 2012 5:04 AM by Dmitry Geraskov RSS

    Error configuring Hibernate console

    Chris Baumgartner Newbie

      I'm trying to use the Hibernate Console for Eclipse.

       

      I'm getting a rather long error message that starts with:

       

      Error while opening console configuration

      Reason: org.hibernate.console.HibernateConsuleRuntimeException: Could not load AnnotationConfiguration.

       

      It looks like the cause is:

       

      org.hibernate.MappingException: Invalid ORM mapping file.

      Error parsing XML (line5 : column 30): schema_reference.4: Failed to read schema document 'orm_2_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

      Error parsing XML (line5 : column 30): cvc-elt.1: Cannot find the declaration of element 'entity-mappings'.

       

      (many similar lines deleted...)

       

        at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:920)

                at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:107)

                at org.hibernate.cfg.Configuration.addResource(Configuration.java:668)

                at org.hibernate.cfg.AnnotationConfiguration.addResource(AnnotationConfiguration.java:1134)

                at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:719)

                at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1647)

                at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1626)

                at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1224)

                at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:107)

                at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1600)

                at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1212)

                at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:107)

                at org.hibernate.cfg.Configuration.configure(Configuration.java:1554)

                at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1206)

                at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:107)

                at org.hibernate.console.ConfigurationFactory.loadConfigurationXML(ConfigurationFactory.java:347)

                at org.hibernate.console.ConfigurationFactory.configureStandardConfiguration(ConfigurationFactory.java:276)

                at org.hibernate.console.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:162)

                at org.hibernate.console.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:94)

                at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:213)

                at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)

                at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:72)

                at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:210)

                at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:166)

                at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:40)

                at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)

                at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)

                at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)

                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

       

      The start of my mapping file looks like:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"

                     version="1.0">

       

      Any ideas on what is causing this?

       

      Thanks.