1.Unable to add the resource

org.apache.catalina.webresources.Cache.getResource Unable to add the resource

原因:资源缓存空间不足,得配置更大的资源缓存空间

解决方法:修改 Tomcat 文件夹下 conf 文件中的 context.xml 文件,添加内容如下:

1
2
3
<Context>
<Resources cachingAllowed="true" cacheMaxSize="150000" ></Resources>
</Context>

2.naming.namingContextCreationFailed

org.apache.catalina.core.NamingContextListener.lifecycleEvent naming.namingContextCreationFailed

原因:命名监听器创建失败

3.至少有一个JAR被扫描用于TLD但尚未包含TLD。

org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。

等级:警告

解决方法:

1.修改 Tomcat 文件夹下 conf 文件夹中 logging.properties 文件

1
2
# 输出被扫描TLD的Jar包的列表
org.apache.jasper.servlet.TldScanner.level = FINE

2.重新运行 Tomcat ,日志输出扫描的Jar包

3.修改 Tomcat 文件夹下 conf 文件夹中 catalina.properties 文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Default list of JAR files that should not be scanned using the JarScanner
# functionality. This is typically used to scan JARs for configuration
# information. JARs that do not contain such information may be excluded from
# the scan to speed up the scanning process. This is the default list. JARs on
# this list are excluded from all scans. The list must be a comma separated list
# of JAR file names.
# The list of JARs to skip may be over-ridden at a Context level for individual
# scan types by configuring a JarScanner with a nested JarScanFilter.
# The JARs listed below include:
# - Tomcat Bootstrap JARs
# - Tomcat API JARs
# - Catalina JARs
# - Jasper JARs
# - Tomcat JARs
# - Common non-Tomcat JARs
# - Test JARs (JUnit, Cobertura and dependencies)
tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\
annotations-api.jar,\ant-junit*.jar,\ant-launcher.jar,\
ant.jar,\asm-*.jar,\aspectj*.jar,\bootstrap.jar,\catalina-ant.jar,\catalina-ha.jar,\
catalina-ssi.jar,\catalina-storeconfig.jar,\catalina-tribes.jar,\catalina.jar,\cglib-*.jar,\
cobertura-*.jar,\commons-beanutils*.jar,\commons-codec*.jar,\commons-collections*.jar,\
commons-daemon.jar,\commons-dbcp*.jar,\commons-digester*.jar,\
commons-fileupload*.jar,\commons-httpclient*.jar,\commons-io*.jar,\commons-lang*.jar,\
commons-logging*.jar,\commons-math*.jar,\commons-pool*.jar,\dom4j-*.jar,\easymock-*.jar,\
ecj-*.jar,\el-api.jar,\geronimo-spec-jaxrpc*.jar,\h2*.jar,\hamcrest-*.jar,\hibernate*.jar,\
httpclient*.jar,\icu4j-*.jar,\jasper-el.jar,\jasper.jar,\jaspic-api.jar,\jaxb-*.jar,\
jaxen-*.jar,\jdom-*.jar,\jetty-*.jar,\jmx-tools.jar,\jmx.jar,\jsp-api.jar,\jstl.jar,\
jta*.jar,\junit-*.jar,\junit.jar,\log4j*.jar,\mail*.jar,\objenesis-*.jar,\oraclepki.jar,\
oro-*.jar,\servlet-api-*.jar,\servlet-api.jar,\slf4j*.jar,\taglibs-standard-spec-*.jar,\
tagsoup-*.jar,\tomcat-api.jar,\tomcat-coyote.jar,\tomcat-dbcp.jar,\tomcat-i18n-*.jar,\
tomcat-jdbc.jar,\tomcat-jni.jar,\tomcat-juli-adapters.jar,\tomcat-juli.jar,\tomcat-util-scan.jar,\
tomcat-util.jar,\tomcat-websocket.jar,\tools.jar,\websocket-api.jar,\wsdl4j*.jar,\xercesImpl.jar,\
xml-apis.jar,\xmlParserAPIs-*.jar,\xmlParserAPIs.jar,\xom-*.jar
# 将要跳过扫描的包在后面添加
# 例子:mysql-connector-*.jar,\
# 注意以 ,\ 分隔