问题解决:java.io.IOException: java.lang.reflect.InvocationTargetException,serializer.jar等包找不到

两种解决办法:

第一种是在启动类家方法:

    @Bean
    public TomcatServletWebServerFactory tomcatFactory(){
        return new TomcatServletWebServerFactory(){
 
            @Override
            protected void postProcessContext(Context context) {
                ((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
            }
        };
    }

第二种方法是排除相关依赖:

<!--编译JSP,包含了tomcat-embed-core,tomcat-embed-el -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
 <!--用于编译jsp -->
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
</dependency>        
<!--如果使用了JSTL标签库则需要添加如下依赖 -->
<dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>jstl</artifactId>
</dependency>

参考博客:https://blog.csdn.net/wfanking/article/details/98204730

https://blog.csdn.net/Jungle_Rao/article/details/100154198

posted on 2020-05-17 16:15  江上酒,故人倾  阅读(1278)  评论(0编辑  收藏  举报