【问题标题】:What is the correct Eclipse setup for JHipster?JHipster 的正确 Eclipse 设置是什么?
【发布时间】:2014-04-20 20:54:12
【问题描述】:

我第一次尝试在 STS Eclipse 中编译 jhipster 项目时遇到此错误。

The type org.springframework.core.NestedRuntimeException cannot be resolved. It is indirectly referenced from required .class files CustomPersistentRememberMeServices.java /us-modeldrivers-jhipsterTest003/src/main/java/us/modeldrivers/jhipsterTest003/security line 1  Java Problem

到目前为止我的过程:

  • 安装 jhipster 并运行项目构建
  • 在 STS Eclipse 中创建 Spring 项目
  • 将 pom 更新为 jhipster 生成的 pom
  • 将jhipster代码复制到eclipse项目中相应的包中
  • 得到“tools.jar not found 错误,所以强制eclipse使用JDK,而不是JRE
  • 出现“javax.servlet.http.HttpServletResponse cannot be resolved”错误,所以将Tomcat运行时库添加到构建路径中
  • 得到 NestedRuntimeException not found 错误,找不到任何答案,意识到一定是做错了什么。

感谢您的帮助。

编辑 2014-03-17 我安装了新版本的 STS,包括 32 位和旧版本 - 结果相同 - 缺少 jar 文件。

我可以通过添加来摆脱丢失的 javax.servlet.http.HttpServletResponse

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<version>1.2</version>
</dependency>

我可以通过添加来摆脱丢失的 javax.servlet.http.HttpServletResponse

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>

但是 jhipster 不能指望你在 pom 中添加核心弹簧来工作。

在 STS 之外一定有什么问题?

在 Maven 尝试将所需的 jar 文件下载到 Users\IBP.m2\repository\org\springframework\spring-instrument\3.0.5.RELEASE 之前,我遇到了问题(例如)。如果这失败了,那么它不会再试一次。所以你找到失败的东西并删除它的目录——这会强制重新下载。但在这种情况下,据说丢失的东西在其他项目的 .m2 中。

无论如何,这是一个完全的猜测,我完全被卡住了。

【问题讨论】:

    标签: spring jhipster


    【解决方案1】:

    我做了以下步骤,它有效

    • 安装sts 3.4.0版本
    • 使用 yo jhipster 命令生成一个新项目
    • 在sts中导入生成的项目
    • 将 Application.java 作为应用程序运行

    一切正常。

    【讨论】:

    • 谢谢杰罗姆。我尝试重新安装新的 STS,不幸的是结果相同。我完全被困住了。
    【解决方案2】:

    这是由损坏的 Maven 存储库引起的。我清除了 Maven 缓存,它工作正常。感谢 IntelliJ 的支持人员。

    【讨论】:

      【解决方案3】:

      您可以在 eclipse 中安装 sts 并将项目作为现有 maven 项目导入,然后从项目属性中排除 node_modes 和 bower 组件。

      【讨论】:

        【解决方案4】:

        您上面的答案是正确的...主要问题很可能是您正在做以下两件事之一:

        1. 将代码复制/粘贴到 STS 而不是导入。
        2. 尝试通过执行“在服务器上运行”而不是“作为 Spring Boot 运行”来运行应用程序。

        【讨论】:

          【解决方案5】:

          在“Run As”上下文菜单中,您应该运行“Maven clean”,然后运行“Maven install”。然后您可以通过Application 类上的“Run As/Java Application”启动应用程序。

          【讨论】:

            猜你喜欢
            • 2010-10-30
            • 2017-12-17
            • 1970-01-01
            • 1970-01-01
            • 2012-01-29
            • 2021-12-06
            • 1970-01-01
            • 1970-01-01
            • 2016-06-23
            相关资源
            最近更新 更多