springboot
bug 搬运工
努力,变强
展开
-
java 中的 Math.round(-1.5) 等于多少?
2.如果引用为引用数据类型,比如对象、数组,则该对象、数组本身可以修改,但指向该对象或数组的地址的引用不能修改。当使用final修饰方法时,这个方法将成为最终方法,无法被子类重写。但是,该方法仍然可以被继承。3. 如果引用时类的成员变量,则必须当场赋值,否则编译会报错。1.如果引用为基本数据类型,则该引用为常量,该值无法修改;当用final修改类时,该类成为最终类,无法被继承。比如常用的String类就是最终类。(1)用来修饰一个引用。(2)用来修饰一个方法。原创 2024-04-20 16:56:40 · 96 阅读 · 0 评论 -
mybatis 报invalid comparison: java.util.ArraysArrayList and java.lang.String异常
这是一个根据list集合的查找数据的 sql,在接收list的时候加了判断 list != ‘ ’ “”,引起了集合与Stirng类型的比较,故报错<if test="list != null and list != '' "> AND roo_id IN <foreach collection="list" item="id" index="index" open="(" close=")" separator=","> #{id} .原创 2020-06-24 14:20:01 · 329 阅读 · 0 评论 -
java通过连接(url)下载pdf文件
/** * 电子发票下载 * @param url * @param response * @throws UnsupportedEncodingException */ @GetMapping(value="/cxfKp/download") public void invoiceDownload(String url,HttpServletResponse response ) throws UnsupportedEncodingExce...原创 2020-06-11 17:18:26 · 2607 阅读 · 0 评论 -
SpringBoot项目找不到主类或无法加载主类
https://blog.csdn.net/qq_35472880/article/details/102967626?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task转载 2020-03-23 14:38:49 · 592 阅读 · 0 评论 -
No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
今天在讲jpa增删改查等方法抽取后,在测试的过程中出现下面错误:看错误原因是:在转化成json的时候,fasterxml.jackson将对象转换为json报错,发现有字段为null。解决方案:实体类上添加@JsonIgnoreProperties(value = { “hibernateLazyInitializer”})...原创 2020-02-28 17:59:44 · 995 阅读 · 0 评论 -
关联mysql失败_Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezon'
时区错误,MySQL默认的时区是UTC时区,比北京时间晚8个小时。所以要修改mysql的时长在mysql的命令模式下,输入:set global time_zone=’+8:00’;再次连接成功...原创 2020-02-28 12:44:34 · 88 阅读 · 0 评论 -
If you have database settings to be loaded from a particular profile you may need to activate it (no
在主程序注解加上:(exclude={DataSourceAutoConfiguration.class})原创 2020-02-19 22:07:56 · 11735 阅读 · 0 评论 -
No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
在实体类加上:@JsonIgnoreProperties(value = { “hibernateLazyInitializer”})原创 2020-02-13 13:19:07 · 499 阅读 · 0 评论 -
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context
测试springboot时发现test有问题,上网搜了下:包名要一样原创 2019-03-22 18:46:12 · 285 阅读 · 0 评论 -
Cannot resolve symbol 'log'
今天导入别人的项目时,发现log飘红,提示Cannot resolve symbol‘log’,网上查询发现安装lombok插件即可。以下是lombok插件的作用。项目中经常使用bean,entity等类,绝大部分数据类类中都需要get、set、toString、equals和hashCode方法,虽然eclipse和idea开发环境下都有自动生成的快捷方式,但自动生成这些代码...原创 2019-03-22 13:57:47 · 839 阅读 · 0 评论 -
The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You
url: jdbc:mysql://localhost:3306/sell?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8mysql默认服务器时区问题,将数据库连接修改成上述那样,就能解决原创 2019-03-25 17:47:29 · 98 阅读 · 0 评论 -
spring boot thymeleaf引擎访问HTML页面
1,pom文件添加<!--thymeleaf模板引擎--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></depend...原创 2019-03-05 20:32:55 · 346 阅读 · 0 评论 -
idea Spring Boot properties或者yml不能自动提示解决办法
在项目上添加spring即可,操作如下:然后点击OK这时候配置文件会变成spring配置文件提示就有了:原创 2019-03-04 14:02:52 · 9959 阅读 · 6 评论 -
springboot启动项目时不能自动执行resources文件夹下的.sql文件
最近用boot2.0版本不知道怎么配置都无法执行sql文件,经过查阅资料需要配置一下代码:schema: - classpath:department.sqlinitialization-mode: always 加上这句代码即可...原创 2019-03-11 12:23:30 · 832 阅读 · 0 评论 -
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
springboot配置MySQL数据库报错:pom文件:<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <depe...原创 2019-03-11 12:27:34 · 148 阅读 · 0 评论 -
springboot:WARN No appenders could be found for logger (druid.sql.Connection).
报错原因没有配置日志文件:pom文件:<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version></dependency>原创 2019-03-11 14:33:54 · 4602 阅读 · 0 评论 -
Unsatisfied dependency expressed through field 'departmentMapper'; nested exception is org.springfra
springboot和mybatis结合报错,在启动主程序处配置扫描的mapper文件即可:@ComponentScan(basePackages = "com.example.springboot.mapper") 重新启动idea错误消失原创 2019-03-12 10:17:58 · 24595 阅读 · 2 评论 -
Inferred type 'S' for type parameter 'S' is not within its bound; should ext
解决方法:1、springboot 版本问题,将 2.0.1 版本换成 1.5.4 版本。2、将girlRepository.findOne(id);改为girlRepository.findById(id).orElse(null);或girlRepository.findById(id).get();...原创 2019-03-25 12:08:47 · 3419 阅读 · 1 评论 -
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAUL
今天导数据库时遇到一个问题,Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAUL字面意思:表定义不正确; 在DEFAULT中只能有一个TIMESTAMP列和CURRENT_TIMESTAMP原因是当你给一个timestamp设置为on upda...原创 2019-03-22 10:59:34 · 3428 阅读 · 0 评论 -
idea新建Spring Boot 项目测试,以及jar包启动方式
1,新建 module -》spring Initializr:next:next:web 要选上项目路径:建完之后是这个目录结构:这个是自动生成的新建测试类:@RestControllerpublic class HelloControllerSpringBoot { @RequestMapping("/hello") p...原创 2019-03-02 12:13:26 · 1004 阅读 · 0 评论