I upgraded a project using the command
npx jhipster upgrade --target-version 7.1.0
and in my gateway (the UI of my microservices project) I faced the following error
bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found
I saw this post bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found that advised me to change my dependency from spring-boot-start-web to spring-boot-start-webflux (the first answer, where you add a 'ServerCodecConfigurer' bean, creates a circular dependency issue for me).
Now I get a new exception
java.lang.IllegalStateException: Failed to introspect Class [oh.essentials.config.LocaleConfiguration] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@6295d394]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:358)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:414)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:747)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:746)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:685)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:656)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1670)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:667)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:659)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1300)
at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:903)
at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:891)
at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:878)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:819)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:349)
at oh.essentials.OhEssentialsApp.main(OhEssentialsApp.java:69)
Caused by: java.lang.NoClassDefFoundError: LocaleResolver
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.base/java.lang.Class.getDeclaredMethods(Unknown Source)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463)
... 19 common frames omitted
Caused by: java.lang.ClassNotFoundException: LocaleResolver
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 23 common frames omitted
Please let me know if you need any additional details. I also tried to re-run the jhipster import-jdl command to see if that would help, but it didn't fix the issue.
upgrade
command doesn't always work between major releases. Especially microservices prior to v7. Mostly because the gateway is reactive-only in v7. This is a change we had to make based on Spring Cloud getting rid of Zuul and forcing Spring Cloud Gateway instead.