scheduling springboot execution task

SpringBoot配置两个一样的Bean,区分两个配置类

1、@Primary 作用: 指定默认bean。 当没有根据名字显示要注入哪个bean的时候,默认使用打了@Primary标签的bean 2、配置两个一样的bean @Configuration public class MyThymeLeafConfig { @Resource private A ......
两个 SpringBoot Bean

SpringBoot的@Autowired和@Resource使用

1、区别 见:https://blog.csdn.net/xhbzl/article/details/126765893 2、使用 2.1、注入配置类 比如注入config的bean @Configuration public class MyThymeLeafConfig { @Resource ......
SpringBoot Autowired Resource

springboot中使用application.properties配置mysql和sqlserver

1.使用依赖 * mysql: <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId></dependency>* sqlserver: <dependency> <groupId>com ......

SpringBoot学习笔记--系列文章

随笔分类 - Spring Boot SpringBoot学习笔记(八)——JWT、(Vue3、Axios、Vue-Router、TypeScript实现授权与验证示例) SpringBoot学习笔记(七)——综合示例BookStore图书管理系统 SpringBoot学习笔记(六)——分页、跨域、 ......
SpringBoot 笔记 文章

SpringBoot/Java中定时请求并根据服务端响应头的date实现本地Windows修改时间/时间同步(管理员权限问题-bat管理员启动cmd并运行jar)

场景 业务场景需要将本地Windows服务器与远端Linux服务器进行时间同步。 但是远端服务器无法进行任何操作,不能进行配置开启ntp等操作。 但是可以知道远端服务器开放的服务,比如远端的业务系统的ip和端口。 那么可以通过请求远端业务系统的服务,并根据响应头的date字段获取远端服务器 的时间, ......
管理员 时间 SpringBoot 权限 Windows

hadoop中distcp的mapreduce任务中的task0详解及优化

distcp 是 Hadoop 中一个用于数据复制的工具,可用于大规模数据复制场景。在 distcp 执行过程中,会运行多个 MapReduce 任务,其中第一个任务通常被称为 "task0" 或 "main task"。 task0 主要负责以下操作: 解析命令行参数并生成 distcp 配置。 ......
mapreduce 任务 hadoop distcp task0

SpringBoot拦截器

在项目的开发中,在某些情况下,我们需要对客户端发出的请求进行拦截,常用的API拦截方式有Fliter,Interceptor,ControllerAdvice以及Aspect。 上面的图是Spring中拦截机制,请求从Filter-->>Controller的过程中,只要在指定的环节出现异常,可以通 ......
SpringBoot

SpringBoot —— 后端操作实现

后端实现步骤(java) 一、表示层(controller)1、StudentController返回结果Result(vo) 二、业务层(service)2、StudentService3、StudentServiceImpl 三、持久层(mapper)4、StudentMapper 四、启动(同 ......
SpringBoot

SpringBoot(10.1) -- AOP

SpringBoot的AOP的2种实现方式 基于Spring的AOP写法 spring.aop.auto=true # 是否启用aopspring.aop.proxy-target-class=false # 代理方式有接口使用jdk动态代理,如果没有接口使用cglib代理 基于SpringBoot ......
SpringBoot 10.1 AOP 10

SpringBoot使用EasyExcel将Excel数据直接转换为类对象

背景 相比于读取excel到List<List<String>>对象中,抽象一个方法将excel数据直接一步读取到指定的类对象中,更为方便。 代码 通过类Class读取excel数据到对象 /** * 使用Class来读取Excel * * @param inputStream Excel的输入流 ......
SpringBoot EasyExcel 对象 数据 Excel

SpringBoot整合Mybatis-Plus分页

创建MP的配置类 package com.feiyu.common.config.mp; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.autoconfigure.Configur ......
Mybatis-Plus SpringBoot Mybatis Plus

SpringBoot整合knife4j

● knife4j是一个集 Swagger2和PoenApi为一体的增强解决方案 导入依赖 <dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-spring-boot-starter</artifactId> ......
SpringBoot knife4j knife4 knife 4j

springboot(9) -- jdbc

sprinboot操作mysql 数据库,首先添加dependence,springboot自带数据库连接池,这里demo则是另外使用阿里的druid <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache ......
springboot jdbc

SpringBoot入门案例后的4个问题

1. 我们的工程在引入`spring-boot-starter-web`依赖的时候,为什么没有指定版本 版本锁定 我们的项目继承了spring-boot-starter-parent父工程,它内部的父工程spring-boot-dependencies已经锁定了部分依赖的版本号,因此自己创建工程中无 ......
SpringBoot 案例 问题

SpringBoot+Prometheus+Grafana实现应用程序可视化监控

1、SpringBoot应用暴露监控指标 maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependen ......

SpringBoot pdf打印及预览(openhtmltopdf+freemarker)

SpringBoot pdf打印及预览(openhtmltopdf+freemarker) 添加依赖 openhtmltopdf+freemarker <properties> <openhtml.version>1.0.10</openhtml.version> </properties> <!- ......
openhtmltopdf SpringBoot freemarker pdf

OEM13.5安装推送客户端报错Executing command emctl secure agent

OEM13.5安装推送客户端报错Executing command emctl secure agent 现象: 建议部分显示如下方案: 1. ./emctl secure agent 2. ./emctl start agent 3. ./emctl config agent addinterna ......
Executing 客户端 command 客户 secure

SpringBoot2原理篇-黑马

原理篇 1 自动配置 1.1 bean 的加载方式【一】 1 自动配置 1.1 bean 的加载方式【一】 1.1.1 环境准备 创建一个新的工程模块【Maven 的,不是SpringBoot 的】 直接创建 一个全新的Maven 工程 【添加坐标】 <dependencies> <dependen ......
黑马 SpringBoot2 SpringBoot 原理

【SpringBoot】【配置加载】 SpringBoot配置加载解析时机原理

1 前言 不知道大家对于配置文件的加载有没有考虑过是什么时候加载解析的,这节我们就来看看。 2 执行入口 我们就先来看看加载配置的入口,核心类就是 ConfigFileApplicationListener主要作用就是读取应用的配置文件并add到Environment的PropertySources ......
SpringBoot 时机 原理

pom非常好用的写法,统一管理springboot有关依赖的版本

相信大家使用maven的时候,每引用一个依赖都要写一遍版本号,当然这是必要的,现在springboot非常的主流,每个springboot有关的依赖的版本又是一至的 我们大家就不需要重新去再写一遍了,可以引入依赖 spring-boot-dependencies,这样后面所有的有关springboo ......
写法 springboot 版本 pom

SpringBoot+Redis+自定义注解实现接口防刷(限制不同接口单位时间内最大请求次数)

场景 SpringBoot搭建的项目需要对开放的接口进行防刷限制,不同接口指定多少秒内可以请求指定次数。 比如下方限制接口一秒内最多请求一次。 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 实现 1、实现思路 首先自定义注解,添加时间区间和最大请求 ......
接口 注解 SpringBoot 次数 单位

CMake报告:Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)错误

原因是电脑缺少pkg-config库 Linux可以直接apt-get即可: sudo apt-get install pkg-config 下面详细说一下Windows如何手动安装: 转到http://ftp.gnome.org/pub/gnome/binaries/win32/dependenc ......

解决Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource数据源无法连接 springboot项目无法启动的问题

<groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.13</version> </dependency> 开始没有制定版本 报错换成了8.0版本,依旧报错 看了下配置文件 没有问题 查 ......

springboot alibaba druid数据库连接池配置,输出可执行sql

# 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource druid: # 初始连接数 initialSize: 5 # 最小连接池数量 minIdle: 2 # 最大连接池数量 maxActive: 50 # ......
springboot alibaba 数据库 数据 druid

Springboot创建多module项目--转载

1)create new project ( 或 File --> new --> project) 2)选中Spring Initializr ,点击Next image.png 3)填写必要信息,点击Next image.png 4)依赖页不用勾选,点击Next image.png 5)选择项目 ......
Springboot 项目 module

Springboot-hbase增删改20230509

1、启动 2、ZK客户端 3、springboot+hbase实例 1)、pom <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</ ......
Springboot-hbase Springboot 20230509 hbase

SpringBoot - 参数接收方式

SpringBoot -参数接收方式 · 前言 · 使用@PathVariable接收路径中的参数 · 使用@RequestParam获取路径中?后的参数 · 使用@RequestBody获取Map对象 · 使用@RequestBody获取实体对象 前言 使用@PathVariable接收路径中的参 ......
SpringBoot 参数 方式

SpringBoot的@Configuration注解

本文主要讲述SpringBoot的@Configuration注解。 一.POJO类的声明 例如有两个pojo类,分别是User和Pet User类的声明如下: public class User { private String name; private Integer age; public ......
注解 Configuration SpringBoot

> Task :app:bundleServerReleaseJsAndAssets FAILED Cannot create a string longer than 0x1fffffe8 characters

这个错误通常是由于字符串长度过长而导致的。具体地说,在 Android 中,这个错误通常是由 JavaScript 代码(例如 React Native 代码)打包时超出了 Android 的限制而导致的。 解决此问题的一种方法是通过调整 Gradle 构建脚本中的参数来增加 Android 中字符 ......

Springboot 项目配置 HTTPS

生成证书 输入命令 keytool -genkeypair -alias "boot" -keyalg "RSA" -keystore "boot.keystore" 生成完成后会提示 Warning: JKS 密钥库使用专用格式。建议使用 "keytool -importkeystore -src ......
Springboot 项目 HTTPS