springboot报错(二) Internal Server Error,status=500

您所在的位置:网站首页 表格打印添加边框怎么设置 springboot报错(二) Internal Server Error,status=500

springboot报错(二) Internal Server Error,status=500

2024-07-04 22:24:47| 来源: 网络整理| 查看: 265

重新配置一次springboot我的pom里边的配置如下 4.0.0 cn myfamilyt 0.0.1-SNAPSHOT jar myfamilyt Demo project for Spring Boot org.springframework.boot spring-boot-dependencies 1.5.7.RELEASE pom import UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test mysql mysql-connector-java org.springframework.boot spring-boot-maven-plugin 1.5.7.RELEASE cn.myfamilyt.MyfamilytApplication exec

其它写法都是正常的

但是报错了

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Sep 20 10:51:19 CST 2017 There was an unexpected error (type=Not Found, status=404). No message available 百度了一下,说是少了thymeleaf包

所以就在pom中加入

org.springframework.boot spring-boot-starter-thymeleaf 在次运行,看看接下来还会不会出什么差错

很好继续报错

Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Sep 20 10:55:27 CST 2017 There was an unexpected error (type=Internal Server Error, status=500). Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers 哦发现刚刚还有一个人说,还要加一个config配置,于是,我又去加了一个config

@Configuration @EnableWebMvc public class Config extends WebMvcConfigurerAdapter{ @Override public void configureDefaultServletHandling( DefaultServletHandlerConfigurer configurer) { configurer.enable(); } } 结果一样,还是报了上面的500的错误

哦,因为我比较懒,所以使用的是yaml格式的没使用properties (application.yaml)

最后想起,SpringBoot的一些配置需要进application里边配置,但是我第一次配置的是mvc的View这样就错了

spring: mvc: view: suffix: .ftl prefix: classpath:/templates/

因为使用了thymeleaf所以,使用mvc的自然是无用的,必须要修改为thymeleaf才行

spring: thymeleaf: prefix: classpath:/templates/ suffix: .ftl

然后在重新运行了一次,果然成功了!问题成功解决

下就步配置mybatis数据库



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