facebook

Hibernate mapping tool failing due to renamed project?

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

    I would like to use the “Create Hibernate Mapping” function within Database Explorer to generate Hibernate mapping files, objects, etc. I was able to use this for a previous project, but not it fails – I right click on a MySQL DB table, select “Create Mapping” and get nothing. When I look in the error log, I see a “Cannot create file” error:

    org.eclipse.core.internal.resources.ResourceException: Resource /WebInventory does not exist.

    [Full text below]

    WebInventory was the *previous* name of my project. I renamed everything to techinventory when it became apparent that we might deploy this on the web and through a Swing GUI. I have checked all of my project properties and every option I can find, but I don’t see any remaining references to WebInventory. Somehow, however, MyEclipse’s Hibernate system still has the old name in mind.

    Any suggestions of other options that will need to be flipped / config files that need to be edited?

    Thanks!!! – ATM

    ************************************************************
    MY ECLIPSE CONFIG INFO:
    *** Date: Wed Mar 29 17:53:45 EST 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_06

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.1 GA
    Build id: 20060309-4.1.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Platform

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse RCP

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Java Development Tools

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Plug-in Development Environment

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Project SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Program Files\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    1578_e0
    -vm
    C:\WINDOWS\System32\javaw.exe

    ************************************************************
    FULL ERROR (1 of 3 when I click the “Create Mapping” option):

    org.eclipse.core.internal.resources.ResourceException: Resource /WebInventory does not exist.
    at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:304)
    at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:172)
    at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:124)
    at org.eclipse.core.internal.resources.File.create(File.java:111)
    at org.eclipse.core.internal.resources.File.create(File.java:183)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateRETypeMappingWizardPage.getRESettingsFile(NewHibernateRETypeMappingWizardPage.java:297)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateRETypeMappingWizardPage.updatedDOMREDefinition(NewHibernateRETypeMappingWizardPage.java:241)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateRETypeMappingWizardPage.refreshPage(NewHibernateRETypeMappingWizardPage.java:206)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateMappingWizard.projectChanged(NewHibernateMappingWizard.java:130)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateArtifactWizardPage.loadProjectProperties(NewHibernateArtifactWizardPage.java:523)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateArtifactWizardPage.updatePackageFragmentRoot(NewHibernateArtifactWizardPage.java:443)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateArtifactWizardPage.init(NewHibernateArtifactWizardPage.java:689)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateMappingWizard.createPageControls(NewHibernateMappingWizard.java:136)
    at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:611)
    at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:502)
    at org.eclipse.jface.window.Window.create(Window.java:418)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:996)
    at com.genuitec.eclipse.hibernate.action.NewHibernateMappingAction.basicRun(NewHibernateMappingAction.java:40)
    at com.genuitec.eclipse.core.ui.action.LicenseValidatingAction.run(Unknown Source)
    at com.genuitec.eclipse.hibernate.action.NewHibernateMappingAction.run(NewHibernateMappingAction.java:51)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)

    #249564 Reply

    Haris Peco
    Member

    amcclain,

    You have to change ‘Java src folder’ in first page of MyEclipse Reveng wizard

    Best regards

    #249566 Reply

    Thank you for the quick response. Unfortunately, the wizard does not launch at all. As soon as I click on the “Create Hibernate Mapping” menu item, I see the error logged and nothing else happens.

    I have seen the three-step wizard before this problem began occuring – I assume this is the reveng wizard you mention. Currently there is no way at all for me to access it.

    Any further help, or is there another wizard or something I am missing?

    Thank you again – ATM

    #249568 Reply

    Haris Peco
    Member

    I have tried reproduce your case and I can’t do it
    I change project name with refactor-rename on project – how you change project name ?

    Best

    #249569 Reply

    I too used the Refactor > Rename option to rename the project. I then went in and renamed several source folders, and had to clear out multiple references to the old package names, etc. in both code and Eclipse/MyEclipse options.

    Not much was developed, however, so it wasn’t too big a deal. Are there any config files that I could load up and read/edit for how MyEclipse stores its project data? I know that there’s a reference remaining somewhere, but still no luck tracking it down…

    Again, thanks for your help – Anselm

    #249571 Reply

    Wow – looks like I was able to resolve it myself by renaming the project once again (to another, third name). That seems to have solved the problem as the wizard ran again. Must have forced some hidden property to update.

    I’ll try some mappings and POJO generation and let you know if I get stuck again, but I appreciate the help and support!

    #249572 Reply

    Haris Peco
    Member

    Anselm,

    You can try find .myhibernatedata file in your project tree – rename reference from old project to new project
    Warning – you can break complete myeclipse settings and then your only option is make project from beginning

    Best regards

    #249626 Reply

    Brian Fernandes
    Moderator

    There is a legacy issue with renaming projects in Hibernate, our datastructures include the project name in some paths which are not updated whe you rename the project.

    If you do rename your project, fire up the Project properties page, go to MyEclipse-Hibernate and “reselect” your config file (it would still be pointing to your old project).

    Sorry for the inconvenience caused, we’re looking at fixing these issues asap.

    Best,
    Brian.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Hibernate mapping tool failing due to renamed project?

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