英文:
how to deploy the spring boot war on tomcat?
问题
我正在尝试在VS Code中使用以下命令创建Spring Boot应用程序的WAR文件:
mvn clean
mvn clean install
或
mvn clean install
或
mvn package
当我部署WAR文件到Tomcat并在浏览器中访问以下URL时:http://localhost:8080/welcome,Tomcat已启动,但我的欢迎路由不起作用,它给了我以下错误:
pom.xml:
application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/cghs2test
当我部署WAR文件到Tomcat时,我的控制器没有被触发。
这是我的控制器:
英文:
I am trying to make the war file of the spring boot application in vs code using this command
mvn clean
mvn clean install
or
mvn clean install
or
mvn package
when i am deploying the war on tomcat and check into the browser and hit this url http://localhost:8080/welcome but tomcat started and my welcome routes not working it gives me the error
pom.xml:
application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/cghs2test
when i deploying the war on tomcat my controller not hit
this is my controller
答案1
得分: 0
以下是已经翻译好的部分:
为构建Tomcat WAR文件:
Tomcat 9.x - Spring Boot 2.x
Tomcat依赖
pom.xml
Spring Boot Starter Data JPA
Spring Boot Starter Web
Spring Boot Starter Tomcat
Tomcat Embed Core
Thymeleaf(可选)
英文:
for building the tomcat war:
tomcat9.x - spring boot 2.x
dependecy tomcat
pom.xml
spring-boot-starter-data-jpa
spring-boot-starter-web
spring-boot-starter-tomcat
tomcat-embed-core
thymleaf(opt)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论