首页 > 编程语言 >SpringBoot应用“No primary or single unique constructor found for interface javax.servlet.http.HttpSess

SpringBoot应用“No primary or single unique constructor found for interface javax.servlet.http.HttpSess

时间:2024-02-20 23:56:18浏览次数:55  
标签:web java SpringBoot No http springframework apache org servlet

Bug复现

今天在写SpringBoot应用时,写一个后端生成图形验证码的业务时,需要用到session保存后端生成的图形验证码的Base64编码,然后前端通过session来显示图形验证码。
代码里用到了servlet里的HttpSession类,于是idea自动导入了javax.servlet包里的HttpSession。
业务代码如下:

package cn.edu.wit.controller;

import cn.edu.wit.entity.Result;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
// 注意这里导入的是javax.servlet包
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.util.Base64;
import javax.imageio.ImageIO;

@Slf4j
@RestController
public class CaptchaController {
    private DefaultKaptcha captchaProducer;

    public CaptchaController() {
        // 配置Kaptcha
        captchaProducer = new DefaultKaptcha();
        captchaProducer.setConfig(new Config(new java.util.Properties()));
    }

    @GetMapping("/captcha")
    public Result getCaptcha(HttpSession session) throws Exception {
        // 生成验证码文本
        String captchaText = captchaProducer.createText();
        log.info("验证码: " + captchaText);
        // 将验证码文本存储在Session中
        session.setAttribute("captcha", captchaText);

        // 生成验证码图片
        BufferedImage image = captchaProducer.createImage(captchaText);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        ImageIO.write(image, "jpg", outputStream);
        // 转换为Base64
        String base64Image = Base64.getEncoder().encodeToString(outputStream.toByteArray());

        // 返回给前端Base64编码的图形验证码
        return Result.success("data:image/jpeg;base64," + base64Image);
    }
}

Postman测试如下:

GET http://localhost:8080/captcha

启动SpringBoot应用后,测试Postman接口,idea控制台报错:

java.lang.IllegalStateException: No primary or single unique constructor found for interface javax.servlet.http.HttpSession
	at org.springframework.beans.BeanUtils.getResolvableConstructor(BeanUtils.java:267)
	at org.springframework.validation.DataBinder.createObject(DataBinder.java:924)
	at org.springframework.validation.DataBinder.construct(DataBinder.java:903)
	at org.springframework.web.bind.ServletRequestDataBinder.construct(ServletRequestDataBinder.java:116)
	at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.constructAttribute(ServletModelAttributeMethodProcessor.java:156)
	at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:148)
	at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122)
	at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:225)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:178)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:917)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:829)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:842)

Bug原因

从stackoverflow社区找到了错误原因和解决方案
错误原因原文如下:
​>Spring Boot 3 (and Spring Framework 6) require a baseline of Jakarte EE 10. You cannot use it with Java EE or Jakarte EE versions below that.

You have to remove the explicit dependency on jakarta.servlet-api from your pom.xml. Java Servlet 4 is below the baseline and in particular still uses the package names starting with javax.servlet.
中文机翻:
Spring Boot 3(和 Spring Framework 6)需要 Jakarte EE 10 的基线。您不能将其与 Java EE 或低于该版本的 Jakarte EE 版本一起使用。
您必须jakarta.servlet-api从您的pom.xml. Java Servlet 4 低于基线,特别是仍然使用以javax.servlet.

bug修复方法很简单,就是将所有的javax.servlet包替换成jakarta.servlet包。
例如我的代码里就应该这样修改:

// import javax.servlet.http.HttpSession;
// 将javax替换成jakarta
import jakarta.servlet.http.HttpSession;

修改后,重新运行SpringBoot应用即可正常生成图形验证码,并保存到session里返回给前端。
测试生成图形验证码
将生成的base64字符串通过一个简单的html程序验证一下是否正确:

<img id="captchaImage"
    src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwh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8AQx6v/wCB0v8A8VS/8Jj4o/6GTWP/AAOl/wDiqKKAD/hMvFH/AEMmsf8AgdL/APFUf8Jl4p/6GXWP/A6X/wCKoooAP+Ez8U/9DLrH/gdL/wDFVXvfEeu6lbm3v9a1G6gJz5c907rn1wTiiigCLTta1XSPM/szU72y83HmfZp2j34zjO0jOMn86vf8Jp4q/wChm1n/AMD5f/iqKKAF/wCE18V/9DNrP/gfL/8AFUf8Jt4r/wChn1r/AMD5f/iqKKAD/hNvFn/Qz61/4Hy//FUv/Cb+LP8AoaNa/wDA+X/4qiigA/4Tfxb/ANDRrf8A4MJf/iqP+E48W/8AQ0a3/wCDCX/4qiigA/4Tjxb/ANDTrf8A4MJf/iqX/hOfF3/Q063/AODCX/4qiigA/wCE58Xf9DVrn/gwl/8AiqP+E68X/wDQ1a5/4MJf/iqKKAGT+M/FN1by29x4l1maCVCkkcl9KyupGCCC2CCOMUUUUAf/2Q=="
    alt="Captcha" />

