facebook

Hibernate configuration file gets cleared

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

    peterwontner
    Member

    Using the Generate Hibernate Mappings action from the DE (RMB on a table), with the “Update Hibernate Configuration File” check box ticked, causes any previously defined properties to get wiped out, i.e. all the database connection information. The work around at the moment is to clear the check box and manually add the mapping info to the configuration file.

    #213258 Reply

    Riyad Kalla
    Member

    I will ask the hibernate dev to look at this.

    #213361 Reply

    support-jeff
    Member

    peter –

    Are you doing this with a project created under ME 3.8-beta2? There may be an incompatibility issue. Also, please look at your error logs for Eclipse and send along relevant entries. This can be obtained from <<workspace_dir>>/.metadata/.log or from the Error Log view inside Eclipse.

    #213386 Reply

    peterwontner
    Member

    Jeff,

    The project is a brand new project created with ME at the configuration level shown below.
    configuration info…

    OS
    Windows XP Pro SP 1

    Eclipse
    Version: 3.0.0
    Build Id: 200406192000

    MyEclipse
    Version: 3.8.1 +QF20040823
    Build Id: 200408201200-3.8.1 +QF20040823

    This is the contents of the .log file after performing this operation…

    !SESSION Aug 25, 2004 07:24:45.722 ———————————————
    eclipse.buildId=I200406192000
    java.version=1.4.2_04
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

    !ENTRY org.eclipse.update.configurator Aug 25, 2004 07:24:45.722
    !MESSAGE Could not install bundle /C:/Program Files/MyEclipse/eclipse/plugins/org.eclipse.draw2d_3.0.0/ Bundle “org.eclipse.draw2d” version “3.0.0” has already been installed from: update@/e:/Eclipse_3/eclipse/plugins/org.eclipse.draw2d_3.0.0/

    !ENTRY org.eclipse.update.configurator Aug 25, 2004 07:24:45.802
    !MESSAGE Could not install bundle /C:/Program Files/MyEclipse/eclipse/plugins/org.eclipse.gef_3.0.0/ Bundle “org.eclipse.gef” version “3.0.0” has already been installed from: update@/e:/Eclipse_3/eclipse/plugins/org.eclipse.gef_3.0.0/

    !ENTRY org.eclipse.core.runtime 4 2 Aug 25, 2004 07:24:54.634
    !MESSAGE Problems encountered starting up plug-in: “org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start() of bundle com.genuitec.eclipse.wizards.”.
    !STACK 0
    org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start() of bundle com.genuitec.eclipse.wizards.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:975)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
    at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:349)
    at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:328)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCompatibility(EarlyStartupRunnable.java:140)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:68)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
    at org.eclipse.core.runtime.Platform.run(Platform.java:758)
    at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1281)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.NoSuchMethodError: org.eclipse.gef.palette.PaletteEntry.getId()Ljava/lang/String;
    at com.genuitec.eclipse.snippetinstaller.SnippetInstaller.installLibrary(Unknown Source)
    at com.aston.AstonWizardsPlugin.installSnippetLibraries(Unknown Source)
    at com.aston.AstonWizardsPlugin.startup(Unknown Source)
    at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:50)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
    … 14 more
    Root exception:
    java.lang.NoSuchMethodError: org.eclipse.gef.palette.PaletteEntry.getId()Ljava/lang/String;
    at com.genuitec.eclipse.snippetinstaller.SnippetInstaller.installLibrary(Unknown Source)
    at com.aston.AstonWizardsPlugin.installSnippetLibraries(Unknown Source)
    at com.aston.AstonWizardsPlugin.startup(Unknown Source)
    at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:50)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
    at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:349)
    at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:328)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCompatibility(EarlyStartupRunnable.java:140)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:68)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
    at org.eclipse.core.runtime.Platform.run(Platform.java:758)
    at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1281)
    at java.lang.Thread.run(Thread.java:534)

    !ENTRY org.eclipse.ui 4 4 Aug 25, 2004 07:24:54.644
    !MESSAGE Unhandled Exception

    !ENTRY com.genuitec.eclipse.wizards 4 0 Aug 25, 2004 07:24:54.654
    !MESSAGE Unable to execute early startup code for an extension
    !STACK 0
    java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCompatibility(EarlyStartupRunnable.java:140)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:68)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
    at org.eclipse.core.runtime.Platform.run(Platform.java:758)
    at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1281)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: org.eclipse.core.runtime.CoreException: Problems encountered starting up plug-in: “org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start() of bundle com.genuitec.eclipse.wizards.”.
    at org.eclipse.core.internal.plugins.PluginDescriptor.throwException(PluginDescriptor.java:284)
    at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:351)
    at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:328)
    … 9 more
    Root exception:
    org.eclipse.core.runtime.CoreException[2]: org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start() of bundle com.genuitec.eclipse.wizards.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:975)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
    at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:349)
    at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:328)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCompatibility(EarlyStartupRunnable.java:140)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:68)
    at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:615)
    at org.eclipse.core.runtime.Platform.run(Platform.java:758)
    at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1281)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.NoSuchMethodError: org.eclipse.gef.palette.PaletteEntry.getId()Ljava/lang/String;
    at com.genuitec.eclipse.snippetinstaller.SnippetInstaller.installLibrary(Unknown Source)
    at com.aston.AstonWizardsPlugin.installSnippetLibraries(Unknown Source)
    at com.aston.AstonWizardsPlugin.startup(Unknown Source)
    at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:50)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
    … 14 more

    !ENTRY org.eclipse.ui 4 4 Aug 25, 2004 07:24:54.664
    !MESSAGE Bad extension specification

    !ENTRY com.genuitec.eclipse.wizards 4 0 Aug 25, 2004 07:24:54.674
    !MESSAGE startup class must implement org.eclipse.ui.IStartup

    #213398 Reply

    support-jeff
    Member

    Nothing in log specifically about hibernate tools? Most of this looks like some install problems. Riyad, any clues from what peter has posted?

    Could you post the contents of the file <<workspace_dir>>/<<project>>/.myhibernatedata?

    #213419 Reply

    Riyad Kalla
    Member

    Peter,
    This is minor, but your Eclipse build ID (Build Id: 200406192000 ) is not for the final Eclipse 3.0 GA build, which our 3.8 GA release needs to run correctly. I wouldn’t be surprised if this wierdness clears itself up as soon as you reinstall Eclipse 3.0 GA and MyEclipse 3.8.1 + Quickfix.

    #213527 Reply

    peterwontner
    Member

    Re-installed as suggested, and it works. Thanks very much for all your help.

    #213547 Reply

    peterwontner
    Member

    Actually hitting another issue now. When I try and run a Hibernate based application from ME, I am getting the following exception while trying to initialise Hibernate transaction…

    java.lang.UnsupportedOperationException: The user must supply a JDBC connection
    at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32)
    at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)
    at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3326)
    at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3286)
    at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
    at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
    at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2231)
    at main.LockRegister.test(LockRegister.java:58)
    at main.LockRegister.main(LockRegister.java:109)
    13:50:14,290 INFO SessionFactoryObjectFactory:82 – Not binding factory to JNDI, no JNDI name configured

    My configuration file is shown below…
    <hibernate-configuration>

    <session-factory>
    <!– properties –>
    <property name=”connection.url”>jdbc:oracle:thin:@gba-build-xp:1521:chs</property>
    <property name=”dialect”>net.sf.hibernate.dialect.Oracle9Dialect</property>
    <property name=”connection.username”>chspeterw</property>
    <property name=”connection.password”>chspeterw</property>
    <property name=”connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>

    <property name=”show_sql”>true</property>
    <property name=”hbm2ddl.auto”>create</property>

    <!– mapping files –>
    <mapping resource=”/Lockreg.hbm.xml”/>

    </session-factory>

    </hibernate-configuration>

    I can’t figure out what is wrong with this. One thing I have noticed is that my configuration file is not being copied to the bin package during compilation.

    #213555 Reply

    Riyad Kalla
    Member

    Is your connection URL correct? (jdbc:oracle:thin:@gba-build-xp:1521:chs) it looked to me like you have an extra colon right before the @, but then again I am not farmiliar with Oracle connection strings.

    One thing I have noticed is that my configuration file is not being copied to the bin package during compilation.

    Is it in the root of your source tree? Do you have auto build on? Do you have any property files that are getting copied correctly?

    #213614 Reply

    peterwontner
    Member

    Have just found and fixed the issue. Was incorrectly creating the session factory. I neglegted to call configure() on the configuration object before calling buildSessionFactory() – what an idiot!

    But the last thing that is baffling me, which I think is either a real bug, or (more probably) user error. My hibernate mapping & configuration files are not being copied to the bin folder during a compile, so I have to manully add them before running. What could I be doing wrong?

    #213616 Reply

    Riyad Kalla
    Member

    Double check your Window > Preferences > Java > Compiler > Build Path (tab) > Filtered Resources

    field and make sure you don’t have .xml in there or something. By default the compiler will copy everything that is not a Java files and does not match that filter into the output dir. I’d also suggest checking your Workbench > Build resource automatically on modification settings just incase.

    Also maybe check your project’s own Compiler settings to make sure you don’t have the main compiler settings overridden.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: Hibernate configuration file gets cleared

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