![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
LI_AINY
这个作者很懒,什么都没留下…
展开
-
Intellij Idea新建SpringBoot项目
新建project选择起名字勾选web选择目录 、名字 finsh原创 2019-01-10 13:24:31 · 300 阅读 · 0 评论 -
com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ
出错代码Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecog...原创 2019-03-11 21:38:40 · 1812 阅读 · 0 评论 -
导入Springboot Maven项目,pom.xml文件包错,且不自动下载jar包,无法运行
1. 场景,导入一个Sprigboot maven项目如图 不导入依赖的jar包,所有文件都报错 包括pom.xml文件,苦苦找了2小时无果,于是对比之前的项目的pom.xml文件,修改了两个参数,使其和之前的文件一样jar包开始下载 成功2....原创 2019-03-22 23:04:24 · 5237 阅读 · 1 评论 -
Springboot+maven打jar包在服务器运行
添加插件依赖配置主类,如果引入外部jar包,一定要加<includeSystemScope>true</includeSystemScope> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-mav...原创 2019-04-15 17:46:53 · 670 阅读 · 0 评论 -
Springboot+gradle打jar包在服务器运行
配置主类//打包相关jar { manifestContentCharset 'utf-8' metadataCharset 'utf-8' manifest { attributes 'Main-Class': 'com.comment.eureka.Application' } from { configuratio...原创 2019-04-15 19:53:50 · 2176 阅读 · 0 评论 -
前端模板引擎使用Thymeleaf的项目打包之后运行报错,找不到页面
在IDE中运行,没有问题,但是打包之后,一直报thymleaf找不到页面的错误解决办法:Controller返回界面的时候,去掉路径最前面的/去掉前:去掉后:然后再打包,就不回报错了...原创 2019-04-21 12:38:50 · 1213 阅读 · 5 评论 -
IDEA打包Springboot+maven项目
添加maven插件,指定主类<plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration&g...原创 2019-04-20 12:28:21 · 253 阅读 · 0 评论 -
SpringBootServletInitializer的作用
看别人的一份代码,发现启动类除了Application还有一个package com.ruoyi;import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.boot.web.support.SpringBootServletInitializer;/** ...原创 2019-06-26 19:59:41 · 46170 阅读 · 5 评论 -
Autowired required a single bean, but 2 were found
自定注入失败 发现两个对象 不能确定注入哪一个解决办法:使用@Qualifier(“XXX”)注解@Qualifier(“XXX”) 中的 XX是 Bean 的名称,所以 @Autowired 和 @Qualifier 结合使用时,自动注入的策略就从 byType 转变成 byName 了。日志***************************APPLICATION FA...原创 2019-07-21 17:27:40 · 1256 阅读 · 0 评论 -
org.apache.shiro.session.UnknownSessionException: There is no session with id [XXXX]
背景:使用Springboot+Shiro+EhCache时,Session中取不出值,也就是没有缓存上解决办法:在ShiroConfig中的安全管理器中设置Session管理器session管理器的代码为: @Bean public OnlineWebSessionManager sessionManager() { OnlineWebSessionM...原创 2019-07-22 16:20:18 · 3111 阅读 · 0 评论 -
@Qualifier用处
@Qualifier用处1. @Qualifier作用为限定描述符,用于细粒度选择候选者,说人话就是注入的时候可能发现有多个可注入对象,比如说一个Service接口有3个实现类,分别为impl1,impl2,impl3,你注入service的时候注入的是接口,那么就可以通过@Qualifier(“你要注入的bean的名称”)来选择注入对象。2. 实例:Service接口public in...原创 2019-08-06 12:07:32 · 6541 阅读 · 2 评论 -
Springboot无法注入的问题,再一次
自己写了Service,service调用mapper,在util包中注入了Service,但是发现service中的mapper变成空,没有注入成功如图解决办法,直接在工具类注入mapper,但是需要加工一下package com.jiuqi.crcc.util;import java.util.Date;import java.util.UUID;import javax....原创 2019-03-11 12:27:25 · 789 阅读 · 0 评论 -
Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already
Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already完整报错org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with na...原创 2019-03-07 19:40:48 · 5212 阅读 · 1 评论 -
使用Eureka注册发现微服务
中间会出现很多莫名其妙的问题, 服务提供者、服务消费者、服务发现组件的关系自己查,有dubbo和zookeeper 的使用经验基于更好了,两者差不了太多建一个Eureka服务注册与消费中间件新建一个工程(file-&amp;gt;new-&amp;gt;Spring Starter Project)在 build.gradle 中加入了 compile('org.springframework.clou...原创 2019-02-14 17:04:33 · 181 阅读 · 0 评论 -
springboot控制器返回字符串,不能返回页面
因为使用是@RestController注解Controller,则Controller中的方法无法返回页面,配置的视图解析器不起作用,返回的内容就是Return 里的内容使用@Controller即可原创 2019-02-15 12:43:15 · 14779 阅读 · 7 评论 -
thymeleaf和Jsp或者HTML有什么区别
先上例子再来介绍吧,理论看多了容易晕resources目录下的templates新建一个html文件代码:注意html标签与jsp或者html的不同 自己加进去&amp;amp;amp;lt;!DOCTYPE html&amp;amp;amp;gt;&amp;amp;amp;lt;html xmlns:th=&amp;amp;quot;http://www.thymeleaf.org&amp;原创 2019-02-15 14:18:19 · 13707 阅读 · 2 评论 -
There was an unexpected error (type=Not Found, status=404). No message available
问题:启动了项目,但是访问不到自己写的连接原因可能是Application类放的位置不对,没有扫描到解决办法:在Application类上加注释@ComponentScan(basePackages = {“com.comment.*”})注释里的包名就是你的Application类所在的包名...原创 2019-02-16 12:57:13 · 16563 阅读 · 0 评论 -
SpringBoot的各种坑
说是SpringBoot简单了许多少了许多配置文件,但是,刚开始接触真的恶心,光是简单的加进去Mybatis、mysql就用了一天的时间,不是难,是会出来莫名其妙的错误后台显示访问到了,但是前段显示404找不到@RestController注解相当于@ResponseBody + @Controller合在一起的作用。你想返回数据,就用@RestController想反悔页面,就用@Co...原创 2019-02-16 15:12:14 · 769 阅读 · 0 评论 -
easyUI设置分页步骤(SSM框架)
前端页面导入easyui所需要的css,js&amp;amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;../lib/jquery-easyui-1.4.1/themes/gray/easyui.css&amp;quot; /&原创 2018-12-30 10:42:48 · 413 阅读 · 0 评论 -
使用STS搭建一个简单的服务
file-&amp;gt;new Spring Starter Project简单搭建一个 只选择web点击finish,然后开始已下载组件了,可以去抽根烟等一等。。。也可以使用intellijIDEA搭建springboot项目https://blog.csdn.net/LI_AINY/article/details/86227506,intellijIDEA对Spring也是完美支持...原创 2019-02-14 12:55:29 · 1547 阅读 · 0 评论 -
配置Eureka时候打不开主界面404
访问主页面时如图解决办法在application.yml中添加spring.freemarker.prefer-file-system-access: falsespring.freemarker.prefer-file-system-access意为是否优先从文件系统加载template成功访问主界面...原创 2019-02-14 15:48:34 · 12902 阅读 · 7 评论 -
Springboot+Maven+Mysql+EasuUI+freemarker制作的一个简单的高校后台管理网站
开发工具:STS数据库:MYSQL框架Springboot加Mybatis前端模板引擎:freemarker依赖管理:Maven前端界面模板:EasyUI数据库连接池:使用druid连接池统一配置登录拦截器目录结构运行截图主页是一个视频 循环播放可注销登录 清除session所有教室分布调用百度地图展示学校并标明教学楼位置所有页面的增删查以及导...原创 2019-03-15 10:45:28 · 407 阅读 · 0 评论 -
Springboot在自定义类中无法注入
场景:自己新建一个类,使用@Autowired注入一个mapper,debug显示为null,也就是注入失败解决办法@Componentpublic class GmcMqInfoListenerTask { @Autowired private PA_INVA_OUTBILLMapper mapper; public static GmcMqInfoListenerT...转载 2019-03-07 18:49:55 · 1976 阅读 · 0 评论 -
Spring切面编程例子
/**============================================================ * 版权: * 包: com.after90s.frame.aspectj * 修改记录: * 日期 作者 内容 * ==============================================...原创 2019-08-06 16:35:40 · 227 阅读 · 0 评论