Eclipse Tomcat启动速度过快-在Tomcat中配置Spring Web App不起作用 [英] Eclipse Tomcat starts up too quickly - configuration of Spring Web App in Tomcat not working

查看:42
本文介绍了Eclipse Tomcat启动速度过快-在Tomcat中配置Spring Web App不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从零开始设置Web项目后,我偶尔遇到Spring Web App项目无法在Tomcat 8.5中正确启动的问题.我总是会做一些修复工作,而且我永远都不记得是什么解决方法.

在使用适当的运行时(项目方面->运行时-> Tomcat 8.5)配置为Web项目之后,立即进行构建,编译,确保所有正确的Java Build Path->库+部署程序集都正确(我具有Before/在为每个项目截图之后,并在Tomcat中运行,我得到以下过早完成.

  INFO:至少扫描了一个JAR来查找TLD,但其中不包含TLD.为该记录器启用调试日志记录,以获取已扫描的JAR的完整列表,但未在其中找到TLD.在扫描过程中跳过不需要的JAR可以缩短启动时间和JSP编译时间.2019年7月31日12:17:09 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration警告:maxIdle大于maxActive,将maxIdle设置为:22019年7月31日12:17:10 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration警告:maxIdle大于maxActive,将maxIdle设置为:22019年7月31日12:17:10 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration警告:maxIdle大于maxActive,将maxIdle设置为:22019年7月31日12:17:10 PM org.apache.jasper.servlet.TldScanner scanJars信息:至少对一个JAR进行了TLD扫描,但其中没有TLD.为该记录器启用调试日志记录,以获取已扫描的JAR的完整列表,但未在其中找到TLD.在扫描过程中跳过不需要的JAR可以缩短启动时间和JSP编译时间.2019年7月31日12:17:10 org.apache.coyote.AbstractProtocol开始INFO:启动ProtocolHandler ["http-nio-8080"]2019年7月31日12:17:10 org.apache.coyote.AbstractProtocol开始信息:启动ProtocolHandler ["ajp-nio-8009"]2019年7月31日12:17:10 PM org.apache.catalina.startup.Catalina开始INFO:服务器在4564毫秒内启动^^^应该在此之后多行:^^^例如,INFO:初始化Spring根WebApplicationContext,^^^ ContextLoader(第285行)-根WebApplicationContext:已启动初始化等. 

Web应用程序在 C:\ AppsConf \ myapp 中具有几个.properties,包括用于DB连接的属性.

我尝试通过几种方式指出该会议长目录:

1)运行方式->配置-> VM参数,其路径为 AppsConf ,如下所示:

2)我还通过右键单击我的Tomcat 8.5,从服务器"窗口中直接进行服务器重新启动.在这种情况下,我不知道它如何获取配置和属性.

注意这里有一个非常类似的问题,

I have the occasional problem of Spring Web App projects not properly starting up in Tomcat 8.5 after setting up the Web Project from scratch. I always do something to fix it, and I can never remember what fixes it.

Right after Configuring as Web Project with appropriate Runtime (Project Facets -> Runtimes -> Tomcat 8.5), Building, Compiling, ensuring all the correct Java Build Path -> Libraries + Deployment Assembly are all correct (I have the Before/After screenshots for each project), and running in Tomcat, I get the following premature completion.

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.
Jul 31, 2019 12:17:09 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration
WARNING: maxIdle is larger than maxActive, setting maxIdle to: 2
Jul 31, 2019 12:17:10 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration
WARNING: maxIdle is larger than maxActive, setting maxIdle to: 2
Jul 31, 2019 12:17:10 PM org.apache.tomcat.jdbc.pool.ConnectionPool checkPoolConfiguration
WARNING: maxIdle is larger than maxActive, setting maxIdle to: 2
Jul 31, 2019 12:17:10 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.
Jul 31, 2019 12:17:10 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Jul 31, 2019 12:17:10 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jul 31, 2019 12:17:10 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4564 ms

^^^ supposed to be many more lines after this: 
^^^ e.g., INFO: Initializing Spring root WebApplicationContext, 
^^^ ContextLoader(Line 285) - Root WebApplicationContext: initialization started, etc., etc.

The Web App has several .properties, including for DB connection, in C:\AppsConf\myapp.

I try to point this Conf Dir in several ways:

1) Run As -> Configuration -> VM Arguments with the path, AppsConf, as follows:

2) I also do a direct Server Restart from the Servers window, by right-clicking on my Tomcat 8.5. In this case I don't know how it gets the configuration and the properties.

NOTE A very similar question is here, Spring root WebApplicationContext not getting initialized in eclipse

解决方案

We solved this issue.

The Deployment Assembly had the default /Web Content. It had to be changed to our custom value, /webroot, which we are using.

这篇关于Eclipse Tomcat启动速度过快-在Tomcat中配置Spring Web App不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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