micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.1k stars 1.07k forks source link

Upgrade 3.1.4 -> 3.2.0 results in "cannot access FieldSerializer" error #6594

Open Abraxis opened 3 years ago

Abraxis commented 3 years ago

Expected Behavior

Able to compile

Actual Behaviour

Unable to compile, reports: .... Note: Writing OpenAPI View to destination: /Users/abraxis/src/cohora/cohora/build/classes/java/main/META-INF/swagger/views/swagger-ui/index.html Note: Creating bean classes for 378 type elements error: cannot access FieldSerializer class file for com.esotericsoftware.kryo.serializers.FieldSerializer not found Consult the following stack trace for details. com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.esotericsoftware.kryo.serializers.FieldSerializer not found Note: Creating bean classes for 110 type elements warning: File for type 'com.cohora.geolocation.$GeoIpAPIFactory$Definition' created in the last round will not be subject to annotation processing. ....

Steps To Reproduce

Change micronautVersion=3.1.4 to micronautVersion=3.2.0

Environment Information

build.gradle: plugins { id("io.micronaut.application") version "2.0.8" id 'com.google.cloud.tools.jib' version '2.8.0' id 'groovy' id 'com.adarshr.test-logger' version '3.0.0' id "org.sonarqube" version "3.3" }

version = "0.9" group = "com.cohora"

repositories { mavenCentral() }

micronaut { runtime("netty") testRuntime("junit5") processing { incremental(true) annotations("com.cohora.*") } }

