- 博客(20)
- 收藏
- 关注

原创 springboot jpa:jpa ERROR o.h.hql.internal.ast.ErrorCounter - Path expected for join!
报错:解决:错误的原因是Hibernate不认识join,我们需要将Left join改成,即可,‘,’也是连接查询
2021-06-10 11:30:18
345

原创 springboot jpa:报错:antlr.NoViableAltException: unexpected token: *
原因是sql语句上不识别该字段。解决方法是在sql语句上加 as
2021-06-09 16:30:19
1728

原创 springboot:jpa:报错:java.lang.IllegalArgumentException: org.hibernate.QueryException: *
报错:Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: STATUS of:解决:sql中的status换成实体中的字段名称,要不然识别不到该字段
2021-06-09 16:28:18
672
原创 DBeaver 登录oracle报错:Listener refused the connection with the following error:
数据库名称写错导致连接报错,替换为自己的数据库名称即可。
2024-09-25 11:27:45
426
原创 调用 Https服务报 SunCertPathBuilderException: unable to find valid certification path to requested target
问题原因:Java自带的安全证书不受信任,在代码里面的实现时忽略证书,绕开SSL验证。
2024-01-17 14:39:14
1531
原创 java.io.IOException: Server returned HTTP response code: 503 for URL:http://whois.pconline.com.cn
URL realUrl = new URL(url);URLConnection connection = realUrl.openConnection(); connection.setRequestProperty("User-Agent","Mozilla/4.0 compatible; MSIE 6.0; Windows NT 5.1;DigExt");//最关键的!!! connection.connect(); in = new BufferedReader(new InputSt
2023-12-22 14:01:02
1047
原创 com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 32, fieldName data, fast
接口返回的字段类型要与实体类的字段类型一致。
2023-05-08 15:26:37
493
原创 thymeleaf生成PDF的时候中文不显示
body{font-family:SimSun;}.title{align-content: center;text-align: center;}.signature{float:right }
2023-05-08 15:13:30
371
原创 freemarker将HTML生成PDF保存本地或者输出流
System.out.println("生成模板内容失败"+e.fillInStackTrace());System.out.println("------生成pdf失败-------");* @param templateDirectory 模板文件夹。* @param templateName 模板文件名。* @param paramMap 模板参数。* @param fileString html内容。* @param content html内容。
2023-04-28 18:04:14
519
原创 Https传输MultipartFile
报错:org.springframework.web.multipart.MultipartException: Current request is not a multipart request。解决:用 HttpURLConnection conn = conn = (HttpURLConnection) url.openConnection();报错:org.apache.http.client.ClientProtocolException。定义key-value!
2023-04-27 11:41:46
326
原创 RedisUtil 第一次get key值报空指针异常
问题:因为是new的redis导致每次都null,应该从spring容器中获取。RedisUtil redisUtil1 = new RedisUtil();解决:spring容器中获取RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
2022-05-31 18:42:43
1232
原创 redis的保存key,value出现\xac\xed\x00\x05t\x00\x0b的解决
redis template向redis存放使用java对象序列化的值,序列化方式和string的一般方式不同。spring默认采用defaultSerializer = new JdkSerializationRedisSerializer();来对key,value进行序列化操作,在经过查看JdkSerializationRedisSerializer中对序列化的一系列操作序列化原对象并返回字节数组对象最终!!!!使用了JDK自带的ObjectOutPutS...
2022-05-30 16:36:38
638
原创 Java8 stream 更改List<Map<String,Object>> 里面Map对象的键
1、更新多个键:List<Map<String, Object>> returnList = new ArrayList<>();returnList.put("aa","1");returnList.put("bb","2");returnList.stream().map(x -> {//aa修改为a,bb修改为b x.put("a",x.remove("aa")); x.put("b",x.remove("bb")); return x; ...
2022-05-25 17:55:25
1000
原创 WM_CONCAT函数导致:java.sql.SQLException: ORA-22922: 不存在的 LOB 值
原生sql执行正常,放在代码中执行报错:Caused by: java.sql.SQLException: ORA-22922: 不存在的 LOB 值解决:TO_CHAR(WM_CONCAT(字段名))函数换成LISTAGG (字段名,',' ) WITHIN GROUP(ORDER BY 字段名)
2022-03-18 11:43:17
989
原创 JdbcTemplate Query.getResultList致列名无效
原因是:在实体类中字段比如class{private Integer id;private Date createTime;private String createTimeStr;}而在SQL中的SELECT语句中没有createTimeStr这一列SELECT ROWNUM ID,T.CREATE_TIME FROM TABLE;参考地址:https://www.cnblogs.com/memory4young/p/4167044.html...
2022-03-10 17:32:44
434
原创 knife4j配置
1、在talent-common引入pom.xml依赖<!--knife4j--><dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-micro-spring-boot-starter</artifactId> <version>2.0.8</version></dependency&.
2022-02-14 17:41:32
1416
原创 @OneToOne使用报错
报错:Caused by: org.hibernate.AnnotationException: Referenced property not a (One|Many)ToOne: com.purchase.modules.product.entity.MeterialBase.categoryName in mappedBy of com.purchase.modules.strategy.entity.Category.meterialBase解决方案:...
2021-12-21 10:05:41
579
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人