aabarmin / epam-microservices-training-2022

Apache License 2.0
14 stars 15 forks source link

[bug] microservice-drugs app fails to start #19

Closed naXa777 closed 1 year ago

naXa777 commented 1 year ago

Steps

  1. start zipkin

    cd microservices/docker/zipkin
    docker-compose up
  2. start eureka

    cd microservices\microservice-service-discovery
    mvn spring-boot:run
  3. start microservice

    cd microservices/microservice-drugs
    mvn clean spring-boot:run

Logs

2023-10-15T00:27:27.299+02:00  INFO 2020 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-10-15T00:27:27.313+02:00  INFO 2020 --- [  restartedMain] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-10-15T00:27:27.329+02:00 ERROR 2020 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.webjars.WebJarAssetLocator.scanForWebJars(WebJarAssetLocator.java:188)

The following method did not exist:

    'io.github.classgraph.ClassGraph io.github.classgraph.ClassGraph.acceptPaths(java.lang.String[])'

The calling method's class, org.webjars.WebJarAssetLocator, was loaded from the following location:

    jar:file:/C:/Users/naxa/.m2/repository/org/webjars/webjars-locator-core/0.52/webjars-locator-core-0.52.jar!/org/webjars/WebJarAssetLocator.class

The called method's class, io.github.classgraph.ClassGraph, is available from the following locations:

    jar:file:/C:/Users/naxa/.m2/repository/io/github/classgraph/classgraph/4.8.69/classgraph-4.8.69.jar!/io/github/classgraph/ClassGraph.class

The called method's class hierarchy was loaded from the following locations:

    io.github.classgraph.ClassGraph: file:/C:/Users/naxa/.m2/repository/io/github/classgraph/classgraph/4.8.69/classgraph-4.8.69.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.webjars.WebJarAssetLocator and io.github.classgraph.ClassGraph

Possible reason

Incomplete update to Java 21.

First commit that introduced the bug: 27537fdc (Java 21). Last commit at which the service starts successfully: bc8a0fd4 (Java 11).

naXa777 commented 1 year ago

Solution: update springdoc-openapi-ui to the latest version (1.7.0). As explained on SO: Error starting Springboot when update version to 2.7.0 "An attempt was made to call a method that does not exist".

Let me prepare the PR!


upd: the reported error is fixed, but now I'm facing another error: HAL explorer blank screen and a lot of 404 errors.

image

(please assign this issue to me. I'll keep debugging)


upd 2: must be some caching issue. it's gone after a few rebuilds.