geonetwork / geonetwork-microservices

GNU General Public License v2.0
13 stars 18 forks source link

Services not working (api-records) using documentation and spring:boot #64

Closed fgravin closed 1 year ago

fgravin commented 1 year ago

Following the documentation to run and debug a service, i've done

./mvnw clean install -Drelax -P-docker
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev,local -f modules/services/ogc-api-records/

It ends up with a

java.lang.IllegalStateException: No instances found of configserver (config-service)
    at org.springframework.cloud.config.client.ConfigServerInstanceProvider.getConfigServerInstances(ConfigServerInstanceProvider.java:52) ~[spring-cloud-config-client-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.cloud.config.client.ConfigServerInstanceProvider$$FastClassBySpringCGLIB$$facbf882.invoke(<generated>) ~[spring-cloud-config-client-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.12.RELEASE.jar:5.2.12.RELEASE]
    at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91) ~[spring-retry-1.2.5.RELEASE.jar:na]
    at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) ~[spring-retry-1.2.5.RELEASE.jar:na]
    at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164) ~[spring-retry-1.2.5.RELEASE.jar:na]

Did I miss something, or is there an issue or should we update the documentation regarding certain changes ? Thanks for inputs.

stijngoedertier commented 1 year ago

This works for me from the modules/services/ogc-api-records folder. This is also documented in the README:

mvn spring-boot:run

You can also make the location of the config explicit:

mvn spring-boot:run -Dspring-boot.run.profiles=standalone -Dspring-boot.run.jvmArguments="-Dspring.config.location=../../../config/"
fgravin commented 1 year ago

Thanks for your input I was referring to the README at the root of the project which gives wrong informations. I managed to run it from the ogc-api-records folder, thanks :)

Here a PR to improve the doc https://github.com/geonetwork/geonetwork-microservices/pull/66