小编geo*_*rge的帖子

在尝试使用hibernate工具生成pojos或映射时,我得到了一个noclassdeffounderror

我正在尝试从我的数据库生成pojos但我在eclipse indigo 3.7.2上安装了hibernate工具3.4插件和hibernate 3.6.10库(它们似乎都是)在构建路径中出现以下错误

精简版 :

org.hibernate.console.HibernateConsoleRuntimeException: Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
  java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
  Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
    java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
    Could not initialize class org.hibernate.cfg.reveng.OverrideRepository
Run Code Online (Sandbox Code Playgroud)

来自项目构建路径的MY罐子(按顺序排列):

  • hibernate-distribution-3.6.10.Final\hibernate.jar文件
  • hibernate-distribution-3.6.10.Final\LIB \需要\ ANTLR-2.7.6.jar
  • hibernate-distribution-3.6.10.Final\LIB \需要\公地集合-3.1.jar
  • hibernate-distribution-3.6.10.Final\LIB \所需\的dom4j-1.6.1.jar
  • hibernate-distribution-3.6.10.Final\LIB \需要\ Javassist进行-3.12.0.GA.jar
  • hibernate-distribution-3.6.10.Final\LIB \需要\ JTA-1.1.jar …

eclipse code-generation hibernate pojo hibernate-tools

4
推荐指数
1
解决办法
9298
查看次数

org.hibernate.MappingException:找不到实体类(使用限定类名不起作用)

我正在尝试运行一个简单的SELECT FROM表(我也尝试过SELECT FROM package.Class)查询,但我一直收到此错误:

 org.hibernate.MappingException: entity class not found: demo.Agents
    at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:125)
    at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191)
    at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67)
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:136)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:475)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133)
    at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:297)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
    at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:278)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
    at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:273)
    at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:82)
    at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:56)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:60)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) …
Run Code Online (Sandbox Code Playgroud)

orm hql hibernate-tools

3
推荐指数
3
解决办法
2万
查看次数

标签 统计

hibernate-tools ×2

code-generation ×1

eclipse ×1

hibernate ×1

hql ×1

orm ×1

pojo ×1