![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
springboot开发
luoshuweiis
这个作者很懒,什么都没留下…
展开
-
Springboot项目启动指定配置文件
springboot项目如果有多个启动环境,则根目录的resources下会有几个.properties配置文件,例如:application-dev.properties: 表示你的开发环境application-test.properties: 表示你的测试环境application-prod.properties: 表示你的生产环境打包的是否不必处理,一起打入JAR包。在启动项目时候,使用-D指定参数,java -jar -Dspring.profiles.active=test xxx原创 2020-12-08 21:22:49 · 782 阅读 · 0 评论 -
启动springboot项目时加指定参数
如果用Java命令行直接运行已打包的jar文件,则使用java -jar -Dspring.profiles.active=test XXX-SNAPSHOT.jar如果使用elipse开发工具,入口类上右键run as运行Application.java入口文件启动,则增加参数–spring.profiles.active=test如果是STS启动,则在Profile输入框内写入该参数再执行运行:...原创 2020-07-13 15:27:35 · 4103 阅读 · 0 评论 -
java连接redis的坑:Connection refused: no further information
最近扒了一段springbootde 代码,启动后报错:org.springframework.context.ApplicationContextException: Unable to start web server…Caused by: java.net.ConnectException: Connection refused: no further information提示的错误不...原创 2020-01-07 17:00:25 · 33504 阅读 · 2 评论 -
springboot集成Redis两种——session及一般操作类
springboot使用Redis的两种:前提:Redis已安装并启,并在项目的application.properties文件配置了Redis的连接信息,比如:spring.redis.host=127.0.0.1 spring.redis.port=6379 一、用于应用集群间共享SESSION;需要添加配置:1、pom.xml中添加配置:<dependency&gt...原创 2018-11-28 15:50:21 · 221 阅读 · 0 评论 -
springboot+mybatis使用xml文件集成的两种方式
springboot+mybatis使用xml文件集成:一、将xml文件放在resources文件夹中,然后在根配置文件中指定xml文件的位置:mybatis.mapper-locations=classpath*:mapper/*Mapper.xml二、将xml文件放在DAO或mapper类的同一个文件夹中,然后在通过在pom中指定build标签中添加resouce资源的配置加载文件位置...原创 2019-04-01 15:31:27 · 216 阅读 · 0 评论 -
Springboot启动后报错:Could not resolve placeholder '*' in value "${xxx}"
Springboot多个类中引用配置文件中属性(@Value("xxx")导致的报错:Couldnotresolveplaceholder′∗′invalue"{"xxx"})导致的报错:Could not resolve placeholder '*' in value ...原创 2019-08-31 16:33:22 · 13218 阅读 · 1 评论