facebook

could’nt use the Hibernate console in 5.0 M2

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #255971 Reply

    Hi,
    I installed MyEclipse 5.0 M2 on top of a fresh installation of Eclipse 3.2, with no other plugins installed.

    I would like to use the integrated hibernate tools: in the MyEclipse hibernate perspective the Hibernate Dynamic Query Translator says: ‘No HQL Query editor selected’ but… how can I open an HQL editor? I remember having used the tool from Hibernate in the past and there was a view named Hibernate configurations from where one could open the HQL scratchpad… but here I didn’t find that view.

    How do I open an HQL editor?

    Here are the information you require:

    *** Date: Wed Aug 02 11:47:47 CEST 2006
    
    *** System properties:
    OS=Windows2000
    OS version=5.0
    Java version=1.5.0_07
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 5.0 Milestone 2
    Build id: 20060703-5.0-M2
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.2.0
    Build id: M20060629-1905
    
    Eclipse Graphical Editing Framework
    
    Version: 3.2.0.v20060626
    Build id: 20060627-0816
    
    Eclipse Platform
    
    Version: 3.2.0.v20060609m-AgOexn6hlEUsvBO
    Build id: M20060629-1905
    
    Eclipse RCP
    
    Version: 3.2.0.v20060609m-SVDNgVrNoh-MeGG
    Build id: M20060629-1905
    
    Eclipse Java Development Tools
    
    Version: 3.2.0.v20060609m-F7snq1fxia-Z4XP
    Build id: M20060629-1905
    
    Eclipse Plug-in Development Environment
    
    Version: 3.2.0.v20060609m------6zXJJzJzJq
    Build id: M20060629-1905
    
    Eclipse Project SDK
    
    Version: 3.2.0.v20060609m-GNq6oQq-7es-Y81
    Build id: M20060629-1905
    
    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    D:\Java\eclipse32\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    45c_54
    -clean
    -vm
    D:\Java\jdk1.5.0\bin\javaw.exe
    
    

    Thanks,
    Dario

    #256023 Reply

    Haris Peco
    Member

    Dario,

    Just make file with extension .hql in hibernate project – you needn’t hibernate console

    You can change settings for this editor (open files with other extensions) in Windows-Preferences-general-Editors-Files Associations)

    Best
    Peco

    #256043 Reply

    OK, thanks, that solved the problem at first. But when I try to open the same file in another workspace, that I created exporting and reimporting the project from cvs, I get this error:

    
     Unable to create editor ID com.genuitec.eclipse.hibernate.editors.meqhleditor: An unexpected exception was thrown.
    

    and the thrown exception is:

    
     java.lang.NullPointerException
        at org.eclipse.core.runtime.Path.<init>(Path.java:152)
        at com.genuitec.eclipse.hibernate.util.HibernateUtils.getConfigFile(HibernateUtils.java:321)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfigurationPreferences(HTUtils.java:173)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfigurationPreferences(HTUtils.java:136)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:128)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:109)
        at com.genuitec.eclipse.hibernate.util.ConsoleConfigurationRepository.createFromHibernateProject(ConsoleConfigurationRepository.java:52)
        at com.genuitec.eclipse.hibernate.util.ConsoleConfigurationRepository.find(ConsoleConfigurationRepository.java:39)
        at com.genuitec.eclipse.hibernate.util.ConsoleConfigurationRepository.getHibernateConfigsFromWorkspace(ConsoleConfigurationRepository.java:81)
        at com.genuitec.eclipse.hibernate.util.ConsoleConfigurationRepository.getConfigurations(ConsoleConfigurationRepository.java:59)
        at org.hibernate.console.KnownConfigurations.getConfigurations(KnownConfigurations.java:178)
        at com.genuitec.eclipse.hibernate.editors.MEHQLEditor.createSourceViewer(MEHQLEditor.java:76)
        at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:2549)
        at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
        at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:367)
        at org.hibernate.eclipse.hqleditor.HQLEditor.createPartControl(HQLEditor.java:113)
        at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
        at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
        at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
        at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
        at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
        at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
        at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394)
        at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
        at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1097)
        at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1311)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:455)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:102)
        at org.eclipse.ui.internal.PartStack.add(PartStack.java:441)
        at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:111)
        at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:60)
        at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
        at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
        at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:819)
        at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:718)
        at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:679)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2586)
        at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2521)
        at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2513)
        at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2498)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2493)
        at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2478)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
        at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:275)
        at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:139)
        at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:190)
        at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
        at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
        at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:306)
        at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:651)
        at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:817)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at org.eclipse.core.runtime.Platform.run(Platform.java:843)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
        at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:815)
        at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1069)
        at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1168)
        at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249)
        at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:283)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
        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.core.launcher.Main.invokeFramework(Main.java:336)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
        at org.eclipse.core.launcher.Main.run(Main.java:977)
        at org.eclipse.core.launcher.Main.main(Main.java:952)
    
    

    I verified all the files and configurations (i.e. the workspace options, the project options) are there but I don’t find a way to bypass this error.

    Any further suggestions?

    Thanks,
    Dario

    #256045 Reply

    Haris Peco
    Member

    Dario,

    Please, right click on project , choose property and see setting in MyEclipse-Hibernate
    You will see hibernate cfg.xml or spring config file.check if this file exists in your project

    Best
    Peco

    #256049 Reply

    Yes, it’s there, it’s the same in the two workspaces. I tried also the othe way: to import all the projects of the second (not functioning) workspace into the first one (where I have my new project), and it stop functioning too. When I delete those projects, two of which I used with hibernate in 4.1.1, my new project opens again the .hql file.

    Dario

    #256068 Reply

    Brian Fernandes
    Moderator

    Dario,

    Go to the project that is not functioning and open up the MyEclipse-Hibernate project properties page.
    Choose browse and choose the hibernate.cfg.xml file in your project – even though this file might already show in that location. choose okay to save your changes.

    The HQL file you are opening must reside in the same hibernate project, no where else. Alternatively, you can open an HQL editor by bringing up the context menu with the proejct selected (Right click) then choose MyEclipse > Open HQL Editor. This option will show if you have a hibernate project.

    Let us know how it goes,
    Best,
    Brian.

    #256249 Reply

    Brian, resetting the hibernate.cfg.xml in project properties page, I don’t get runtime errors anymore, the HQL editor opens well, for my new project and for the old ones as well (for the old ones after a little manual make-up of the .myhibernatedata file, following the way of the new one).
    The problem now is that the Hibernate dynamic query translator says:
    Session factory not created for configuration: <name of my project>. That happens for all the projects.
    If that could help you, here is the .myhibernatedata for one of them (they are all similar):

    
     #
    #Fri Aug 04 12:53:24 CEST 2006
    genBasicCompId=false
    sessionFactoryName=it.invallee.security.hb.HibernateSessionFactory
    profile=
    daoSFId=
    version=3.0
    jndiPath=
    springDaoFile=
    useJavaTypes=true
    keyGenerator=sequence
    libInstallFolder=lib
    addLibs2Project=false
    genVersionTag=false
    sessionFactoryId=
    basePersistenceClass=
    reSettingsFile=
    configFile=/Profili/src/hibernate.cfg.xml
    createConfigFile=true
    addLibs2Classpath=false
    
    

    Thanks for any further suggestions,
    Dario

    #256258 Reply

    Brian Fernandes
    Moderator

    Dario,

    Press the refresh button in the HQL editor to have it reread your configuration. The view should correct itself or you will see an error message. Look in the error log (Window > Show View > Other > PDE Runtime > Error Log) for any relevant exceptions thrown and paste them here. You might want to clear the error log before trying this so that it does not get polluted with other issues and exceptions.

    Best,
    Brian.

    #256503 Reply

    Brian,

    pressing the refresh button in HQL editor worked perfectly for my new project:

    auto-completion, the dynamic query translator, and everything works fine! Thank you.

    Now I would like to be able to do the same thing for my old projects, developed with

    hibernate 3.1 on MyEclipse4.1.1 (where Hibernate tools 3.1.0 beta5 plugin was

    installed) but I couldn’t succeed.

    I get some errors but before bothering you again I prefer taking the time to do more investigation, thing that I will do after the delivery of an important project. So I will give you a feedback at the beginning of September, when we will probably have more time to spend to migrate to version 5.

    Best and thank you for now,
    Dario

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: could’nt use the Hibernate console in 5.0 M2

You must be logged in to post in the forum log in