ERROR:Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
Run Code Online (Sandbox Code Playgroud)
我只想同时使用redis和elasticsearch吗?pom.xml:
<dependency>
<!-- elasticsearch:5.6.10-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
和
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
当我只使用redis或只使用elasticsearch时可以,但是如果结合使用会出错。
错误信息:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-04 20:23:34.284 ERROR 99054 --- [ restartedMain] org.springframework.boot.SpringApplication.reportFailure[845] : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'controller_StudentEs': Unsatisfied dependency expressed through field 'studentEsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with …Run Code Online (Sandbox Code Playgroud)