【问题标题】:Hibernate MultiMap cannot be found while code generation代码生成时找不到 Hibernate MultiMap
【发布时间】:2016-08-18 02:03:30
【问题描述】:

当我尝试使用现有的数据库关系通过 Hibernate 生成一些类时,它会产生一些错误:

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
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: org/apache/commons/collections/MultiMap
org/apache/commons/collections/MultiMap
java.lang.ClassNotFoundException: org.apache.commons.collections.MultiMap cannot be found by org.jboss.tools.hibernate.runtime.v_5_1_5.0.1.Final-v20160331-1852-B88
org.apache.commons.collections.MultiMap cannot be found   byorg.jboss.tools.hibernate.runtime.v_5_1_5.0.1.Final-v20160331-1852-B88

我的 Maven 文件:

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
    </configuration>
  </plugin>
</plugins>
</build>
<dependencies>
<dependency>
    <groupId>org.firebirdsql.jdbc</groupId>
    <artifactId>jaybird-jdk18</artifactId>
    <version>2.2.10</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>5.1.0.Final</version>
</dependency>
<dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.2.2</version>
</dependency>

我在 Maven 依赖项中看到了 apache common-collections jar,我可以在我的代码中使用 apache 的 MultiMap。

【问题讨论】:

  • 也许系统库有什么地方可以让 Eclipse 的 Hibernate 插件查找像 apache-common-collections 这样的 jars 吗?
  • 问题报告hibernate.atlassian.net/browse/HBX-1256 ...等待zzzZZzzZZzz
  • 现在好像解决了。我已经从 jboss mars 存储库重新安装了 Hibernate Tools,并且神奇地工作了! ;)
  • 确认。为我工作。谢谢。
  • 我遇到了同样的问题,重新安装并没有解决这个问题。

标签: java apache hibernate maven jpa


【解决方案1】:

我遇到了同样的问题。这是我修复它的方法: 打开编辑配置对话框并转到类路径选项卡,删除项目名称(默认类路径),单击“添加项目...”按钮添加您的项目。 然后就可以了。

或者您可以尝试使用以前的版本而不是 v5.1。在休眠的角度,“您的配置”/编辑配置,将休眠版本更改为以前的版本,如 v4.3。

【讨论】:

    【解决方案2】:

    只是插话:Eclipse Mars。休眠 5.1.0。 JDK 8。正如上面提到的 Gordon 和 Kevin,在 Edit Configuration 中将 Hibernate 的版本更改为 4.3 对我有用。

    【讨论】:

      【解决方案3】:

      我在控制台配置文件中将休眠版本5.1改为4.3。

      1. 设置休眠视角
      2. 打开休眠配置选项卡
      3. 在你的配置上点击右键
      4. 选择编辑配置
      5. 将休眠版本 5.1 更改为 4.3

      【讨论】:

        【解决方案4】:

        为我修复:Mars 使用 Hibernate Tools 插件 v. 5.1.4。我只需要在“搜索更新”后点击“更新”

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2012-05-30
          • 1970-01-01
          • 2022-01-12
          • 1970-01-01
          • 2020-08-20
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多