facebook

fail to add hibernate capabilities to the project

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #245591 Reply

    Sergey Malov
    Member

    While trying to add Hibernate capabilities to my project, myeclipse fails with the following message:

    — Error message —
    Unable to install Hibernate nature.
    Reason: error adding nature com.genuitec.eclipse.hibernate.hibernatenature to project Biblio.
    Details: Resource is out of sync with the file system: /Biblio/.project.
    — End of error message —

    This problem maybe related to the fact that initial project layout and classpath was created with Maven 2.0 (not using eclipse plugin, just from the command line), so all the dependencies for Hibernate and everything else were resolved before I tryied to add a Hibernate nature with MyEclipse.

    While going through dialog “Adding Hibernate capabilities”, I tryied to exclude or include MyEclips libraries for the classpath in the first window, define or skip defenition for SessionFactory package, all with the the end result.

    Here is details of my system:

    — Configuration Summary —
    *** Date: Sun Jan 29 13:32:27 EST 2006

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

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.0 GA
    Build id: 20060122-4.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Platform

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse RCP

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Java Development Tools

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Plug-in Development Environment

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Project SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Development\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    864_38
    -clean
    -vm
    C:\WINDOWS\system32\javaw.exe

    — End of Configuration Summary —

    — Error Log —
    !SESSION 2006-01-29 13:15:14.335 ———————————————–
    eclipse.buildId=M20050929-0840
    java.version=1.5.0_05
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments: -os win32 -ws win32 -arch x86 -clean

    !ENTRY com.genuitec.eclipse.core 1 0 2006-01-29 13:15:22.38
    !MESSAGE Unable to locate .myeclipse.properties file

    !ENTRY com.genuitec.eclipse.hibernate 4 4 2006-01-29 13:15:50.835
    !MESSAGE Unable to add Hibernate BuildSpec
    !STACK 1
    org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: /Biblio/.project.
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:767)
    at org.eclipse.core.internal.resources.File.internalSetContents(File.java:326)
    at org.eclipse.core.internal.resources.File.setContents(File.java:370)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.internalWrite(FileSystemResourceManager.java:303)
    at org.eclipse.core.internal.resources.Project.writeDescription(Project.java:1052)
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:944)
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:968)
    at com.genuitec.eclipse.hibernate.core.HibernateNature.configure(HibernateNature.java:43)
    at org.eclipse.core.internal.resources.NatureManager$1.run(NatureManager.java:140)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
    at org.eclipse.core.runtime.Platform.run(Platform.java:783)
    at org.eclipse.core.internal.resources.NatureManager.configureNature(NatureManager.java:155)
    at org.eclipse.core.internal.resources.NatureManager.configureNatures(NatureManager.java:200)
    at org.eclipse.core.internal.resources.Project.basicSetDescription(Project.java:62)
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:940)
    at org.eclipse.core.internal.resources.Project.setDescription(Project.java:968)
    at com.genuitec.eclipse.core.util.ProjectUtil.addNatures(ProjectUtil.java:65)
    at com.genuitec.eclipse.j2eedt.core.J2EEProjectUtil.addNatures(Unknown Source)
    at com.genuitec.eclipse.hibernate.builder.HibernateProjectInstaller.basicInstallNature(HibernateProjectInstaller.java:74)
    at com.genuitec.eclipse.hibernate.builder.HibernateProjectInstaller.installNature(HibernateProjectInstaller.java:38)
    at com.genuitec.eclipse.hibernate.builder.HibernateProjectInstaller.installNature(HibernateProjectInstaller.java:32)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateSupportCreationWizard.installNature(NewHibernateSupportCreationWizard.java:358)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateSupportCreationWizard$1.execute(NewHibernateSupportCreationWizard.java:101)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:98)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:110)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:830)
    at com.genuitec.eclipse.hibernate.wizards.NewHibernateSupportCreationWizard.performFinish(NewHibernateSupportCreationWizard.java:237)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:676)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:349)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
    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:3080)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
    at org.eclipse.jface.window.Window.open(Window.java:787)
    at com.genuitec.eclipse.hibernate.action.AddHibernateCapabilitiesActionDelegate.basicRun(AddHibernateCapabilitiesActionDelegate.java:70)
    at com.genuitec.eclipse.hibernate.action.AddHibernateCapabilitiesActionDelegate.run(AddHibernateCapabilitiesActionDelegate.java:51)
    at com.genuitec.eclipse.core.ui.action.LicenseValidatingActionDelegate.runWithEvent(Unknown Source)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:236)
    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:3080)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
    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)
    !SUBENTRY 1 org.eclipse.core.resources 4 274 2006-01-29 13:15:50.835
    !MESSAGE Resource is out of sync with the file system: /Biblio/.project.

    !ENTRY org.eclipse.core.resources 2 1 2006-01-29 13:32:13.991
    !MESSAGE Skipping builder org.eclipse.wst.common.modulecore.ComponentStructuralBuilder for project Biblio. Either the builder is missing from the install, or it belongs to a project nature that is missing or disabled.

    !ENTRY org.eclipse.core.resources 2 1 2006-01-29 13:32:14.07
    !MESSAGE Skipping builder org.eclipse.wst.validation.validationbuilder for project Biblio. Either the builder is missing from the install, or it belongs to a project nature that is missing or disabled.

    !ENTRY org.eclipse.core.resources 2 1 2006-01-29 13:32:14.07
    !MESSAGE Skipping builder org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver for project Biblio. Either the builder is missing from the install, or it belongs to a project nature that is missing or disabled.

    —– End of Error Log —-

    I have two plugins, aside from MyEclipse:
    1. Maven 2.0 plugin – however, I didn’t use it.
    2. Subversion plugin.

    Regards,

    Sergey Malov

    #245592 Reply

    Sergey Malov
    Member

    It seems there is something in .project file which Maven 2 creates for eclipse project, which is incompatible with MyEclipse.
    Here is my .project file

    — My .project ———

    <projectDescription>
    <name>Biblio</name>
    <comment/>
    <projects/>
    <buildSpec>
    <buildCommand>
    <name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilder</name>
    <arguments/>
    </buildCommand>
    <buildCommand>
    <name>org.eclipse.jdt.core.javabuilder</name>
    <arguments/>
    </buildCommand>
    <buildCommand>
    <name>org.eclipse.wst.validation.validationbuilder</name>
    <arguments/>
    </buildCommand>
    <buildCommand>
    <name>org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver</name>
    <arguments/>
    </buildCommand>
    </buildSpec>
    <natures>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    </natures>
    </projectDescription>

    —- End of my .project ——————

    Here is standard .project file, which eclipse create by default:

    —- Standard .project ———

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <projectDescription>
    <name>JavaTest</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
    <buildCommand>
    <name>org.eclipse.jdt.core.javabuilder</name>
    <arguments>
    </arguments>
    </buildCommand>
    </buildSpec>
    <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
    </projectDescription>

    ——— End of standard .project —————-

    Regards,

    Sergey Malov

    #245603 Reply

    Greg
    Member

    Try right-click your project and doing refresh. Is seems that your .project is out of sync and refreshing should bring it back in sync.

    #245680 Reply

    Sergey Malov
    Member

    No, this is not the solution.
    These two lines in my .project file confict with myeclipse when it tries to add Hibernate support:

    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>

    These lines are added by Maven 2 when I created eclipse prject from maven project. Since according to eclipse:eclipse Maven plugin web site, these two lines are optional, I removed them and all went ok.

    Question is, why myeclipse fails when these lines are present?

    Regards,
    Sergey

    #245685 Reply

    Greg
    Member

    Not for sure why it would fail with these natures because it doesn’t care what other natures have been added. But I’m glad you got it working.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: fail to add hibernate capabilities to the project

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