Failed to start bean 'webServerStartStop'; nested exception is org.springframework.beans.FatalBeanException: ServletWebServerFactory implementation
使用jeecgboot报错
jeecg单测跑不起来,报错如下
Failed to start bean 'webServerStartStop'; nested exception is org.springframework.beans.FatalBeanException: ServletWebServerFactory implementation org.jeecg.config.init.TomcatFactoryConfig$1 cannot be instantiated. To allow a separate management port to be used, a top-level class or static inner class should be used instead
经验证需要配置端口
connector.setPort(Integer.valueOf(port));
package org.jeecg.config.init;
import javax.servlet.MultipartConfigElement;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;
/**
* @Description: TomcatFactoryConfig
* @author: scott
* @date: 2021年01月25日 11:40
*/
@Configuration
public class TomcatFactoryConfig {
@Value("${server.port}")
private String port;
@Value("${server.acceptorThreadCount}")
private String acceptorThreadCount;
@Value("${server.minSpareThreads}")
private String minSpareThreads;
@Value("${server.maxSpareThreads}")
private String maxSpareThreads;
@Value("${server.maxThreads}")
private String maxThreads;
@Value("${server.maxConnections}")
private String maxConnections;
@Value("${server.protocol}")
private String protocol;
@Value("${server.redirectPort}")
private String redirectPort;
@Value("${server.compression}")
private String compression;
@Value("${server.connectionTimeout}")
private String connectionTimeout;
@Value("${server.MaxFileSize}")
private String MaxFileSize;
@Value("${server.MaxRequestSize}")
private String MaxRequestSize;
@Bean
public ServletWebServerFactory servletContainer() {
TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
tomcat.addConnectorCustomizers(new GwsTomcatConnectionCustomizer());
return tomcat;
}
// @Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
// 单个数据大小
factory.setMaxFileSize(DataSize.parse(MaxFileSize)); // KB,MB
/// 总上传数据大小
factory.setMaxRequestSize(DataSize.parse(MaxRequestSize));
return factory.createMultipartConfig();
}
/**
*
* 默认http连接
*
* @version
* @author liuyi 2016年7月20日 下午7:59:41
*
*/
public class GwsTomcatConnectionCustomizer implements TomcatConnectorCustomizer {
public GwsTomcatConnectionCustomizer() {
}
@Override
public void customize(final Connector connector) {
connector.setPort(Integer.valueOf(port));
// connector.setProperty("connectionTimeout", connectionTimeout);
// connector.setProperty("acceptorThreadCount", acceptorThreadCount);
// connector.setProperty("minSpareThreads", minSpareThreads);
// connector.setProperty("maxSpareThreads", maxSpareThreads);
// connector.setProperty("maxThreads", maxThreads);
// connector.setProperty("maxConnections", maxConnections);
// connector.setProperty("protocol", protocol);
// connector.setProperty("redirectPort", redirectPort);
// connector.setProperty("compression", compression);
connector.setProperty("relaxedPathChars", "[]{}");
connector.setProperty("relaxedQueryChars", "[]{}");
}
}
}
主要是去掉
((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
Failed to start bean 'webServerStartStop'; nested exception is org.springframework.beans.FatalBeanException: ServletWebServerFactory implementation的更多相关文章
- Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException
错误提示: defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean ...
- nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException
You should autowire interface AbstractManager instead of class MailManager. If you have different im ...
- Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyExce
Error setting property values ; nested exception is org.springframework.beans.NotWritablePropertyExc ...
- Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.liuyang.JDbCTemplate.PersonDao]: No default constructor fo
错误是说我的配置文件中没有对构造函数进行配置,所以找不到构造函数,在配置文件application.xml中加入如下句子: <bean id="personDao" clas ...
- Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'dataSource' of bean class [com.liuyang.jdbc.PersonDao]: No property 'dataSource
这个错误是说我的启动失败了.这类问题要从配置文件中开始找原因,我用的是spring框架,所以我从application.中找的原因 然后对比路径,对比文件的命名和id,都没有问题,为什么会在启动的时候 ...
- Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/codec/Codec
最新版本的Spring需要reactor 2.0,看看你的POM有一个明确的1.1.6依赖. 解决: <dependency> <groupId>org.projectreac ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'supplierAction': Injection of resource dependencies failed; nested exception is org.springframework.beans.factor
这个错误是因为抽象Action类的时候,把ServletContext写成了serverContext,导致无法注入,正确写法是 import javax.annotation.Resource; i ...
- SpringBoot项目启动org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException解决方法
将Pom文件中的SpringBoot版本调低即可. 我的是调成了2.5.6
- SpringBoot项目集成Swagger启动报错: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is
使用的Swagger版本是2.9.2.knife4j版本是2.0.4. SpringBoot 版本是2.6.2将SpringBoot版本回退到2.5.6就可以正常启动
- Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with na
问题: Springboot 启动时出错,报没法创建bean的错误,看到nested最后是关于mongoTemplate的错误. 过程: 看网上大多说的是修改mongoTemplate的配置,但是sp ...
随机推荐
- 1.2 HELLO 三角形
这一节,我觉得是相当有难度的.渲染一个三角形,就需要介绍GLSL语言,图形渲染管线(Graphics Pipeline)以及着色器(Shader),标准化设备坐标(NDC)等诸多概念. 图形渲染管线和 ...
- sklearn分类模块
学习数据酷客做的笔记,懒得自己打字,就截屏记录一下,方便以后回顾.
- 泛型dotnet
// 什么是泛型List<T> T:表示类型参数,指代任意类型 T可以是任意标识 // 编写代码时使用特殊符号替代位置类型,在实例化或使用/调用时才会进行具体类型的定义 // 特点:重用代 ...
- C#查漏补缺----对象内存结构与布局
环境变量 .Net Core 8.0 Windows 11 64位 内存布局 引用类型 在.NET中,数据会按照类型分为不同的对象,对于引用类型的实例,由一个对象标头(Object Header)和方 ...
- WEB 新手篇
xctf在线场景以使用了,一直想写web题来着 001 view_scoure X老师让小宁同学查看一个网页的源代码,但小宁同学发现鼠标右键好像不管用了. 解: 查看网站源码,注释里有 flag 00 ...
- 当多核变单核:破解CPU核心神秘失踪的终极指南!
CPU 核心与线程识别问题解决文档 1. 背景 在一台物理主机上运行 lscpu 命令时,发现系统仅识别到 1 个核心和 1 个线程,尽管主机搭载的是 Intel Xeon E5-2686 v4 处理 ...
- Elasticsearch倒排索引结构【转载】
一切设计都是为了提高搜索的性能 倒排索引(Inverted Index)也叫反向索引,有反向索引必有正向索引.通俗地来讲,正向索引是通过key找value,反向索引则是通过value找key. 先来回 ...
- Windows 11安装跳过联网
方案1 在选择WIFI联网的界面,不要连接网络. Shift + F10(或者Fn+Shift+F10),打开cmd窗口,输入命令:oobe\BypassNRO.cmd 重启后会有一个我没有互联网的选 ...
- python处理大量数据excel表格中间格式神器pickle.pkl文件操作说明
读取写入千万级别的excel文件费时费力,调试起来比较慢,面对这个问题,第一步可以先无脑全部转换成pkl文件,这样几乎和内存操作一样的速度. 例如: t=pd.read_excel("12月 ...
- 腾讯AICR : 智能化代码评审技术探索与应用实践(下)