spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 356 forks source link

Spring boot 2.6.4 and mongo - reflection configuration missing for Query #1564

Closed lukaszpy closed 2 years ago

lukaszpy commented 2 years ago

Hello i'm getting : Native reflection configuration for org.springframework.data.mongodb.core.query.Query is missing.

my build gradle:



plugins {
    id("org.springframework.boot") version "2.6.4"
    id("io.spring.dependency-management") version "1.0.11.RELEASE"
    kotlin("jvm") version "1.6.10"
    kotlin("plugin.spring") version "1.6.10"
    id("org.springframework.experimental.aot") version "0.11.3"
}

group = "com.services.playit"

java.sourceCompatibility = JavaVersion.VERSION_17

repositories {
  maven { url = uri("https://repo.spring.io/release") }
  mavenCentral()
}

extra["springCloudVersion"] = "2021.0.1"

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-security")

    implementation("org.springframework.boot:spring-boot-starter-actuator")
    implementation("org.springframework.boot:spring-boot-starter-data-mongodb-reactive")
    implementation("org.springframework.boot:spring-boot-starter-webflux")
    implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
    implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")

    implementation("io.github.microutils:kotlin-logging:2.1.21")
    implementation("com.auth0:java-jwt:3.19.0")
    implementation("com.auth0:jwks-rsa:0.21.0")
    implementation("org.bouncycastle:bcprov-jdk15on:1.70")

    implementation("org.jetbrains.kotlin:kotlin-reflect")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
    implementation("org.springframework.cloud:spring-cloud-starter-sleuth")
    testImplementation("org.springframework.boot:spring-boot-starter-test")
    testImplementation("io.projectreactor:reactor-test")
}

dependencyManagement {
    imports {
        mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
    }
}

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = "17"
    }
}

tasks.withType<Test> {
    useJUnitPlatform()
}

tasks.getByName<org.springframework.boot.gradle.tasks.bundling.BootBuildImage>("bootBuildImage") {
    runImage = System.getenv("CUSTOM_REGISTRY_URL") + "/paketobuildpacks/run:tiny-cnb"
    builder = System.getenv("CUSTOM_REGISTRY_URL") + "/paketobuildpacks/builder:tiny"
    environment = mapOf(
            "BP_NATIVE_IMAGE"                       to "true",
            "BP_NATIVE_IMAGE_BUILD_ARGUMENTS"       to "--enable-all-security-services"
    )

    isPublish = true

    docker {
        host = "unix:///var/run/docker.sock"

        builderRegistry {
            username = System.getenv("CUSTOM_REGISTRY_USER")
            password = System.getenv("CUSTOM_REGISTRY_PASS")
            url = System.getenv("CUSTOM_REGISTRY_URL")
        }

        publishRegistry {
            username = "gitlab-ci-token"
            password = System.getenv("CI_JOB_TOKEN")
            url = System.getenv("CI_REGISTRY")
        }
    }
}```
mhalbritter commented 2 years ago

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

lukaszpy commented 2 years ago

@mhalbritter got it working by changing spring repository interface into concrete class with my implementation. But now I have problem with DB model class " Unresolved class"

mhalbritter commented 2 years ago

Nice. Please provide a minimal sample (something that we can unzip or git clone, build, and deploy), then i can look into it.

spring-projects-issues commented 2 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues commented 2 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.