自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 利用aop 在访问接口修改之前 将前端参数修改(加密aes)

import java.lang.annotation.*;/** * @author :Nan * @date :Created in 2021/9/19 13:26 * @description:注解 * @version: $ */@Target({ElementType.PARAMETER, ElementType.METHOD})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Interface

2021-09-21 13:21:29 348

原创 2021-09-21 docker 启动 tomcat 放入war包 报错 zip END header not found

记一次报错docker 运行命令docker run -d -it --name tomcat1 -p 80:8080 -v /home/tomcat1/webapps:/usr/local/tomcat/webapps -v /home/tomcat1/logs:/usr/local/tomcat/logs tomcat查看 docker 日志docker logs -f -t --tail=10 2ffdf2fbea4b下载docker tomcatdocker pull tomca

2021-09-21 13:12:16 516 1

原创 nginx java项目的无缝更新 证书 还有很多基础知识

nginx 应该很熟悉了 所以用到 nginx的可视化界面 docker web ui官方的文档 : https://gitee.com/cym1102/nginxWebUI#%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8Ejdk 什么的安装声明不在这说了 文档里都有的1.安装web ui (官网代码)1.安装docker容器环境apt install docker.io2.拉去镜像docker pull cym1102/nginxwebui:latest3.

2021-09-13 17:39:58 654

原创 mybatis-plus

1.mybatis-plus 依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.2</version> </dependency>2.配

2021-08-13 15:41:38 393

原创 springboot 如何将返回前端的null值 变为固定值

今天做了个项目 当我给前端返回null值时需求要把 null值都返回成 “–” 记录一下子在springboot上配置一下就好import com.fasterxml.jackson.core.JsonGenerator;import com.fasterxml.jackson.databind.JsonSerializer;import com.fasterxml.jackson.databind.ObjectMapper;import com.fasterxml.jackson.datab

2021-07-24 16:55:43 352

原创 总结一下遇到的蛮有用的springboot注解和工具类 忘了好自己瞅瞅

1、 lombok下的@SneakyThrows当有try catch 时可以在方法上加上,就不用可读性很差的try catch@Accessors@Accessors(chain = true)添加在类上面 可以在对象后面一直set 对象.setB("").setA("")这样审的fiClient.setClientId("").setClientNo("");@Accessors(fluent = true)可以对象的set get方法没有set get 反正我不用 用不习惯Use

2021-07-24 16:52:31 229

原创 springboot 利用注解@Scheduled快速做定时任务

就很简单 就在方法上加入注解@Scheduled(cron = “”)cron表达式有线上版本 https://cron.qqe2.com/ 就非常的人性有个问题注意一下就好 @Scheduled(cron = “”) 中 cron的参数只能有6个字符 但是线上有7个 去掉最后一个就好等到固定的时候就开始执行注解下的方法...

2021-07-21 17:17:29 79

原创 记一次忘记合并代码 先commit操作 使 push远端不生效

今天经理让我推代码,我不清楚他已经推过了,因为项目大多数都是我弄 所有我直接commit 但是当push远端时候 告诉我需要合并后才能push 我心里一惊 急忙刷新一下git 发现 经理确实提交了代码 难啊在百度中查到 任何还没有PUSH到远端(origin),但已经被提交到本地(local)的commit,都可以用以下命令回退首先 要看一下commit 记录git log找到哈希值在只用命令 (注意: 这个命令会使本地也变成你想回退的地方,需要自己保存一下)git reset (哈希值)

2021-07-06 16:02:04 199

原创 mybatis-plus事务 @DS注解不起作用

@Configurationpublic class TransactionConfig { @Autowired DataSource dataSource; @Bean("transactionManager") public DataSourceTransactionManager jpaTransactionManager() { return new DataSourceTransactionManager(dataSource); }}

2021-06-29 10:36:36 1182

原创 springboot项目启动找不到com.google.common.collect.ImmutableList的类文件

在pom文件中添加依赖 <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>29.0-jre</version> </dependency>

