Hi Rob!
I have a brand new Spring Boot application with Ebean. When I start the project using IntelliJ with the Ebean Enhancement Plugin activated, everything works perfectly (Using the Spring Boot Application Run Configuration).
The problem is when I'm trying to run my application using Gradle only . It is able to build but it seems the enhancement is not done. I receive this error:
{"@timestamp":"2021-11-15T07:33:58.100-05:00","@version":"1","message":"Application run failed","logger_name":"org.springframework.boot.SpringApplication","thread_name":"main","level":"ERROR","stack_trace":"org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.stingray.traininghubbackend.Application]; nested exception is java.io.FileNotFoundException: class path resource [io/ebean/Finder.class] cannot be opened because it does not exist\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)\r\n\tat org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)\r\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)\r\n\tat org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)\r\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)\r\n\tat org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:782)\r\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:774)\r\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)\r\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:339)\r\n\tat com.stingray.traininghubbackend.Application.main(Application.java:12)\r\nCaused by: java.io.FileNotFoundException: class path resource [io/ebean/Finder.class] cannot be opened because it does not exist\r\n\tat org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:187)\r\n\tat org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55)\r\n\tat org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49)\r\n\tat org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)\r\n\tat org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86)\r\n\tat org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73)\r\n\tat org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:696)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:1010)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:341)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:304)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)\r\n\tat org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)\r\n\t... 12 common frames omitted\r\n"}
Here is my build.gradle
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:$openapitools_generator_version"
}
}
plugins {
id 'org.springframework.boot' version '2.4.5'
id 'io.franzbecker.gradle-lombok' version '4.0.0'
//id 'io.ebean' version '12.8.3' #Didn't change anything...
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
//apply plugin: 'io.ebean' #Didn't change anything...
apply from: 'gradle/openapitools-server-generator.gradle'
description = """TrainingHubBackend Service"""
springBoot {
buildInfo()
}
ebean {
debugLevel = 1
}
dependencies {
implementation project(":api")
implementation("com.stingray.web-rest-commons:web-rest-spring-boot-starter:1.0.1")
implementation("com.stingray.apikey-web-security:apikey-spring-boot-starter:1.0.4")
//Spring boot starter
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
//Metrics
implementation("io.micrometer:micrometer-registry-prometheus")
//Logging
implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.16'
implementation("net.logstash.logback:logstash-logback-encoder:6.6")
//Required to compile generated code
implementation "org.openapitools:jackson-databind-nullable:0.2.1"
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '3.0.0'
implementation("io.swagger:swagger-annotations:$swagger_annotations_version")
//Feature flags
implementation 'com.solidstategroup:bullet-train-client:1.6'
//Everything related to database/ORM
compileOnly("io.ebean:ebean:12.8.3")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("mysql:mysql-connector-java:$mysql_connector_version")
implementation("org.flywaydb:flyway-core")
//Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.junit.platform:junit-platform-runner:$junit_platform_runner_version")
}
tasks.withType(Test) {
useJUnitPlatform()
systemProperty 'spring.profiles.active', 'dev'
}
Any idea what I am missing?