-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: NoClassDefFoundError with Hibernate configuration
PostPosted: Fri Oct 26, 2007 1:18 pm 
Newbie

Joined: Fri Oct 26, 2007 1:04 pm
Posts: 3
I have created a hibernate.cfg.xml with the following content

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
        <property name="hibernate.connection.url">jdbc:hsqldb:.</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.default_schema">appfuse_light</property>
        <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
    </session-factory>
</hibernate-configuration>



and also the console configuration.

But I got a NoClassDefFoundError error when I open the "Session Factory"
node or the "Database" node.

Here are the error message from log file
Code:
!ENTRY org.hibernate.eclipse.console 4 4 2007-10-27 00:34:20.775
!MESSAGE Problems while creating sessionfactory
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2007-10-27 00:34:20.775
!MESSAGE java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
!STACK 0
java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
   at org.slf4j.impl.Log4jLoggerAdapter.isTraceEnabled(Log4jLoggerAdapter.java:81)
   at org.apache.commons.logging.impl.SLF4JLocationAwareLog.isTraceEnabled(SLF4JLocationAwareLog.java:61)
   at org.hibernate.type.NullableType.<clinit>(NullableType.java:35)
   at org.hibernate.Hibernate.<clinit>(Hibernate.java:80)
   at org.hibernate.type.TypeFactory.<clinit>(TypeFactory.java:46)
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:260)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.Property.isValid(Property.java:185)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:357)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:352)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:89)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:95)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2007-10-27 00:34:20.775
!MESSAGE java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
!STACK 0
java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
   at org.slf4j.impl.Log4jLoggerAdapter.isTraceEnabled(Log4jLoggerAdapter.java:81)
   at org.apache.commons.logging.impl.SLF4JLocationAwareLog.isTraceEnabled(SLF4JLocationAwareLog.java:61)
   at org.hibernate.type.NullableType.<clinit>(NullableType.java:35)
   at org.hibernate.Hibernate.<clinit>(Hibernate.java:80)
   at org.hibernate.type.TypeFactory.<clinit>(TypeFactory.java:46)
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:260)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.Property.isValid(Property.java:185)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:357)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:352)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:89)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:95)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.core.jobs 4 2 2007-10-27 00:35:30.025
!MESSAGE An internal error occurred during: "Fetching children of Database".
!STACK 0
java.lang.NoClassDefFoundError
   at org.hibernate.dialect.Dialect.<init>(Dialect.java:156)
   at org.hibernate.dialect.HSQLDialect.<init>(HSQLDialect.java:42)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:78)
   at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:42)
   at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:91)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:88)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:57)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:95)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.hibernate.eclipse.console 4 4 2007-10-27 00:35:43.775
!MESSAGE Problems while creating sessionfactory
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2007-10-27 00:35:43.775
!MESSAGE <No message>
!STACK 0
java.lang.NoClassDefFoundError
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:260)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.Property.isValid(Property.java:185)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:357)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:88)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:352)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:89)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:95)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 1:23 pm 
Newbie

Joined: Fri Oct 26, 2007 1:04 pm
Posts: 3
Just a comment.

Quote:
But I got a NoClassDefFoundError error when I open the "Session Factory"
node or the "Database" node.


This means the nodes in hibernate configuration view.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 26, 2007 11:39 pm 
Newbie

Joined: Fri Oct 26, 2007 1:04 pm
Posts: 3
This issue has been solved. But I couldn't find the root cause.

I just replaced the jar file plugins\org.hibernate.eclipse_3.2.0.beta11\lib\hibernate\log4j-1.2.11.jar with 1.2.12 version. This version of log4j add the method isTraceEnabled which is cause the NoSuchMethodError.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 28, 2007 8:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
root cause must have been that you had multiple versions of log4j.jars on the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 04, 2007 12:49 am 
Newbie

Joined: Mon Sep 17, 2007 11:42 pm
Posts: 16
Location: Auckland, New Zealand
I have exactly the same problem. However switching the log4j JAR results in this:

Code:
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.hibernate.eclipse.console (529).
   at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
   at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160)
   at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:788)
   at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
   at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
   at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:252)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
   at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:248)
   at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:69)
   at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:327)
   at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:227)
   at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
   at org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActive(WorkbenchPage.java:4080)
   at org.eclipse.ui.internal.WorkbenchPage$17.runWithException(WorkbenchPage.java:3145)
   at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
   at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:801)
   at org.eclipse.ui.internal.Workbench$25.runWithException(Workbench.java:1342)
   at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
   at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
   at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
   at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
   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:169)
   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:508)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Caused by: org.osgi.framework.BundleException: The activator org.hibernate.eclipse.console.HibernateConsolePlugin for bundle org.hibernate.eclipse.console is invalid
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141)
   at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:970)
   at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
   at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
   at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
   ... 55 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/eclipse/logging/PluginLogger
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:161)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:501)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:471)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:430)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:413)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
   at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:134)
   ... 60 more
[/code]

_________________
Don't forget to rate! :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 05, 2007 1:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
any chance you guys have multiple versions of the plugin loaded?

is this on a plain eclipse wtp or ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.