dependencies { compileOnly("org.projectlombok:lombok") annotationProcessor("org.projectlombok:lombok") annotationProcessor("org.mapstruct:mapstruct-processor:1.4.2.Final") annotationProcessor("io.micronaut.data:micronaut-data-processor") annotationProcessor("io.micronaut.openapi:micronaut-openapi") annotationProcessor("io.micronaut.security:micronaut-security-annotations") implementation("javax.inject:javax.inject:1") implementation("io.micronaut.data:micronaut-data-hibernate-jpa") implementation("io.micronaut.flyway:micronaut-flyway") implementation("io.micronaut.kafka:micronaut-kafka") implementation("io.micronaut.micrometer:micronaut-micrometer-core") implementation("io.micronaut.micrometer:micronaut-micrometer-registry-prometheus") implementation("io.micronaut.security:micronaut-security-jwt") implementation("io.micronaut.security:micronaut-security-oauth2") implementation("io.micronaut.sql:micronaut-jdbc-hikari") implementation("io.micronaut:micronaut-http-client") implementation("io.micronaut:micronaut-runtime") implementation("io.micronaut:micronaut-tracing") implementation("io.micronaut:micronaut-validation") implementation("io.micronaut.cache:micronaut-cache-caffeine") implementation("io.swagger.core.v3:swagger-annotations") implementation("javax.annotation:javax.annotation-api") implementation("org.mapstruct:mapstruct:1.4.2.Final") implementation("org.apache.commons:commons-lang3:3.12.0") implementation("commons-codec:commons-codec:1.15") implementation("com.twilio.sdk:twilio:8.+") implementation("com.sendgrid:sendgrid-java:4.8.0") implementation("com.googlecode.libphonenumber:libphonenumber:+") implementation("org.apache.tika:tika-core:+") implementation("org.hashids:hashids:+") implementation("com.github.jknack:handlebars:4.3.0") implementation("com.github.jknack:handlebars-helpers:4.3.0") implementation("com.github.jknack:handlebars-humanize:4.3.0") implementation("org.jsoup:jsoup:1.14.3") implementation("net.javacrumbs.shedlock:shedlock-micronaut:4.29.0") implementation("net.javacrumbs.shedlock:shedlock-provider-jdbc-micronaut:4.29.0") implementation("org.apache.poi:poi:5.1.0") implementation("org.apache.poi:poi-ooxml:5.1.0") implementation('com.google.firebase:firebase-admin:8.1.0') implementation("org.apache.poi:poi-scratchpad:5.1.0") implementation("com.vladmihalcea:hibernate-types-52:2.14.0") implementation("nl.basjes.parse.useragent:yauaa:+") implementation("com.blazebit:blaze-persistence-core-api:1.6.3") implementation("com.blazebit:blaze-persistence-core-impl:1.6.3") implementation("com.blazebit:blaze-persistence-integration-hibernate-5.4:+") implementation('org.apache.poi:poi:4.1.2') implementation('org.apache.poi:poi-ooxml:4.1.2') implementation('org.apache.poi:poi-scratchpad:4.1.2') implementation('org.apache.commons:commons-compress:1.21') implementation('com.neovisionaries:nv-i18n:1.29') implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.1000') implementation("software.amazon.awssdk:s3:2.17.81") implementation("software.amazon.awssdk:rekognition:2.17.81") implementation('com.maxmind.geoip2:geoip2:2.15.0') implementation('net.logstash.logback:logstash-logback-encoder:7.0') implementation('com.linkedin.urls:url-detector:0.1.17') implementation('commons-validator:commons-validator:1.7') implementation("io.micronaut.rxjava2:micronaut-rxjava2") implementation("io.micronaut.rxjava2:micronaut-rxjava2-http-client") implementation("io.micronaut.rxjava2:micronaut-rxjava2-http-server-netty") implementation("com.google.guava:guava:31.0.1-jre") implementation 'org.bytedeco:javacv-platform:1.5.5' implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: '2.14.1' runtime("io.micronaut.sql:micronaut-jdbc-hikari") runtimeOnly("ch.qos.logback:logback-classic") runtimeOnly("org.postgresql:postgresql") testImplementation("org.testcontainers:junit-jupiter") testImplementation("org.testcontainers:kafka") testImplementation("org.testcontainers:postgresql") testImplementation("org.testcontainers:testcontainers") testImplementation 'com.github.tomakehurst:wiremock-standalone:2.27.2' testCompile("org.spockframework:spock-core") testImplementation "io.micronaut.test:micronaut-test-spock" }

application { mainClass.set("com.cohora.Application") } java { sourceCompatibility = JavaVersion.toVersion("11") targetCompatibility = JavaVersion.toVersion("11") }

jib { from { image = 'gcr.io/distroless/java:11-debug' } to { image = 'docker.cohora.net/cohora-api' tags = [System.env.GITHUB_RUN_NUMBER ? System.env.BRANCH_NAME + "-" + System.env.GITHUB_RUN_NUMBER : "unknown-build"] auth { username = System.env.DOCKER_USERNAME ? System.env.DOCKER_USERNAME : "xxx" password = System.env.DOCKER_PASSWORD ? System.env.DOCKER_PASSWORD : "xxx" } } container { ports = ['8080'] jvmFlags = ['-Dlogback.cofigurationFile=logback-k8s.xml'] } }

compileJava { options.compilerArgs += "-Amapstruct.defaultComponentModel=jsr330" }

tasks.register("publishAll") { description = 'Triggers required publishing' } tasks.withType(JavaCompile) { options.fork = true options.forkOptions.jvmArgs << '-Dmicronaut.openapi.views.spec=rapidoc.enabled=true,redoc.enabled=true,swagger-ui.enabled=true,swagger-ui.theme=flattop' }

project.tasks.findByName('publishAll').dependsOn project.tasks.findByName('jib')

tasks.withType(Test) { maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 maxHeapSize = "1G" }

gradle.properties: micronautVersion=3.2.0 systemProp.sonar.host.url=https://sonar.cohora.net systemProp.sonar.projectKey=CohoraTeam_cohora-api systemProp.sonar.login=xxxx

Example Application

No response

Version

3.2.0

Abraxis commented 3 years ago

@dstepanov maybe some idea? ;)

altro3 commented 9 months ago

@Abraxis is it actual problem?I think that now everything should work correctly with the current versions of the core and openapi