【问题标题】:JRebel in IntelliJ web project, 404 errorIntelliJ web 项目中的 JRebel,404 错误
【发布时间】:2019-04-30 20:53:49
【问题描述】:

我首先在 Eclipse 中创建了一个 JEE Web 项目。我使用 Eclipse jrebel 插件进行调试,一切正常。现在我已经将它迁移到 IntelliJ,并且正在使用 JRebel 插件。当我运行该项目时,它似乎部署得很好。启动代码上的断点被命中。但是,当我在浏览器中打开主页时,出现错误“服务器无法理解请求。 (404)'。 REST 调用不起作用。 我没有尝试对代码进行任何动态更改,只是想让它先运行。

我查看了 jrebel.log,没有什么特别之处。

【问题讨论】:

  • 检查运行配置中的部署上下文,查看服务器日志。确保打开与部署上下文对应的正确 URL。
  • 这是正确的 URL - 如果在 IDE 中以纯调试方式运行,它可以正常工作。这些问题仅在使用 JRebel Debug 运行时出现

标签: intellij-idea web-deployment jrebel


【解决方案1】:

我找到了解决方案 - 不要使用 IntelliJ 生成的 rebel.xml 文件,而是使用 maven 插件。将此添加到父 pom 中的 maven 文件中 -

<build>
...
 <plugin>
                    <groupId>org.zeroturnaround</groupId>
                    <artifactId>jrebel-maven-plugin</artifactId>
                    <version>1.1.9</version>
                    <executions>
                          <execution>
                                <id>generate-rebel-xml</id>
                                <phase>process-resources</phase>
                                <goals>
                                      <goal>generate</goal>
                                </goals>
                          </execution>
                    </executions>
              </plugin>
...
</build>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-15
    • 2016-05-13
    • 1970-01-01
    • 2014-03-25
    • 2014-07-08
    • 2011-10-02
    • 2017-01-11
    • 2018-08-08
    相关资源
    最近更新 更多