5 Replies Latest reply on Aug 2, 2007 7:36 AM by krasig

    How to add hibernate console

    krasig

      I have hibernate application and want to add hibetnate console to test my new mappings.
      After "Create Hibernate Console WIZARD" I have hibernate console , bit when click on it :

      org.hibernate.InvalidMappingException: Could not parse mapping document from file D:\EclipseEuropa\eclipse\MyWorks\FormApi\com\indexbg\dc\formapi\model\SchemeItemUnits.hbm.xml
      Could not parse mapping document from file D:\EclipseEuropa\eclipse\MyWorks\FormApi\com\indexbg\dc\formapi\model\SchemeItemUnits.hbm.xml
       org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.indexbg.dc.formapi.model.SchemeItemUnits
       Duplicate class/entity mapping com.indexbg.dc.formapi.model.SchemeItemUnits
       org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.indexbg.dc.formapi.model.SchemeItemUnits
       Duplicate class/entity mapping com.indexbg.dc.formapi.model.SchemeItemUnits
      
      


      This SchemeItemUnits is the first mapping file.

      Where is problem???

        • 1. Re: How to add hibernate console
          maxandersen

          did you add the mapping files twice ?

          e.g. both in cfg.xml and in the "Additional mappings" tab ?

          • 2. Re: How to add hibernate console
            krasig

             

            both in cfg.xml and in the "Additional mappings" tab


            YES. that's my fault

            • 3. Re: How to add hibernate console
              krasig

              But noe , when in HQL editor just type

              from MyClass

              got the error:
              j
              java.lang.IllegalArgumentException: node to traverse cannot be null!
               at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
               at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
               at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
               at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
               at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
               at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
               at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
               at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
               at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
               at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:103)
               at org.hibernate.console.ConsoleConfiguration$4.execute(ConsoleConfiguration.java:380)
               at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
               at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:375)
               at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:374)
               at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:72)
               at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52)
               at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
               at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:56)
               at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
               at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
               at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
               at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
               at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
               at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
               at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
               at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
               at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
               at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
               at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
               at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
               at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
               at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
               at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
               at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
               at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
               at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
               at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
               at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
               at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
               at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
              


              Some idea?


              • 4. Re: How to add hibernate console
                maxandersen

                seems hibernate is not configured correctly.

                does "from java.lang.Object" give you something ?

                • 5. Re: How to add hibernate console
                  krasig

                  Can't reproduce. After several START/RESTART, clean, exit,close...... and so on magician work - everything works fine.
                  Regards.