2021-01-29 13:26:21 3007 2

原创 tomcat启动spring项目,报具有该名称的xxxbean已经在xxx定义,覆盖被禁止

The bean ‘xxxRepository’, defined in xxx defined in @EnableJpaRepositories declared on PropertyConfig, could not be registered. A bean with that name has already been defined in cn.xfdc.shopproject.repository.property.xxxy defined in @EnableJpaRepositories

2021-01-29 10:39:00 1907

原创 java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Lja

今天项目打成war包 出现了这个ServletRequest找不到的问题浪费了好久时间 终于知道了本地的tomcat 和线上的ServletRequest冲突的问题 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId>&l

2021-01-21 14:03:07 738

原创 springboot + swagger3 学习

相比2来说 省去了配置添加依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> </dependency>只需要在启动

2021-01-15 21:44:25 239

原创 springboot项目打成war包并发布到tomcat中

1.导入pom.xml依赖<!--打包工具 --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>将packaging 打包方式改成

2021-01-13 09:47:13 114

原创 idea 序列化Serializable快捷键

在idea settings中 在UUID打上√ 生成序列化版本号就有了Serialization

2021-01-02 08:44:19 305

原创 问题No property 属性名 found for type 类名

No property 属性名 found for type 类名因为jpa方法有命名的规范报错的原因UserEntity findByUserNameAndByDeletedIsFalse(String userName);And后面不需要再写ByUserEntity findByUserNameAndDeletedIsFalse(String userName);这样就解决了所以遇到这个问题就是去看jpa的方法有没有写错,或者是自定义的sql...

2021-01-01 08:49:01 1630

原创 SpringSecurity安全框架学习

注解方式1.第一步在启动类上开启使用注解模式import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;@SpringB

2020-12-10 16:45:38 108

