
spring boot
文章平均质量分 50
jq1223
最熟悉的程序员
展开
-
使用 HttpClient 获取网页 原代码
<--httpclient依赖--> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.12</version> </dependency>测试: @Test void Test() { .原创 2021-05-20 14:31:45 · 365 阅读 · 0 评论 -
FastDFS 安装 及 整合 SpringBoot 和 Swagger 项目 进行测试
FastDFS官网FastDFS是什么?参考百度百科FastDFS是一个 使用c 语言编写的一款开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储、文件同步、文件访问(文件上传、文件下载)等,解决了大容量存储和负载均衡的问题。特别适合以文件为载体的在线服务,如相册网站、视频网站等等。FastDFS为互联网量身定制,充分考虑了冗余备份、负载均衡、线性扩容等机制,并注重高可用、高性能等指标,使用FastDFS很容易搭建一套高性能的文件服务器集群提供文件上传、下载等服务。FastDFS 简原创 2021-05-19 17:24:46 · 261 阅读 · 1 评论 -
SpringCloud + SpringBoot + Nacos + dubbo 作配置中心 (5)
配置中心详情以项目名称命名的配置文件:test.properties新建配置创建服务1.引入依赖: <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery&原创 2021-05-08 17:25:23 · 310 阅读 · 0 评论 -
SpringCloud + SpringBoot +Dubbo +Sentinel 整合 (4)
整合项目创建一个SpringBoot项目 sentinel引入子相关依赖<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0原创 2021-05-08 17:17:22 · 408 阅读 · 0 评论 -
Dubbo使用Sentinel来对服务进行降级与限流 (3)
Sentinel 是什么随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 是面向分布式服务架构的流量控制组件,主要以流量为切入点,从限流、流量整形、熔断降级、系统负载保护、热点防护等多个维度来帮助开发者保障微服务的稳定性。Sentinel 的历史2012 年,Sentinel 诞生,主要功能为入口流量控制。2013-2017 年,Sentinel 在阿里巴巴集团内部迅速发展,成为基础技术模块,覆盖了所有的核心场景。Sentinel 也因此积累了大量的流量归整场景以及生.原创 2021-05-08 16:38:47 · 1103 阅读 · 1 评论 -
SpringCloud + SpringBoot 整合Nacos作配置中心 方式二 【二】
配置中心详情以项目名称命名的配置文件:test.properties新建配置创建服务1.引入依赖: <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery&原创 2021-05-08 00:58:16 · 249 阅读 · 0 评论 -
SpringCloud + Nacos +Springboot + Dubbo 集成做注册中心(2)
项目结构:server 消息提供者nacos-consumer 消息消费者server-dubbo-provider-api api接口父项目依赖:<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"原创 2021-05-08 00:41:40 · 297 阅读 · 0 评论 -
dubbo框架的讲解搭建 之一 及安装Zookeeper(1)
简介Dubbo是Alibaba开源的分布式服务框架,它最大的特点是按照分层的方式来架构,使用这种方式可以使各个层之间解耦合(或者最大限度地松耦合)。从服务模型的角度来看,Dubbo采用的是一种非常简单的模型,要么是提供方提供服务,要么是消费方消费服务,所以基于这一点可以抽象出服务提供方(Provider)和服务消费方(Consumer)两个角色。关于注册中心、协议支持、服务监控等内容,详见后面描述。其核心部分包含: 1. 远程通讯: 提供对多种基于长连接的NIO框架抽象封装,包括多种线程模型,序列化,原创 2021-05-07 23:55:57 · 178 阅读 · 2 评论 -
SpringCloud + SpringBoot +Nacos 整合 OpenFeign 的对接使用 【三】
OpenFeign简介Feign是一个声明式的Web Service客户端。它的出现使开发Web Service客户端变得很简单。使用Feign只需要创建一个接口加上对应的注解,比如:FeignClient注解。Feign有可插拔的注解,包括Feign注解和JAX-RS注解。Feign也支持编码器和解码器,Spring Cloud Open Feign对Feign进行增强支持Spring MVC注解,可以像Spring Web一样使用HttpMessageConverters等。Feign是一种声明原创 2021-05-07 14:17:59 · 1870 阅读 · 1 评论 -
SpringCloud + SpringBoot 整合Nacos作配置中心 【二】
新建配置创建服务1.引入依赖: <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </depen原创 2021-05-07 13:26:11 · 604 阅读 · 1 评论 -
SpringCloud + SpringBoot 整合Nacos作为注册中心【一】
主要通过两个项目来完成演示:nacos-provide:服务提供者nacos-consumer:服务消费者首先创建一个maven的父项目在父项目下创建提供者和消费者父项目依赖:<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instanc原创 2021-05-06 21:06:26 · 253 阅读 · 2 评论 -
网页 & 移动应用 支付宝 支付功能
首先进入支付宝沙箱页面注册一:注册1.注册之后进入选择文档==》网页&移动应用2.选择开发工具==》 沙箱环境3.选择研发服务4.必看部分非常重要,在下面AlipayConfig类中写代码要使用5.可以使用app登录以下的商家账号和买家账号6.app端下载效果1:效果2:二:使用1.下载版本2.支付宝支付的依赖 <!-- 支付宝支付的依赖 https://mvnrepository.com/artifact/com.alipay.s原创 2021-04-19 17:58:52 · 3844 阅读 · 0 评论 -
spring cloud gateway 使用
Spring Cloud Gateway 具有如下特性:基于Spring Framework 5, Project Reactor 和 Spring Boot 2.0 进行构建;动态路由:能够匹配任何请求属性; 可以对路由指定 Predicate(断言)和 Filter(过滤器);集成Hystrix的断路器功能;集成 Spring Cloud 服务发现功能;易于编写的 Predicate(断言)和 Filter(过滤器);请求限流功能;支持路径重写。项目搭建1.引入jar包 .原创 2021-04-12 22:07:31 · 541 阅读 · 0 评论 -
实现短信验证码登录
注:此项目为微服务项目,前后端分离 vue+springboot+springcloud+layui前端登录页面:所使用的的pom.xml中的依赖: <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version>原创 2021-04-06 22:48:06 · 627 阅读 · 1 评论 -
Could not get any response
PostMan报错信息:解决方案:如果觉得PostMan没有问题就查看启动类@MapperScan注解路径对不对原创 2021-04-06 13:38:14 · 201 阅读 · 0 评论 -
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
解决方案:在注册中心启动类上加 exclude= {DataSourceAutoConfiguration.class}原创 2021-04-06 12:24:23 · 113 阅读 · 0 评论 -
springcloud项目搭建
项目介绍:首先搭建maven父项目父项目src目录不需要可以删除在搭建3个maven项目:实体类、工具包和连接数据类开始搭建注册中心和网关,它们都是Springboot项目开始配置依赖:在父项目中引入子项目在子项目中引入父项目父项目的pom.xml文件<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"原创 2021-04-02 14:18:31 · 253 阅读 · 0 评论 -
Idea没有Services窗口
项目启动时右下角会出现下面的弹框,点它一下选择第一个完成原创 2021-04-01 21:40:53 · 982 阅读 · 0 评论 -
Idea没有Services窗口
别人的idea有Services我的没有view - Tool Windows 目录下没有services(Alt+8)的选项解决办法在项目.idea文件中搜索 RunDashboard 加入以下代码:<option name="configurationTypes"> <set> <option value="SpringBootApplicationConfigurationType" /> </set>原创 2021-04-01 20:00:49 · 2403 阅读 · 0 评论 -
ssm+layui+poi做条件导出Excel
注:此为SSM+layui项目配置依赖 <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17</version> </dependency> <dependenc原创 2021-04-01 11:54:51 · 310 阅读 · 0 评论 -
SpringCloud搭建maven多模块微服务项目步骤
首先创建一个Maven项目,什么都不要选,下一步选择包名和项目名开始常见创建创建好将src目录删除,开始创建子项目开始创建springboot子项目选择spring initalizr创建3个子项目开始配置jar包和文件在pom文件中选择spring-boot 2.1.2.RELEASE 和spring-cloud Greenwich.RELEASE版本整合 <properties> <java.version>1.8</java.原创 2021-03-31 23:01:00 · 1106 阅读 · 0 评论 -
如何修改tomcat端口号
报错解决方案:直接双击tomcat,得到页面:端口号取值范围:1-65535想要改的端口已经被占用了:修改完端口号需重启tomcat原创 2021-01-07 17:40:54 · 200 阅读 · 0 评论 -
docker自定义镜像部署SpringBoot项目
在idea首先创建一个Springboot项目测试一下将项目达成jar包,首先清空一下开始打包打开target把jar包复制到桌面进入opu目录上传项目jar包[root@localhost lib]# cd /[root@localhost /]# cd /opt/[root@localhost opt]# lscontainerd nginx-1.18.0 nginx-1.18.0.tar.gz[root@localhost opt]# rz原创 2021-03-30 19:29:11 · 382 阅读 · 2 评论 -
Springboot项目打包
清空一下开始打包打开target把jar包复制到桌面原创 2021-03-30 17:28:16 · 126 阅读 · 0 评论 -
SpringSecurity及JWT实现登录认证
在pom.xml中添加项目依赖 <!--SpringSecurity依赖配置--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency&原创 2021-03-27 13:40:17 · 471 阅读 · 0 评论 -
Invalid character found in the request target [/productlist/add?memberPriceList[]=%7B%22memberLevelN
报错信息:java.lang.IllegalArgumentException: Invalid character found in the request target [/productlist/add?memberPriceList[]=%7B%22memberLevelName%22:%22%E9%BB%84%E9%87%91%E4%BC%9A%E5%91%98%22,%22memberLevelId%22:%7B%22id%22:1,%22name%22:%22%E9%BB%84%E9%87%原创 2021-03-17 14:00:40 · 320 阅读 · 1 评论 -
idea创建不了springboot项目
问题:创建springboot项目没有Spring Initializr解决方案:效果图:原创 2021-03-07 23:24:18 · 281 阅读 · 0 评论 -
修改Springboot端口号
在application.properties中# 应用名称spring.application.name=demo# 应用服务 WEB 访问端口server.port=8080# 数据库驱动:spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver# 数据源名称spring.datasource.name=defaultDataSource# 数据库连接地址spring.datasource.url=jdbc:mysql:原创 2021-03-02 11:03:41 · 138 阅读 · 0 评论 -
Springboot热部署如何配置
1.在pom.xml中配置依赖关系 <!--SpringBoot热部署配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</opti原创 2021-01-11 12:25:00 · 367 阅读 · 0 评论 -
Invalid bound statement (not found): com.cc.mapper.UserMapper.queryUserByUsername
使用springboot项目登录报错信息:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cc.mapper.UserMapper.queryUserByUsername at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.2.ja原创 2021-01-11 11:32:15 · 651 阅读 · 0 评论 -
Field studentMapper in com.fh.service.impl.StudentServiceImpl required a bean of type ‘com.fh.mapper
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2021-01-04 11:46:10.376 ERROR 1764 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : ***************************APPLICATION原创 2021-01-05 00:01:47 · 2230 阅读 · 0 评论