Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service startup failed when updated swagger ui #15

Open
dartartem opened this issue May 17, 2021 · 0 comments
Open

service startup failed when updated swagger ui #15

dartartem opened this issue May 17, 2021 · 0 comments

Comments

@dartartem
Copy link
Contributor

Background:

Project used old configuration of swagger:

compile "io.springfox:springfox-swagger2:2.4.0"
compile "io.springfox:springfox-swagger-ui:2.4.0"

@Configuration
@EnableSwagger2
public class CommonSwaggerConfiguration {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("io.eventuate.examples.tram.ordersandcustomers"))
.build()
.pathMapping("/")
.genericModelSubstitutes(ResponseEntity.class, CompletableFuture.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class))
)
.useDefaultResponseMessages(false)
;
}
@Autowired
private TypeResolver typeResolver;
}

with url like: /swagger-ui.html

Currently, other projects use unified swagger configuration like this:

compile "io.eventuate.util:eventuate-util-spring-swagger:$eventuateUtilVersion"

link

@Configuration
public class CommonSwaggerConfiguration {
  @Bean
  public EventuateSwaggerConfig eventuateSwaggerConfig() {
    return () -> "io.eventuate.examples.tram.ordersandcustomers";
  }
}

link

with url like: /swagger-ui/index.html

Problem:

After migration service startup failed (customer-service):

customer-service_1       | ***************************
customer-service_1       | APPLICATION FAILED TO START
customer-service_1       | ***************************
customer-service_1       | 
customer-service_1       | Description:
customer-service_1       | 
customer-service_1       | An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
customer-service_1       | 
customer-service_1       |     jar:file:/service.jar!/BOOT-INF/lib/spring-plugin-core-1.2.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
customer-service_1       | 
customer-service_1       | It was loaded from the following location:
customer-service_1       | 
customer-service_1       |     jar:file:/service.jar!/BOOT-INF/lib/spring-plugin-core-1.2.0.RELEASE.jar!/
customer-service_1       | 
customer-service_1       | 
customer-service_1       | Action:
customer-service_1       | 
customer-service_1       | Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

But in eventuate-tram-examples-customers-and-orders everything works, it uses same eventuate dependencies.

But I found difference, eventuate-tram-examples-customers-and-orders uses newer version of spring cloud sleuth.

I updated it and error is changed:

customer-service_1       | ***************************
customer-service_1       | APPLICATION FAILED TO START
customer-service_1       | ***************************
customer-service_1       | 
customer-service_1       | Description:
customer-service_1       | 
customer-service_1       | An attempt was made to call a method that does not exist. The attempt was made from the following location:
customer-service_1       | 
customer-service_1       |     org.springframework.cloud.sleuth.instrument.redis.TraceLettuceClientResourcesBeanPostProcessor.postProcessAfterInitialization(TraceRedisAutoConfiguration.java:97)
customer-service_1       | 
customer-service_1       | The following method did not exist:
customer-service_1       | 
customer-service_1       |     io.lettuce.core.tracing.BraveTracing.builder()Lio/lettuce/core/tracing/BraveTracing$Builder;
customer-service_1       | 
customer-service_1       | The method's class, io.lettuce.core.tracing.BraveTracing, is available from the following locations:
customer-service_1       | 
customer-service_1       |     jar:file:/service.jar!/BOOT-INF/lib/lettuce-core-5.1.4.RELEASE.jar!/io/lettuce/core/tracing/BraveTracing.class
customer-service_1       | 
customer-service_1       | It was loaded from the following location:
customer-service_1       | 
customer-service_1       |     jar:file:/service.jar!/BOOT-INF/lib/lettuce-core-5.1.4.RELEASE.jar!/
customer-service_1       | 
customer-service_1       | 
customer-service_1       | Action:
customer-service_1       | 
customer-service_1       | Correct the classpath of your application so that it contains a single, compatible version of io.lettuce.core.tracing.BraveTracing

then I updated lettuce and issue was solved

dartartem added a commit to dartartem/eventuate-tram-examples-customers-and-orders-redis that referenced this issue May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant