zoukankan      html  css  js  c++  java
  • SpringBoot配置SSLUnable to start ServletWebServerApplicationContext due to multiple ServletWebServerFa

    SpringBoot配置SSL后出现如下错误:

    Unable to start ServletWebServerApplicationContext due to multiple ServletWebServerFactory beans : webServerFactory,servletContainer

    完整报错:

    org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to multiple ServletWebServerFactory beans : webServerFactory,servletContainer
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:582) ~[spring-context-5.3.3.jar:5.3.3]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) [spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) [spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) [spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) [spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) [spring-boot-2.4.2.jar:2.4.2]
    	at ..main(.java:21) [classes/:na]
    Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to multiple ServletWebServerFactory beans : webServerFactory,servletContainer
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:214) ~[spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) ~[spring-boot-2.4.2.jar:2.4.2]
    	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:159) ~[spring-boot-2.4.2.jar:2.4.2]
    	... 9 common frames omitted
    

    也就是由于多个ServletWebServerFactory bean,无法启动ServletWebServerApplicationContext,具体纠错过程不说了,解决步骤:

    1. 查看代码里是不是有多个TomcatConfig
    2. 查看入口函数是不是加了 TomcatServletWebServerFactory,去掉一个。解决。
     
    一、一对多(@OneToMany)1、单向一对多模型假设通过一个客户实体可以获得多个地址信息。对于一对多的实体关系而言,表结构有两种设计策略,分别是外键关联和表关联。(1) 映射策略---外键关联在数据库中表customer和表结构address定义,如下:
     
    1
    create table customer (  id int(20) not null auto_increment,  name varchar(100),  primary key(id))create table address (  id int(20) not null auto_increment,  province varchar(50),  city varchar(50),  postcode varchar(50),  detail varchar(50),  customer_id int(20),  primary key (id)) 
    注意此时外键定义在多的一方,也就是address表中。
  • 相关阅读:
    jq获取滚动条高度
    用jq实现简单的tab选项卡
    bootstrap基础css样式1
    c3中的弹性盒子
    第一天注册
    Windows平台下结合 tortoiseSVN 和 VisualSVN Server 搭建SVN服务器并实现 web 站点同步
    【转载】IIS出现“HTTP 错误 500.0,C:phpphp-cgi.exe
    【转载】PHP5.3 配置文件php.ini-development和php.ini-production的区别
    解决 Composer-Setup.exe 安装过程中的报错
    IIS配置页面重写(配合插件url-rewrite2去除页面后缀名)
  • 原文地址:https://www.cnblogs.com/mryaohu/p/15057708.html
Copyright © 2011-2022 走看看