I'm developing a java app, with springboot 3.x, the Api documentation is provided by OpenApi specification.
The problems come here, when i ran the app on IntelliJ it works fine but when y build the .jar file and execute it, doesn't work...
here's the stack trace ...
WARN org.springframework.context.annotation.AnnotationConfigApplicationContext -- Exception encountered during context initialization - cancelling refresh attempt : java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer 08:39:50.334 [main] ERROR org.springframework.boot.SpringApplication -- Application run failed java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:183) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:428) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:289) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464) at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347) at com.agilstrat.AgilstratApiApplication.main(AgilstratApiApplication.java:12) Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.agilstrat.configuration.OpenApiConfig] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@2a139a55] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360) at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:417) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$1(AbstractAutowireCapableBeanFactory.java:749) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:748) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:652) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1644) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:562) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:247) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:240) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:230) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:183) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:158) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ... 16 common frames omitted Caused by: java.lang.NoClassDefFoundError: io/swagger/v3/oas/models/OpenAPI at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402) at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504) at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465) ... 32 common frames omitted Caused by: java.lang.ClassNotFoundException: io.swagger.v3.oas.models.OpenAPI at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ... 36 common frames omitted well, reading this, i notice that's not found the OpenAPI class, add a dependency for that, but still doens't work, here's my pom.xml:
4.0.0 org.springframework.boot spring-boot-starter-parent 3.2.1 com.agilstrat agilstratApi 0.0.1-SNAPSHOT agilstratApi Api de Agilestrat 17 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-data-jpa org.springdoc springdoc-openapi-starter-webmvc-ui 2.2.0 io.swagger swagger-models 2.0.0-rc2 org.projectlombok lombok 1.18.30 provided jakarta.validation jakarta.validation-api 3.0.2 org.springframework.boot spring-boot-starter-security com.auth0 java-jwt 4.4.0 org.mariadb.jdbc mariadb-java-client 1.5.7 com.h2database h2 runtime com.mysql mysql-connector-j 8.2.0 runtime org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-plugin pre-integration-test start post-integration-test stop org.springdoc springdoc-openapi-maven-plugin 1.4 integration-test generate Also tried to add spring-doc plugin...
after about 2 hours looking for an answer to solve the problem, didn't get anything ... i'll apreciate a clue to solve it!
well, thanks for reading
Источник: https://stackoverflow.com/questions/780 ... oesnt-work
Мобильная версия