原创 QueryDsl整合JPA报错Failed to instantiate [org.springframework.data.jpa.repository.support

报错摘要com.example.security.entity.QUserEntityFailed to instantiate [org.springframework.data.jpa.repository.support Error creating bean with name 'querydslBindingsFactory' defined in class pathFailed to instantiate [org.springframework.data.web.query

2020-12-09 15:18:53 1520

原创 pom.mxl文件不是M图标显示<>

今天和往常一样打开idea,却发现我的pom文件是这样的而且项目所有关于pom的依赖全部报错,百度了好久,才发现这样之后 就恢复好了

2020-11-27 09:21:55 940

原创 学习SpringBoot整合Elasticsearch

学习Elasticsearch已经一周左右了,虽然是在本地的Windows系统下进行的测试,但是我感觉应该和linux系统的差不多的吧哈哈,等以后要是用的上还是要总结一下有什么不同的地方,首先是Elasticsearch后面都简称为ES,今天刚刚学习完的学习SpringBoot整合Elasticsearch来总结一下。1.添加依赖 <!-- elasticsearch依赖 --> <dependency> <

2020-11-23 16:48:24 165

原创 学习Windows下elasticsearch和可视化工具的安装

1.查看java环境2.下载elasticsearch链接:https://pan.baidu.com/s/1p6g3cU3xSqqAuqWORbQoIA提取码:8t2o复制这段内容后打开百度网盘手机App,操作更方便哦–来自百度网盘超级会员V1的分享3.运行elasticsearch下载完解压后,再bin目录下找到:elasticsearch.bat 双击即可访问 :http://127.0.0.1:9200 测试启动是否成功下一步修改一下elasticsearch-7.3.2\c

2020-11-18 13:43:28 360

原创 AOP如何获取注解参数

标题SpringBoot AOP获取参数 getControllerMethodInfo(JoinPoint joinPoint){ //获取目标类名 String targetName = joinPoint.getTarget().getClass().getName(); //获取方法名 String methodName = joinPoint.getSignature().getName(); //获取相关参数

2020-11-15 17:19:23 2494

原创 Linux安装jdk8

1.下载地址百度云:https://pan.baidu.com/s/18IicPYf7W0j-sHBXvfKyyg官网: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html2.解压压缩包使用MobaXterm工具远程linux系统将压缩包拖进/root/usr/local/tar -zxvf jdk-8u181-linux-x64.tar.gz解压压缩包3. 配置环境变量vim /etc/p

2020-11-04 09:50:50 173

原创 idea 断电后异常问题处理

idea重新打开之后,里面导入的包全部报错转自:https://www.cnblogs.com/xytj0049/p/10646723.html

2020-11-03 18:14:45 355

原创 学习Spring Boot Jpa多数据源配置

学习Spring Boot Jpa多数据源配置今天项目经理让我学习一哈配置多数据源,一天的时间啊引入依赖<!--数据库监控--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.18</version

2020-10-14 16:49:53 257

原创 学习分布式事务springboot+nacos+seata

今天学习seata,也踩了很多坑,老折磨王了,来总结一下感谢https://blog.csdn.net/ZaiZuoYuZuo/article/details/107636180大佬的文章下载seatahttps://github.com/seata/seata/releases创建日志表CREATE TABLE IF NOT EXISTS `undo_log`( `branch_id` BIGINT(20) NOT NULL COMMENT 'branch transac

2020-10-13 17:15:50 723 4

原创 学习SpringCloud使用Nacos注册中心实现远程调用和负载均衡

服务的提供者添加依赖 <!--Alibaba-Nacos--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency>配置启动类在启动类添加@EnableDiscoveryClien

2020-10-12 11:43:03 533 1

原创 存储Timestamp格式到数据库中

textBookEntity.setSellTime(new Timestamp(System.currentTimeMillis()));

2020-10-09 13:08:06 617

原创 学习SpringBoot整合Swagger2

创建工程创建一个Spring Boot项目,加入web和两个Swagger2相关的依赖如下: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency&gt

2020-10-08 14:31:51 128

原创 JPA事务问题Executing an update/delete query

问题代码 ///删除操作 @RequestMapping("/delete") public String delete(){ Pmarea p = new Pmarea(); //p.setName("葫芦岛吴奇隆"); p.setId(10); textDao.delete(p); return "delete ok"; }报出异常:There was an unexpected err

2020-10-07 15:05:21 430

原创 springboot启动出现了Field jpaQueryFactory in Controller required a bean of type ‘com.querydsl.jpa.impl.JP

jpaQueryFactory还没有这个Bean注入所以springboot无法启动 //实体类管理者 @Autowired private EntityManager entityManager; //JPA查询工程 @Autowired private JPAQueryFactory jpaQueryFactory; @Bean @Autowired public JPAQueryFactory jpaQuery(EntityM

2020-10-07 14:50:02 2291

原创 QueryDSL结合SpringDataJPA的学习

目标实现QueryDSL通用查询语言整合SpringDataJPA完成单表的查询快速创建实体类及Q实体创基基类JPApackage com.example.text.base;import org.springframework.data.jpa.repository.JpaRepository;import org.springframework.data.jpa.repository.JpaSpecificationExecutor;import org.springframewor

2020-10-07 14:42:06 325

转载 JAVA中JPA的主键自增长注解设置

JAVA中JPA的主键自增长注解设置JPA的注解来定义实体的时候,使用@Id来注解主键属性即可。如果数据库主键是自增长的,需要在增加一个注解@GeneratedValue,即:@GeneratedValue(strategy=GenerationType.IDENTITY)2 @Id3 private String id;@GeneratedValue注解的strategy属性提供四种值:–AUTO: 主键由程序控制,是默认选项,不设置即此项。–IDENTITY:主键由数据库

2020-10-07 10:22:11 556

原创 错误日记

标题学习使用springboot+JPA时候报错如下:java.lang.IllegalArgumentException: Not a managed type: class java.lang.Objectpublic interface Text2Dao extends BaseJPA{}没有指明实体类和主键,Textdao改成public interface Text2Dao extends BaseJPA<Pmarea> {}...

2020-10-07 09:23:11 65

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除