Home  >  Q&A  >  body text

java - Gradle打war包后,Tomcat启动没报错,却无法正常访问

问题描述

基于Gradle构建的JavaWeb项目,使用war命令打成war包。项目部署到测试环境Tomcat,Tomcat可以正常启动没有报错,访问项目时却无法访问。而通过eclipse的export的war包。却没有任何问题,可以正常访问。测试环境和开发环境的JDK版本是一致的。有谁知道原因或有更好的解决方案吗?

截图演示

Gradle配置文件里面添加了插件war

通过Gradle打成war包,无法正常访问

通过eclipse导出war包,可以正常访问

PHP中文网PHP中文网2742 days ago575

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:57:05

    This issue has been resolved. The reason is that when the API package of another project referenced in the project is included, the contents of the impl package are also included. Causes abnormal access to upper-level projects.

    reply
    0
  • Cancelreply