java.lang.TypeNotPresentException: Type javax.servlet.http.HttpServletRequest not present
完整的报错信息
java.lang.TypeNotPresentException: Type javax.servlet.http.HttpServletRequest not present
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68) ~[na:na]
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138) ~[na:na]
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperInterfaces(ClassRepository.java:117) ~[na:na]
at java.base/sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:95) ~[na:na]
at java.base/java.lang.Class.getGenericInterfaces(Class.java:1211) ~[na:na]
at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:503) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.ResolvableType.as(ResolvableType.java:451) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.ResolvableType.forClass(ResolvableType.java:1063) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.plugin.core.config.PluginRegistriesBeanDefinitionRegistrar.getTargetType(PluginRegistriesBeanDefinitionRegistrar.java:101) ~[spring-plugin-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.plugin.core.config.PluginRegistriesBeanDefinitionRegistrar.registerBeanDefinitions(PluginRegistriesBeanDefinitionRegistrar.java:71) ~[spring-plugin-core-2.0.0.RELEASE.jar:2.0.0.RELEASE]
at org.springframework.context.annotation.ImportBeanDefinitionRegistrar.registerBeanDefinitions(ImportBeanDefinitionRegistrar.java:86) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:372) ~[spring-context-6.0.12.jar:6.0.12]
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:371) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:427) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:287) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:344) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:771) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:589) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-3.1.4.jar:3.1.4]
at com.ly.laboratory.LaboratoryApplication.main(LaboratoryApplication.java:15) ~[main/:na]
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:467) ~[na:na]
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) ~[na:na]
... 32 common frames omitted

原因
swagger的版本和springboot版本不兼容
我的项目swagger使用的版本是3.0.0
implementation 'io.springfox:springfox-boot-starter:3.0.0'
implementation 'com.github.xiaoymin:knife4j-spring-boot-starter:3.0.3'
springboot版本是3.1.4
id('org.springframework.boot').version('3.1.4')
解决办法
降低一点springboot版本
id('org.springframework.boot').version('2.7.3')
java.lang.TypeNotPresentException: Type javax.servlet.http.HttpServletRequest not present的更多相关文章
- java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present错误
今天在搭建spring cloud的时候,发现一直报“java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not pr ...
- SpringCloud启动Eureka server时报错 java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present
SpringBoot打开Eureka server时出现以下错误: java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext ...
- java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present解决方案
因为JAXB-API是java ee的一部分,在jdk9中没有在默认的类路径中: java ee api在jdk中还是存在的,默认没有加载而已,jdk9中引入了模块的概念,可以使用 模块命令--add ...
- The type javax.servlet.http.HttpServletRequest cannot be resolved.
The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from ...
- Exception in thread "main" java.lang.SecurityException: class "javax.servlet.FilterRegistration"'s signer information does not match signer information of other classes in the same package解决办法(图文详解)
不多说,直接上干货! 问题详情 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF ...
- java.lang.SecurityException: class "javax.servlet.AsyncContext"'s signer information does not match signer information of other classes in the same package
最近在写个Http协议的压测挡板时,遇到以下错误. 2018-03-08 10:34:07.808:INFO:oejs.Server:jetty-8.1.9.v20130131 2018-03-08 ...
- maven项目依赖jar包报 java.lang.classnotfoundexception:Type com.xx.xx.xxx not present 的解决
今天在工作的时候遇到了这样一个奇葩的异常: java.lang.classnotfoundexception:Type com.ys.yahu.vo.file.MobileFileVo not pre ...
- The type javax.servlet.http.HttpServletRequest cannot be resolved. It is indirectly referenced from required .class files
我的方法:是缺少servlet的引用库,解决如下 1.工程右键-properties->java build path 2.在java build path的libraries tab页中选择A ...
- 【The type javax.servlet.http.HttpServletRequest cannot be resolved】解决方案
是缺少serverlet的引用库,解决如下 1.工程右键-properties->java build path 2.在java build path的libraries tab页中选择Add ...
- java.lang.SecurityException: class "javax.servlet.FilterRegistration"(spark下maven)
今天写spark例子用到maven,但是自己maven又不熟悉.遇到错误找了半天知道是(sevlet-api2.5 3.0)包冲突需要解决包之间依赖问题却不知道怎么下手.但是最终慢慢了解还是找到新手的 ...
随机推荐
- P3378 【模板】二叉堆
[洛谷]P3378 [模板]堆 方法一 手写堆 最小堆插入 从新增的最后一个结点的父结点开始,用要插入元素向下过滤上层结点(相当于要插入的元素向上渗透) void siftdown(int i) // ...
- AI绘画关键词Prompt:分享一些质量比较高的StableDiffusion(SD)关键词网站
今天向大家推荐一些SD(StableDiffusion)高质量的 关键词 网站.这些网站的质量可靠,能为大家在创建 AI 绘画时提供有效的参考.以下是六个推荐的网站,优缺点分析. 有几个质量还算是挺高 ...
- 《Python魔法大冒险》 001 序章:少年小鱼的不平凡一天
在一个普通的城市里,生活着一个名叫小鱼的少年.他是一名初中生,但在班级里,他的学习成绩总是垫底.同学们经常取笑他,有时甚至戏称他为"倒数王". 放学后,小鱼一个人走在回家的路上,他 ...
- 拯救“消失的她”——双系统grub完美恢复方案
双系统grub意外消失怎么办? 不用重装系统.不用去维修店.不会丢数据,教你一招,完美恢复grub! 背景 我的电脑是windows和linux双系统,启动项使用的grub.某天准备切换linux时突 ...
- DAY005_异或运算
运算规则 二进制:相同为0 相异为1 十进制:相同为0 任何数字和0异或都是它本身 不利用额外变量交换两个数 数组中一种数字出现了奇数次,其他数都出现了偶数次,怎么得到这个出现了奇数次的数 将所有的数 ...
- 【RocketMQ】【源码】延迟消息实现原理
RocketMQ设定了延迟级别可以让消息延迟消费,延迟消息会使用SCHEDULE_TOPIC_XXXX这个主题,每个延迟等级对应一个消息队列,并且与普通消息一样,会保存每个消息队列的消费进度(dela ...
- 《最新出炉》系列初窥篇-Python+Playwright自动化测试-16-处理模态对话框弹窗
1.简介 我们在日常工作中,会经常遇到弹出警告框的问题,弹框无法绕过,必须处理才可以执行后续的测试,所以弹框处理也是我们必须掌握的一个知识.宏哥在java+selenium系列文章中介绍过这部分内容. ...
- jq工具及其常用用法
近来在工作中处理JSON处理较多,深入研究了一下jq,之前对jq的使用一直停留在JSON数据格式化的层面,实际它的能力远不止于此. 在处理JSON数据时,我们经常需要在命令行中进行过滤.查询和编辑的操 ...
- CMD和AMD理解
#AMD <br>1.AMD就是Asynchronous Module Definition,中文名是异步模块定义的意思.<br>2.AMD解决两个问题:解决依赖.异步加载&l ...
- sql优化的方法总结
1.对查询进行优化,应该尽量避免全表扫描,首先应考虑在where和order by涉及的列上建立索引 2.应尽量避免在where子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表 ...