![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
后端
dadeity
这个作者很懒,什么都没留下…
展开
-
IDEA使用lombok时@Setter @Getter无效
问题描述程序可以正常运行在编辑器界面提示类没有get和set方法已经成功导入了包,在SearchLogDto类已添加@Setter @Getter原因IDEA中使用lombok时需要引入Lombok插件安装Lombok插件Ctrl+Shift+A 输入 Plugins 打开插件管理页面,输入Lombok验证安装插件重启编辑器,发现问题已解决...原创 2021-01-29 16:41:42 · 919 阅读 · 1 评论 -
Java 创建目录,移动文件,重命名文件名
前言今天要使用Java File类,实现创建目录,移动文件,重命名文件名功能code@org.junit.Test public void mvFileTest() { String fileName = "test.txt"; // 目标文件目录 String cameraPath = "C:/develop/project/lmes/ftp_root/camera"; // 源文件 File sourceF原创 2021-01-26 17:25:54 · 353 阅读 · 2 评论 -
CentOS7开机自动执行脚本
操作步骤第一步:新建一个脚本run-java.sh,例如:开机自动执行java程序#! /bin/bash# 运行java程序java -jar /lmes/deployee/backend/ies-0.0.1-SNAPSHOT.jar &第二步:run-java.sh 脚本添加可执行权限chmod +x run-java.sh第三步:执行如下命令将/etc/rc.d/rc.local文标记为可执行文件在centos7中,/etc/rc.d/rc.local文件的权限被降低了原创 2021-01-07 10:57:34 · 5727 阅读 · 0 评论 -
@Scheduled注解参数详解
@Scheduled注解参数1. cron该参数接收一个cron表达式,cron表达式是一个字符串,字符串以5或6个空格隔开,分开共6或7个域,每一个域代表一个含义1.1. cron表达式语法[秒] [分] [小时] [日] [月] [周] [年]注:[年]不是必须的域,可以省略[年],则一共6个域1.2. 参数说明序号参数必填值通配符1秒true0-59, - * /2分true0-59, - * /3时true0-23, -原创 2020-09-15 18:46:34 · 380 阅读 · 0 评论 -
Action: Consider defining a bean named ‘authenticator‘ in your configuration.
错误描述今天Springboot 整合 Shiro 抛出如下错误:***************************APPLICATION FAILED TO START***************************Description:Parameter 0 of method shirFilter in com.bbzd.mes.shiro.config.ShiroConfig required a bean named 'authenticator' that cou原创 2020-07-21 16:11:29 · 612 阅读 · 0 评论 -
Field shiroService in com.bbzd.mes.shiro.auth.AuthRealm required a bean of type ‘xxxService‘ that...
问题描述今天写service层抛出如下错误:Description:Field shiroService in com.bbzd.mes.shiro.auth.AuthRealm required a bean of type 'com.bbzd.mes.shiro.service.ShiroService' that could not be found.The injection point has the following annotations: - @org.springfra原创 2020-07-21 14:13:04 · 774 阅读 · 0 评论 -
Failed to load class “org.slf4j.impl.StaticLoggerBinder“.
报错原因今天实现Shiro认证时候抛出如下错误:SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.原因根据抛出错误信息提示缺少jar包原创 2020-07-10 17:22:59 · 248 阅读 · 0 评论 -
Description: No bean of type ‘org.apache.shiro.realm.Realm‘ found.
问题描述当工程所有都配置完成之后,我们运行Shiro项目,发现并不能运行成功,报错信息如下所示.***************************APPLICATION FAILED TO START***************************Description:No bean of type 'org.apache.shiro.realm.Realm' found.Action:Please create bean of type 'Realm' or add a原创 2020-07-08 17:46:51 · 10004 阅读 · 2 评论 -
JPA基本注解
基本注解@Entity标注用于实体类声明语句之前,指出该Java类为实体类,将映射到指定的数据库表。如声明一个实体类User,将它映射到数据库的User表上。@Entity 属性说明名称描述name表名,可选,缺省类名即表名@Entity(name="user")public class User {}@Table当实体类与其映射的数据库表名不同名时,需要使用@Table标注说明,该注解与@Entity标注并列使用,置于实体类声明语句之前,可写于单原创 2020-07-06 15:16:31 · 372 阅读 · 0 评论 -
Jpa设置默认值约束
使用SpringDataJpa设置字段的默认值约束的2种方式1、修改建表时的列定义属性@Column(columnDefinition="INT DEFAULT '1' COMMENT '状态,1:正常,0:冻结状态,2:删除'")private Integer status;2、通过Hibernate(org.hibernate.annotations.ColumnDefault)下提供的注解进行设置默认值@ColumnDefault("1")private Integer status;原创 2020-07-06 12:01:43 · 1087 阅读 · 0 评论 -
SpringBoot项目目录结构
SpringBoot项目基础结构示例JAP和Mybatis混合项目目录结构catelog├─.gitignore├─pom.xml├─README.md└─src ├─main │ ├─java │ │ └─com │ │ └─springboot │ │ └─catelog │ │ ├─commons # 公共目录 │ │ │原创 2020-07-03 14:31:29 · 717 阅读 · 0 评论 -
Win10 配置 Oracle ODBC数据源[不需要安装Oracle客户端]
1. 下载驱动包base包:instantclient-basic-windows.x64-12.1.0.2.0.zipODBC包:instantclient-odbc-windows.x64-12.1.0.2.0.zip官网下载(需要账号):https://www.oracle.com/database/technologies/instant-client/downloads.html百度网盘:链接:https://pan.baidu.com/s/1jKgTwb4za7cIzUB7CHH_SA原创 2020-06-30 16:08:09 · 7887 阅读 · 6 评论 -
error: redefinition of class Coordinate class XXX 解决办法
软件版本编辑器:CLion问题描述今天学习C++按照老师课程所讲内容操作,在我本地抛出如下提示:In file included from f:\code\c++\header\line.h:1:0, from F:\Code\c++\main.cpp:5:f:\code\c++\header\Coordinate.h:3:7: error: redefinition of 'class Coordinate' class Coordinate {原创 2020-06-22 16:30:51 · 1458 阅读 · 0 评论 -
cannot open output file c__.exe: Permission denied
问题描述今天运行调试C++程序抛出了cannot open output file c__.exe: Permission denied提示信息,详细信息如下:d:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot open output file c__.exe: Permission deniedcollect2.exe: error: ld returned 1 exit statusmingw3原创 2020-06-18 14:55:39 · 10703 阅读 · 0 评论 -
mybatis-generator生成数据对象
简介MyBatis官方提供了逆向工程 mybatis-generator,可以针对数据库表自动生成MyBatis执行所需要的代码(如Mapper.java、Mapper.xml、POJO)。mybatis-generator 有三种用法:命令行、eclipse插件、maven插件。注意:本教程会使用命令行方式,优点如下:考虑到很多人使用不同编辑器对mybatis插件支持不同,操作方式不同造...原创 2020-01-09 17:27:26 · 337 阅读 · 1 评论 -
MySQL Workbench 将数据库导出ER模型
简介MySQL Workbench是为MySQL设计的ER/数据库建模工具。是著名的数据库设计工具DBDesigner4的继任者。具有设计和创建新的数据库图示,建立数据库文档,以及进行复杂的MySQL 迁移的作用。需求使用MySQL Workbench 一般用来 管理数据库或者数据库建模一般建模的步骤是 模型 > 数据库如果现在数据库已经存在了, 需要对数据库的数据表进行添加、结...原创 2020-01-08 15:10:07 · 4032 阅读 · 0 评论 -
IDEA 不显示 Maven 插件 mybatis-generator 解决
问题描述今天在pom.xml中添加如下代码:<plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.2</vers...原创 2020-01-03 15:30:57 · 4330 阅读 · 0 评论 -
nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/Invalid.....
错误提示03-Jan-2020 13:48:21.051 严重 [http-nio-8082-exec-3] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creati...原创 2020-01-03 13:55:38 · 5578 阅读 · 0 评论 -
You must configure either the server or JDBC driver (via the serverTimezone configuration property)
错误提示Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the...原创 2020-01-03 12:53:06 · 613 阅读 · 0 评论 -
初次使用@Slf4j注解没有生成log变量解决
环境配置lombok :1.16.18slf4j :1.7.29logback :1.2.3IDEA :2018问题描述配置好依赖,在Controller里面加入@Slf4,准备输入日志,发现没有 log 这个变量解决办法打开 File > Settings > Plugins 界面,输入框输入lombok搜索, 在列表中选择Lombok,点击这个插件的Insta...原创 2020-01-03 11:12:18 · 2006 阅读 · 0 评论 -
设置IDEA的 pom.xml 自动提示
预想效果设置File > Settings > Build, Execution, Deployment > Build Tools > Maven > Repositories 打开如下界面,操作如下图:原创 2019-12-31 14:34:55 · 2065 阅读 · 2 评论 -
java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"
问题描述今天使用SpringSecurity配置登录验证,输入密码提示如下错误提示:2019-12-30 14:28:52.534 ERROR 1684 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in con...原创 2019-12-30 15:10:45 · 502 阅读 · 1 评论 -
Java GET方式插入数据乱码解决
环境配置JDK版本:1.7OS版本:Win10Tomcat版本:7.0问题描述使用GET方式URL+参数插入数据数据库出现乱码解决办法Tomcat配置文件,server.xml设置URIEncoding="UTF-8"MySQL编码方式与Tomcat保持一致[client]port=3306default-character-set=utf8[mysql]...原创 2019-12-12 12:47:08 · 234 阅读 · 0 评论 -
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.2.48' (110)
问题描述今天使用另一台机器连接本地MySQL时候提示:ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.2.48' (110)问题分析网上说,你的MySQL设置了bind_address=127.0.0.1,不允许远程登录。我一想不对啊,前几天还可以登录的 ,肯定不是这个原因,查看 my.cnf 或者my.in...原创 2019-12-09 10:15:02 · 2179 阅读 · 0 评论 -
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing.解决
报错信息[WARNING] [WARNING] Some problems were encountered while building the effective model for com:mmall:war:1.0-SNAPSHOT[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-c...原创 2019-11-28 13:59:30 · 12341 阅读 · 0 评论 -
Failed to initialize component [org.apache.catalina.webresources.JarResource 解决
环境配置JDK1.8Win10问题描述今天使用Spring配置完之后, 运行测试提示 :Failed to initialize component [org.apache.catalina.webresources.JarResource解决办法找到本地仓库位置,一般在C:\Users\Admin\.m2\repository删除repository目录下面所有文件夹p...原创 2019-11-26 10:04:57 · 6337 阅读 · 2 评论