404将Grails 3.1.10 War部署到tomcat7或tomcat8时 [英] 404 when deploying Grails 3.1.10 war to tomcat7 or tomcat8

查看:211
本文介绍了404将Grails 3.1.10 War部署到tomcat7或tomcat8时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解释我的症状的最接近的stackoverflow问题在这里-

管理器显示myapp-0.1,因为war文件是myapp-0.1.war ..目前还可以.

我正在运行Grails 3.1.10.

我已尝试针对Tomcat 7.0.55和8.0.92.

我尝试将application.groovy中的grails.serverUrl更改为各种值.现在是:

//fix war name after get working
grails.serverUrl = "/myapp-0.1"
System.setProperty("server.contextPath","/myapp-0.1")

我尝试了不带-0.1的上述内容. (我很惊讶得知这是必要的- https://stackoverflow.com/a/23664531/104993 )

我尝试在build.gradle文件中将"org.springframework.boo:spring-boot-starter-tomcat"从编译"更改为提供".

请让我知道我需要详细说明的内容.粘贴日志输出和配置文件很困难. (我在防火墙后面)

解决方案

您将以下任务添加到build.gradle中,它将根据您的需要命名战争:

task wrapper(type:Wrapper){
     war.archiveName='myWar.war'
}

然后,当您部署它时,它应该具有正确的名称,并且可以转到 https://localhost:8080/myWar

The closest stackoverflow question that explains my symptoms is here - How can I deploy a Grails 3.0.1 war file in Tomcat7?

I am in the process of upgrading a Grails 2.3.4 application to Grails 3.1.10 and everything is working with 'grails run-app'.

When i deploy to a war i get nothing but 404's for any url.

The war deploys without any error messages in catalina.out.

The tomcat access logs show my access attempts. (not linux problem?)

I can get to the tomcat manager, and the tomcat manager shows my app as "running" as true. (no errors)

Manager shows myapp-0.1 because the war file was myapp-0.1.war .. this is fine for now.

I am running Grails 3.1.10.

I have tried against Tomcat 7.0.55 as well as 8.0.92.

I have tried changing grails.serverUrl in application.groovy to various values. It is now:

//fix war name after get working
grails.serverUrl = "/myapp-0.1"
System.setProperty("server.contextPath","/myapp-0.1")

I have tried the above without "-0.1". (i was suprised to learn this was necessary - https://stackoverflow.com/a/23664531/104993)

I have tried changing "org.springframework.boo:spring-boot-starter-tomcat" from "compile" to "provided" in the build.gradle file.

Please let me know what I need to elaborate on. It's difficult to paste log outputs and config files. (i'm behind a firewall)

解决方案

You add the following task to your build.gradle it will name the war what ever you want:

task wrapper(type:Wrapper){
     war.archiveName='myWar.war'
}

Then when you deploy it should have the correct name and you can go to https://localhost:8080/myWar

这篇关于404将Grails 3.1.10 War部署到tomcat7或tomcat8时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