如何在Tomcat 9.0.44服务器上运行Grails 5.1.7应用程序-HTTP 404

发布于 2025-02-03 23:47:23 字数 1443 浏览 2 评论 0原文

我使用Grails版本4.0.5的旧应用程序用于完美运行。被迫更新Gradle后,我无法编译它。然后,我创建了一个带有Grails 5.1.7的新项目,并使用新命令更新了build.gradle文件,最后对其进行了编译。该应用程序在我的计算机中运行正常:

grails run-app

但是,当我使用命令创建并运行创建的.war文件时:

grails war

在我的Tomcat服务器中,我没有部署错误,但是HTTP请求始终获得 http 404 错误。

因此,我决定制作一个新的香草5.1.7 Grails项目,并尝试进行新的清洁战争。这个新项目也可以在我的计算机上完美运行,并通过Run-App完美地运行,并且没有错误,但还显示 HTTP 404 错误,您尝试检索页面。

我一直在阅读有关 Grails Wars Wars War 命令的文档的文档,可以在tomcat上引起问题:

https://docs.grails.org/guide/guide/guide/guide/guide/deployment.html#deployment stance-deploymentstancestandalone </

>从build.gradle中删除:

implementation  "org.springframework.boot:spring-boot-starter-tomcat"

但仍然没有运气,我一直在 http 404 错误。

摘要:

我的Grails 4.0.5应用程序可以使用“ Grails War”创建战争文件,因此我不确定此“可嵌入”是否是造成问题的原因。由于我没有错误,所以我没有任何线索。

任何帮助都将不胜感激

我已经测试过的

:机器1:

  • ubuntu 20.10
  • apache tomcat 9.0.44
  • OpenJDK版本“ 11.0.11”

机器2:

  • Windows 10
  • Apache Tomcat 10.0.10

OpenJDK版本11.0.0.0.11 两个都。

我还试图添加: ext ['tomcat.version'] = '10 .0.10'在gradle的情况下。不起作用。

My old application with grails version 4.0.5 used to run perfectly. After being forced to update gradle I wasnt able to make it even compile. Then, I created a new project with grails 5.1.7, updated the build.gradle file with the new commands and finally it compiled. The application runs fine in my computer with:

grails run-app

However, when I make and run the .war file created with the command:

grails war

in my tomcat server, I get no errors on deployment, but http request always get an HTTP 404 error.

So I decided to make a new vanilla 5.1.7 grails project and try to make a new clean war. This new project also runs perfectly on my computer with run-app and also is deployed with no errors but also shows the HTTP 404 error with you try to retrieve a page.

I have been reading on grails documentation that grails war command makes a embedded container and could cause problems on tomcat:

https://docs.grails.org/latest/guide/deployment.html#deploymentStandalone

So, I tried to follow the advice and remove from build.gradle:

implementation  "org.springframework.boot:spring-boot-starter-tomcat"

But still no luck, I keep getting the HTTP 404 error.

Summary:

My grails 4.0.5 application ran just fine creating the war file with "grails war", so I am not sure if this "embeddable" is the cause of the problem. Due to I get no errors I have no clue.

Any help would be appreciated

Machines and software I've tested:

Machine 1:

  • Ubuntu 20.10
  • Apache tomcat 9.0.44
  • openjdk version "11.0.11"

Machine 2:

  • Windows 10
  • Apache tomcat 10.0.10
  • openjdk version "11.0.11"

Same result on both.

I have also tried to add:
ext['tomcat.version'] = '10.0.10' to gradle in case. Not working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若相惜即相离 2025-02-10 23:47:23

我设法通过将JVM版本从11到16更新,在Tomcat 8和Tomcat 9上运行了Grails 5应用程序。似乎Grails 5不支持Tomcat 10。

I managed to run the Grails 5 application on Tomcat 8 and Tomcat 9 by updating the JVM version from 11 to 16. It seems like Grails 5 doesnt support Tomcat 10.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文