问题1: org.apache.catalina.webresources.Cache.getResource 无法将位于[/WEB-INF/classes/BOOT-INF/classes/static/scripts/plugins/layui/images/face/2.gif]的资源添加到Web应用程序[/tpi-web-1.0]的缓存中,因为在清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间
解决方法:在tomcat的/conf/context.xml中的<Context>中添加
<!--这里单位是 KB-->
<Resources cachingAllowed="true" cacheMaxSize="100000" />
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resources cachingAllowed="true" cacheMaxSize="100000" />
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
问题2:tomcat控制台中文乱码
解决办法:1、找到~/conf/logging.properties
2、将 java.util.logging.ConsoleHandler.encoding = UTF-8
改为:java.util.logging.ConsoleHandler.encoding = GBK
3、重启tomcat
java.util.logging.ConsoleHandler.encoding = GBK
问题3:关闭tomcat命令行窗口
找到tomcat下bin\setclasspath.bat,在文件的底部找到以下内容:
set _RUNJAVA=”%JRE_HOME%\bin\java.exe” 并修改为
set _RUNJAVA=”%JRE_HOME%\bin\javaW.exe”
保存后重新启动tomcat即可以在不出现命令行窗口的情况下运行。
set _RUNJAVA="%JRE_HOME%\bin\javaW.exe"
问题4:tomcat部署springboot war包, 项目启动不了,命令行窗口不出现项目启动信息,在spring前面就停掉了,仅仅是把war给解压
让启动类继承SpringBootServletInitializer,重写configure方法
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import tk.mybatis.spring.annotation.MapperScan;
@MapperScan("com.test.mapper")
@SpringBootApplication
public class PmsApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(PmsApplication.class);
}
public static void main(String[] args) {
SpringApplication.run(PmsApplication.class, args);
}
}