转载 ES学习文档以及常见关键查询语句
SpringBoot整合es 中configer类的封装@Configurationpublic class ElasticSearchConfig { @Value("${elasticsearch.url}") private String url; @Value("${elasticsearch.username}") private String username; @Value("${elasticsearch.password}")
2022-04-26 17:10:10
108
原创 fastJoin转换为string类型日期格式
String jsonString = JSON.toJSONString(list.get(i), SerializerFeature.DisableCircularReferenceDetect,SerializerFeature.WriteDateUseDateFormat);这一行代码保留了原来的数据格式JSONObject.toJSONString会将日期格式转换为时间戳
2022-03-28 14:11:42
46
原创 【无标题】
"D:\Java use\Java\jdk1.8.0_181\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\ruanjian\Idea\Intel.
2022-01-21 10:56:43
273
原创 ElasticsearchStatusException[Elasticsearch exception [type=invalid_index_name_exception, reason=Inva
ElasticsearchStatusException[Elasticsearch exception [type=invalid_index_name_exception, reason=Invalid index name [UserInfo], must be lowercase]]创建的索引名必须是小写
2021-12-17 10:19:55
1573
原创 ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason
ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for ope.
2021-12-16 17:01:18
2821
原创 java.lang.IncompatibleClassChangeError: Found interface org.elasticsearch.common.bytes.BytesReferenc
j版本需要与安装的es版本保持一致
2021-12-16 14:34:36
678
原创 SpringBoot的Test测试@Autowired为null
@RunWith(SpringRunner.class)@SpringBootTest需要导入springBoot的测试依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency&...
2021-12-16 14:18:12
625
1
原创 SpringBoot整合Es报错Error creating bean with name ‘restHighLevelClient‘ defined in class path resource
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restHighLevelClient' defined in class path resource [com/esdemo/config/ElasticSearchClientConfig.class]: Bean instantiation via factory method failed; nested exception.
2021-12-16 11:51:03
2281
1
原创 docker安装kibana
1.docker 容器搜索kibana镜像 docker search kibana2.docker pull kibana(加上版本号,建议版本号与自己的es对应)3.下载完成之后启动kibanadocker run --name kibana -e -p 5601:5601 -d kibana4.启动完成之后查看kibana对应的容器iddocker ps5.修改kibana的配置文件使它对应的es地址为自己的es服务器地址docker exec...
2021-08-31 14:41:44
132
原创 Mybatis整合mybatis查询遇到的坑
mybatis整合map查询过程中如果map的value的参数类型不一致时,new map集合的过程中不需要指定map的类型。在动态sql语句中指定具体查询的参数类型即可 public Result findScenicCommentLevel(@RequestParam(value = "province_ids",required = false) Integer province_ids, @RequestPara
2021-08-06 11:36:25
205
原创 集合涉及到的排序方式
List集合排序List对象集合按照对象的某个属性排序List集合对象排序 list.sort((o1, o2) -> (int) (o2.getCommentCount().get("totalCount") - o1.getCommentCount().get("totalCount"))); sort方法: public staticvoid sort(Listlist) :将集合中元素按照默认规则排序。 public staticvoi...
2021-08-05 13:47:53
322
原创 buantu安装OpenResty
简介 OpenResty是一个基于Nginx与Lua的高性能Web平台,其内部集成了大量精良的Lua库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态Web应用、Web服务和动态网关。 OpenResty通过汇聚各种设计精良的Nginx模块(主要由OpenResty团队自主开发),从而将Nginx有效地变成一个强大的通用Web应用平台。这样,Web开发人...
2020-02-27 14:33:13
105
原创 Eureka踩过的坑
Eurekake客户端Request execution failure with status code 404; retrying on another server if availablecom.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/localhost:8083 - registratio...
2020-02-18 19:53:04
505
原创 解决:com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused:
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.jav...
2020-02-18 16:52:26
513
1
原创 SpringBoot出错
"D:\Java use\Java\jdk1.8.0_181\bin\java.exe" -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.liveBeansView.mbeanDomain -Dspring.applicati...
2020-02-18 16:37:32
136
原创 SpringBoot出错
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2019-05-30 11:14:43.970 ERROR 6208 --- [ main] o.s.b.d.LoggingFailureAnalys...
2020-02-18 16:23:43
92
原创 SringBoot2.0X+Redies整合时
maven依赖直接加入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> ...
2020-02-17 14:06:55
47
原创 **org.springframework.data.redis.repository.configuration.RedisRepositoryConfigurationExtension.regi
org.springframework.data.redis.repository.configuration.RedisRepositoryConfigurationExtension.regist原因您的问题来自Spring Boot,Spring Data Commons和Spring Data Redis之间的不兼容性....
2020-02-16 21:43:13
1714
1
原创 Mybatis注解实现一对多关联查询
beanpackage com.bean;public class Depment { public int did; public String dname; public int getDid() { return did; } public void setDid(int did) { this.did ...
2020-02-02 18:26:19
92
原创 SpringBoot公共组件的抽取
报错信息020-02-01 22 [http-nio-8080-exec-1] ERROR org.thymeleaf.TemplateEngine - [THYMELEAF][http-nio-8080-exec-1] Exception processing template "main": An error happened during template parsing (templa...
2020-02-01 22:35:04
572
1
转载 SpringBoot日志
1、日志框架比较(slf4j、log4j、logback、log4j2)Spring Boot在所有内部日志中使用Commons Logging,但是默认配置也提供了对常用日志的支持,如:Java Util Logging,Log4J, Log4J2和Logback。每种Logger都可以通过配置使用控制台或者文件输出日志内容。1.1 slf4jslf4j是对所有日志框架制定的一...
2020-01-31 14:14:03
47
原创 java.lang.IllegalStateException: Failed to load property source from location 'classpath:/applicatio
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application.yml' at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(Conf...
2020-01-30 13:14:34
116
原创 Not registered via @EnableConfigurationProperties or marked as Spring component
SpringBoot中,将类中的属性和配置文件中的配置进行绑定时出现以下的问题:当使用@ConfigurationProperties时IDEA顶部出现这样的提示:添加后错误确实是没了,但是在SpringBoot的单元测试时会看到如下的错误:Could not autowire. No beans of 'Person' type found回到自定义的bean中,添加注解@C...
2020-01-30 12:45:42
534
原创 IDEA建立springBoot项目出错
建立Pom文件出错Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.2.4.RELEASE from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resol...
2020-01-30 12:06:34
177
原创 SpringBoot+Mybatis项目
Maven依赖<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://...
2020-01-28 20:27:18
86
原创 SpringBoot连接数据库出错
2020-01-28 19:54:01.339 INFO 15988 --- [ restartedMain] com.main.Application : Starting Application on LAPTOP-6ICH6V2O with PID 15988 (D:\java\springBoot\test1\target\classes sta...
2020-01-28 20:20:23
507
原创 SpringBoot出错
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2020-01-28 18:54:58.153 ERROR 19420 --- [ restartedMain] o.s.boot.SpringApplication ...
2020-01-28 19:01:18
109
1
原创 SpringBoot第一次建立项目没有连接数据库时
启动的SpringBoot注解为@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})@SpringBootApplication注解为自动扫描当前包中的类以及当前包下的子包中的类@ComponentScan(basePackages = "com.*")扫描相应的SpringBoot下的包@Mapp...
2020-01-28 18:59:29
324
原创 Consider defining a bean of type 'com.dao.StudentDao' in your configuration.
Description:Field studentDao in com.services.StudentService required a bean of type 'com.dao.StudentDao' that could not be found.Action:Consider defining a bean of type 'com.dao.StudentDao' in...
2020-01-28 15:51:07
528
原创 SpringBoot启动出错
Spring-boot项目新建出错时ror starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2020-01-28 12:25:47.982 ERROR 2856 --- [ restartedMain] o.s.b.d.Log...
2020-01-28 12:52:07
116
原创 Mybatis的一级缓存和二级缓存的理解和区别
一级缓存基于sqlSession默认开启,在操作数据库时需要构造SqlSession对象,在对象中有一个HashMap用于存储缓存数据。不同的SqlSession之间的缓存数据区域是互相不影响的。一级缓存的作用域是SqlSession范围的,当在同一个sqlSession中执行两次相同的sql语句时,第一次执行完毕会将数据库中查询的数据写到缓存(内存),第二次查询时会从缓存中获取数据,...
2019-10-31 11:10:03
111
原创 mybatis实现增加功能
在实现增加功能时需要将数据进行commit提交,如果不提交的话,数据将存储在数据缓冲池中,而不会进行在数据库中存储,数据缓冲池session中将session关闭时数据将会消失
2019-10-23 11:16:26
316
原创 Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not fin
Error querying database. Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find result map 'com.entity.Person' referenced from 'com.entity.personMapper.queryallperson'
2019-10-23 10:57:01
512
原创 org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map
org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.boco.fsmsys.amuse.dao.AmuseItemDao.amuseItemat org.apache.ibatis.builder.MapperBuilderAssistant.setStatementPara...
2019-10-23 09:25:04
76