eventuate-examples / eventuate-examples-java-spring-todo-list

A Java and Spring Boot Todo list application built using Eventuate
Other
307 stars 151 forks source link

Upgrade dependencies, update according the style guide #36

Open dartartem opened 4 years ago

dartartem commented 4 years ago
dartartem commented 4 years ago

To support base image it is necessary to upgrade to Spring Boot 2, because there is different path for actuator that necessary for healtcheck:

http://localhost:8080/actuator/health - spring boot 2 http://localhost:8080/health - spring boot 1

During the update I found the following issue when started standalone-service (single-module):


standalone-service_1  | ***************************
standalone-service_1  | APPLICATION FAILED TO START
standalone-service_1  | ***************************
standalone-service_1  | 
standalone-service_1  | Description:
standalone-service_1  | 
standalone-service_1  | An attempt was made to call a method that does not exist. The attempt was made from the following location:
standalone-service_1  | 
standalone-service_1  |     springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
standalone-service_1  | 
standalone-service_1  | The following method did not exist:
standalone-service_1  | 
standalone-service_1  |     org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
standalone-service_1  | 
standalone-service_1  | The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
standalone-service_1  | 
standalone-service_1  |     jar:file:/service.jar!/BOOT-INF/lib/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
standalone-service_1  | 
standalone-service_1  | It was loaded from the following location:
standalone-service_1  | 
standalone-service_1  |     jar:file:/service.jar!/BOOT-INF/lib/spring-plugin-core-2.0.0.RELEASE.jar!/
standalone-service_1  | 
standalone-service_1  | 
standalone-service_1  | Action:
standalone-service_1  | 
standalone-service_1  | Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

I found by googling that reason is in swagger. I realized that I forgot to replace explicit swagger configs by swagger library from eventuate-util. I did it. But it did not help. But it works for other projects, for example for eventuate-tram-examples-customers-and-orders. According this issue: https://github.com/springfox/springfox/issues/2932 it seems reason is that application uses hateoas.

satyendrakumarsingh commented 4 years ago

Use below single dependency with latest spring boot, remove other spring-fox and swagger.

`

io.springfox
        <artifactId>springfox-boot-starter</artifactId>
        <version>3.0.0</version>
    </dependency>`

Access swagger doc as - /swagger-ui/

dartartem commented 4 years ago

@satyendrakumarsingh thank you