将base64字符串输入到html里打印出来

参考资料

Fix "No primary or single unique constructor found for interface javax.servlet.http.HttpServletResponse" in Spring Boot application

标签:web,java,SpringBoot,No,http,springframework,apache,org,servlet
From: https://www.cnblogs.com/wangzehan/p/18024288

相关文章

  • PHPMailer发送邮件报SMTP Error: Could not authenticate.SMTP server error: QUIT co
    在使用PHPMailer开发发送邮件功能时报错SMTPError:Couldnotauthenticate.SMTPservererror:QUITcommandfailed起初这个授权码以为是邮箱登陆密码,填了qq密码验证不通过 以下qq邮箱为例配置授权码下面按步骤操作就可以开通,得到一个授权码  ......
  • 【Azure Notification Hub】如何手动删除 Notification Hub 中已注册的设备
    问题描述在NotificationHub中注册了设备后,从Azure门户上没有找到相应的入口来删除已注册设备(ActiveDevices)如果使用C#SDK是否有办法删除呢? 问题解答可以的,查看NotificationHub的文档,可以通过注册ID来删除一个注册设备:https://docs.azure.cn/zh-cn/notification-hubs......
  • Go 100 mistakes - #32: Ignoring the impact of using pointer elements in range lo
    Thissectionlooksataspecificmistakewhenusingarangeloopwithpointerelements.Ifwe’renotcautiousenough,itcanleadustoanissuewherewereferencethe wrongelements.Let’sexaminethisproblemandhowtofixit.Beforewebegin,let’scla......
  • windows node管理工具nvm
    nvm全名node.jsversionmanagement,是一个nodejs的版本管理工具。通过它可以安装和切换不同版本的nodejs。首先最重要的是:一定要卸载已安装的NodeJS,否则会发生冲突。 卸载程序确保在Node.js没有在后台运行的情况下,进行卸载。可以先打开软件,关闭后到控制面板中找到node.js......
  • Caused by: java.lang.ClassNotFoundException: com.qcloud.cos.auth. 类找不到异常
    java.lang.ClassNotFoundException 表示在运行时找不到指定的类。在这种情况下,缺少了 com.qcloud.cos.auth 包中的类。请确保项目中包含了腾讯云 COS SDK 相关的依赖,并且这些依赖能够正确加载。检查项目的依赖配置,确保包含了腾讯云 COS SDK 相关的依赖。 腾讯云contr......
  • 李宏毅《机器学习》总结 - 2022 HW8(Anomaly Detection、ResNet) Strong Baseline
    重新学习了一下ResNet。。这作业平均一跑就是3、4个小时题目大意是让你做异常检测(anomalydetection),即给你一些正常的图片,再让你测试图片是正常的还是异常的(可以理解为2分类问题,只不过其中一个类别是无限大的)代码:https://www.kaggle.com/code/skyrainwind/hw8-anomaly-detec......
  • https://repo.radeon.com/rocm/apt/6.0.2 jammy/main amd64 下载太慢
    获取:1https://repo.radeon.com/rocm/apt/6.0.2jammy/mainamd64comgramd642.6.0.60002-115~22.04[51.7MB]获取:2https://repo.radeon.com/rocm/apt/6.0.2jammy/mainamd64composablekernel-devamd641.1.0.60002-115~22.04[109MB]获取:3https://repo.radeon.com/ro......
  • nginx启动报错:ngx_http_image_filter_module.so" version 1016001 instead of 1022001
    问题现象,启动nginx,提示版本不对[root@k8s-test-node2modules]#/data/nginx/sbin/nginxnginx:[emerg]module"/usr/lib64/nginx/modules/ngx_http_image_filter_module.so"version1016001insteadof1022001in/usr/share/nginx/modules/mod-http-image-filter.conf:1......
  • CentOS7安装nodejs18
    CentOS7安装nodejs18及以上版本会报错,glibc版本过低。升级glibc到2.28。查看glibc版本号#ldd--version1、下载glibc2.28并创建build目录cdwgethttp://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gztarxfglibc-2.28.tar.gzcdglibc-2.28/mkdirbuild2、升级gccyuminstall-y......
  • SpringBoot中使用PageHelper插件实现Mybatis分页
    场景SpringBoot中整合Mybatis时一般添加的依赖为       <dependency>           <groupId>org.mybatis.spring.boot</groupId>           <artifactId>mybatis-spring-boot-starter</artifactId>           <version>2.2.1</vers......