【问题标题】:In Eclipse running a Java EE Web Server "Servlet" on Tomcat project attempts to deploy extraneous directories在 Eclipse 中,在 Tomcat 项目上运行 Java EE Web 服务器“Servlet”尝试部署无关目录
【发布时间】:2018-12-27 19:07:26
【问题描述】:

我在 Eclipse 的 Tomcat 项目上有一个普通的 Java EE Servlet。当我在 Eclipse 中启动 Tomcat 服务器(甚至在我开始运行 Servlet 之前)时,它会尝试为我的 D: 驱动器中的所有内容部署一个 Web 应用程序目录。它甚至尝试在 D:\$RECYCLE.BIN 目录上部署 Web 应用程序。然后说完成了。

这是 Eclipse 中项目组织的图像。

谁能猜出是什么设置或 xml 指令使它这样做?

Dec 27, 2018 1:27:51 PM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/8.0.36

Dec 27, 2018 1:27:55 PM org.apache.jasper.servlet.TldScanner scanJars

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Dec 27, 2018 1:27:58 PM org.apache.jasper.servlet.TldScanner scanJars

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Dec 27, 2018 1:27:58 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\$RECYCLE.BIN

Dec 27, 2018 1:27:59 PM org.apache.jasper.servlet.TldScanner scanJars

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Dec 27, 2018 1:27:59 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deployment of web application directory D:\$RECYCLE.BIN has finished in 1,124 ms

Dec 27, 2018 1:27:59 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deploying web application directory D:\Customers

Dec 27, 2018 1:28:00 PM org.apache.jasper.servlet.TldScanner scanJars

INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Dec 27, 2018 1:28:00 PM org.apache.catalina.startup.HostConfig deployDirectory

INFO: Deployment of web application directory D:\Customers has finished in 927 ms

【问题讨论】:

  • 你检查this topic了吗?
  • 您应该向我们展示您的正常项目的结构和位置。此设置中的 D:\Customers 是什么?由于并非到处都报告了这一点,因此假设您的项目特别有问题。通过向我们提供详细信息来帮助我们解决问题。
  • D:\Customers 只是另一个与本项目无关的目录。不知何故,当我启动 Tomcat 服务器时,它会尝试在我的 D: 驱动器上的每个目录中部署一个 Web 应用程序。
  • 查看您的服务器配置。 Java EE 透视图 - 服务器选项卡 - 双击您的服务器。
  • 谢谢,我看不到任何可疑的东西。为什么 Tomcat 首先会尝试部署任何 Web 应用程序。 Tomcat 服务器不应该只是等待某人访问 Web 应用程序吗?

标签: java eclipse tomcat servlets jakarta-ee


【解决方案1】:

我无法解释为什么会发生这种一致的错误配置,但这里是如何解决它。在 Eclipse Workspace 文件夹中找到“server.xml”文件。如果您发现不止一个,请避开“tmp0”目录中的那个,不要与“servers.xml”混淆。

找到“Host”属性并将“appBase”设置为您的 Web 应用所在的目录和/或将“autoDeploy”设置为“false”。

我不知道为什么,但每当我在 Eclipse 工作区中添加 Tomcat 服务器时,它都会自动将“appBase”设置为“D:\”,并将“autoDeploy”设置为“true”。我尝试重新安装 Eclipse,从头开始创建新的工作区。结果总是一样的。因此,它会搜索我 D 盘中的每个文件夹以查找要运行的 Web 应用程序。

【讨论】:

    猜你喜欢
    • 2015-03-20
    • 1970-01-01
    • 2016-06-13
    • 1970-01-01
    • 1970-01-01
    • 2011-08-28
    • 2014-10-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多