tomcat部署出现问题及解决方法

        问题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);
    }

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值