springboot
假期的学习
这个作者很懒,什么都没留下…
展开
-
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as
springboot使用thymeleaf 的时候访问不了页面: thymeleaf的版本不能太高,此3.0.x及以上版本无法和spring-boot的2.x.x版本对上,需要降低版本(或者用parent管控默认的版本)此次错误是项目依赖版本不一致导致的,其他时候如果也有类似的报错可以看看相关依赖之间版本是否一致(特别是spring相关的版本和其他的依赖的版本)原创 2023-11-02 20:12:09 · 2270 阅读 · 0 评论 -
spring boot 的 spring-boot-devtools 和 spring-boot-configuration-processor 注解作用
1、 注解如下<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <ver原创 2022-03-17 16:23:20 · 439 阅读 · 0 评论 -
springboot项目没有被识别为spring项目,以及application.yml文件没有小叶子解决办法
1、 问题示意图2、 解决路径可以打开如1图那个窗口(project structure),快捷键(ctrl+shift+alt+s),也可参考如下图方式打开 file-project structure3、 解决办法右键点击相应的项目然后点击添加,最后点击spring就可以了4、 成功如图最后记得点击窗口右下角apply或者ok...原创 2022-03-03 18:57:59 · 5160 阅读 · 0 评论 -
idea 中spring boot项目启动报错:If you want an embedded database (H2, HSQL or Derby), please put it on the
1、 错误信息Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-01-10 08:23:05.367 ERROR 2836 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :APPLICATION FAILED TO STARTDescripti原创 2022-01-10 08:32:50 · 2210 阅读 · 0 评论 -
SpringBoot 项目启动后立马自动关闭解决办法
一个原因:可能是缺少web启动依赖包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.5.6</version></dependency>原创 2021-12-16 12:38:44 · 4490 阅读 · 2 评论 -
LF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implemen
1、 背景学习springcloud时,启动消费者服务时报错LF4J: No SLF4J providers were found.SLF4J: Defaulting to no-operation (NOP) logger implementation2、 错误原因pom文件中没有添加springboot test依赖<dependency> <groupId>org.springframework.boot</groupId>原创 2021-12-15 22:29:12 · 1574 阅读 · 0 评论 -
with root cause org.springframework.expression.spel.SpelEvaluationException* field ‘records‘ cannot
1、 前言1.1 idae中spring boot项目使用thymeleaf模板,前端HTML页面获取后台Controller中的Model存放的数据1.2 项目在登录后跳转到后台显示查询到数据库数据的页面(首先是还没有查询,需要进入页面后点击按钮才去查询并显示)1.3 这里就直接报错误了,最开始我只能通过把查询到的数据显示到页面(就是刚刚登录成功,就跳转去查询数据)的方式解决错误,后面我发现一个好玩的方法,在这里介绍一下。2、 错误信息2.1主要错误2021-11-20 20:40:36.53原创 2021-11-20 22:01:46 · 1515 阅读 · 1 评论 -
thymeleaf.TemplateEngineException processing template “main“: An error happened during template pars
前言这个项目是springboot 项目使用thymeleaf模板的,主要错误是前端HTML页面使用thymeleaf获取后台传过来的值有问题(获取不到,或者为空null)错误信息1、第一个错误:转发的用成了重定向 redirect:/main2021-11-18 21:02:01.321 ERROR 9272 — [nio-8082-exec-4] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8082-exec-4原创 2021-11-18 23:04:22 · 2570 阅读 · 0 评论 -
java.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelIm
1、前言idea中spring boot 项目在使用了redis之后,不用redis后,启动正常,登录到首页报错。2、报错原因我之前用redis时监控了登录信息,把登录页面刷新次数记录到缓存中,但是我没有使用redis后,忘记禁用相应的redis调用代码,导致找不到相应信息报错。3、报错产生的controller.LoginController.java文件@GetMapping("/index") public String toIndex(HttpSession session,Mod原创 2021-11-16 16:03:29 · 4468 阅读 · 2 评论 -
idea中spring boot项目,使用MyBatisPlus分页配置导致# SQL: SELECT id,username,password FROM user LIMIT ? LIMIT ?
1、错误出现的Java文件:mybatis-plus配置类/** * https://mp.baomidou.com/guide/page.html * MyBatisPlus分页插件配置类 */@Configurationpublic class MybatisPlusConfig { // 旧版 /*@Bean public PaginationInterceptor paginationInterceptor() { PaginationInterc原创 2021-11-14 23:03:14 · 392 阅读 · 0 评论 -
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corres
0、前言,本次错误是spring boot项目中使用mybatis 根据id值查询数据库中一条数据报错1、错误信息2021-11-14 15:37:38.168 ERROR 9936 --- [nio-8086-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Reques原创 2021-11-14 16:22:37 · 1954 阅读 · 0 评论 -
MissingServletRequestParameterException: Required request parameter ‘id‘ for method parameter type I
1、报错信息1.1idea中报错信息Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required request parameter 'id' for method parameter type Integer is not present]1.2网页报错信息Whitelabel Error PageThis application has no explicit mapping原创 2021-11-14 16:16:41 · 11109 阅读 · 1 评论 -
template might not exist or might not be accessible by any of the configured
报错信息1、网页报错Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback.Thu Nov 11 16:30:35 CST 2021There was an unexpected error (type=Internal Server Error, status=500).2、idea报错2021-11-11 16:30:35原创 2021-11-11 16:39:51 · 1049 阅读 · 0 评论 -
springboot项目简单的页面默认跳转方式总结:RequestMapping(“/helllo“)使用String字符串 根据return “he“; 跳转到 he.html页面。简单记录目录结构
一、前言1、当前项目图片二、主要错误1、错误Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Sat Oct 30 15:58:03 CST 2021 There was an unexpected error (type=Not Found, status=404).2、原因一般是目录结构错误三、项目代码(主要的)1原创 2021-10-30 16:26:16 · 984 阅读 · 1 评论 -
idea 中springboot 项目中使用Lombok的时候,pom文件下载不了Lombok依赖(一直爆红,显示找不到),可能是因为idea 没有安装 Lombok插件
报错信息:Dependency 'org.projectlombok:lombok:' not found原创 2021-10-30 09:58:16 · 3519 阅读 · 0 评论 -
Could not transfer artifact org.jetbrains.kotlin:kotlin-bom:pom:1.4.32 from/
前言idea中spring boot项目创建之后不下载pom.xml文件依赖,并且还报这个错误。测试:idea版本2020.1.1 ; jdk版本jdk1.8错误信息Could not transfer artifact org.jetbrains.kotlin:kotlin-bom:pom:1.4.32 from/错误原因spring boot版本太高,可能是和maven、JDK 版本兼容有问题,建议降低版本<parent> <groupId>.原创 2021-10-29 16:53:18 · 3231 阅读 · 0 评论 -
idea运行从github上导入的springboot项目的时候报错信息:Error injecting: org.codehaus.plexus.archiver.jar.JarArchiver j
①报错信息Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1Error injecting: org.apache.maven.plugin.jar.JarMojoFailed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project hospit.原创 2021-06-05 10:52:08 · 2399 阅读 · 0 评论 -
springboot项目,idea中引入网上下载的模板
1、springboot项目,idea中引入网上下载的模板2、方法① 把页面(HTML)放到template文件夹下② 把资源(css,js,img)放在static文件夹下原创 2021-05-19 22:23:50 · 334 阅读 · 0 评论 -
Error resolving template [this is thymeleaf], template might not exist or might not be accessible by
1、使用了 Controller 注解报下面的这个错误的原因是:return 所返回的值默认去寻找 (值.html) 那个thymeleaf页面,因为这里使用了Thymeleaf,但是那个页面却不存在2、报错信息:org.thymeleaf.exceptions.TemplateInputException: Error resolving template [this is thymeleaf], template might not exist or might not be accessib原创 2021-05-19 19:17:49 · 188 阅读 · 0 评论 -
idea运行springboot项目的时候端口号冲突
1、错误原因idea运行springboot项目的时候端口号冲突,springboot项目是使用内置的Tomcat服务器。2、错误信息2021-05-06 17:25:06.480 WARN 1764 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: o原创 2021-05-06 18:08:38 · 1384 阅读 · 0 评论 -
Error:(8, 47) java: 程序包org.springframework.web.bind.annotation不存在
1、错误:idea编译代码(springboot)出现annotation包不存在2、一种解决方法:见图片(打开设置setting,找到maven中的runner)3、原理:idea本身的bug,当我们勾上那个就把他交给maven代理进行运行编译了Delegate IDE build/run actions to Maven翻译:将IDE生成/运行操作委托给Maven...原创 2021-03-18 10:10:20 · 911 阅读 · 0 评论 -
mybatis-plus调用自身的 selectById 方法报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You hav
1.报错信息:1.1早上的报错信息:这个是我下午模拟上午的错误(已经通过1.2里面的错误信息找到错误原因了),让他产生错误信息,但是这个和上午产生的错误信息不一样了,上午的我不知道错误在哪,这个就知道错误在哪。-------------------------------------------------------------------------------Test set: com.atguigu.admin.Boot05WebAdminApplicationTests----------原创 2021-04-02 16:32:25 · 527 阅读 · 0 评论 -
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(
1、报错信息:-------------------------------------------------------------------------------Test set: com.atguigu.Boot05WebAdminApplicationTests-------------------------------------------------------------------------------Tests run: 1, Failures: 0, Errors:原创 2021-03-25 14:12:47 · 283 阅读 · 0 评论 -
This application has no explicit mapping for /error, so you are seeing this as a fallback.
1、浏览器报错信息:This application has no explicit mapping for /error, so you are seeing this as a fallback.对应的翻译:此应用程序没有针对/error的显式映射,因此您将此视为回退。2、idea控制台报错信息:2021-03-21 09:54:30.156 INFO 16836 --- [nio-8989-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] :原创 2021-03-21 10:18:54 · 2514 阅读 · 0 评论