0

I don't know reason of this error.

first, my background enviroments is here.

  1. springboot 3.0
  2. gradle 7.4.2
  3. amazone correto 17

And, below content is excuted that i've command.

  1. ./gradlew bootBuildImage -debug
  2. then, success means with text "BUILD SUCCESSFUL in 11m 33s"
  3. docker run myImage:0.0.1-SNAPSHOT

Also, i saw this relates of issue here.

https://github.com/spring-attic/spring-native/issues/743

As you see above discuss, we knew this issue is cause by "spring-boot-starter-web-services" module. then it is resolved in "Spring 3.0" so it's done issue.

But reproduced this error even i use "Spring 3.0" now.

Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xpath.internal.functions.FuncNormalizeSpace.<init>(

Here is my gradle configurations.

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    id("org.springframework.boot") version "3.0.5"
    id("io.spring.dependency-management") version "1.1.0"
    id("org.graalvm.buildtools.native") version "0.9.21"
    kotlin("jvm") version "1.7.22"
    kotlin("plugin.spring") version "1.7.22"
}

group = "com"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17

configurations {
    compileOnly {
        extendsFrom(configurations.annotationProcessor.get())
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-data-jpa")
    implementation("org.springframework.boot:spring-boot-starter-web-services")
    implementation("org.flywaydb:flyway-core")
    implementation("org.flywaydb:flyway-mysql")
    implementation("org.jetbrains.kotlin:kotlin-reflect")
    implementation("org.flywaydb:flyway-mysql")
    implementation("org.springframework.boot:spring-boot-devtools")
    implementation("jakarta.persistence:jakarta.persistence-api:3.1.0")

    runtimeOnly("com.mysql:mysql-connector-j")
    annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
    testImplementation("org.springframework.boot:spring-boot-starter-test")
}

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

tasks.withType<JavaCompile> {
    enabled = true
}

tasks.withType<Test> {
    systemProperty("spring.profiles.active", System.getProperty("spring.profiles.active", "test"))
    useJUnitPlatform()
}
graalvmNative {
    binaries {
        named("main") {
            debug.set(true)
            verbose.set(true)
            configurationFileDirectories.from(file("resource/meta")) // Adds a native image configuration file directory, containing files like reflection configuration
        }
    }
}

How can i reslove this issue ?

  1. Describe what you tried
  • docker run myImage:0.0.1-SNAPSHOT
  1. What you expceted to happen
  • Running springboot Application with native
  1. What actually resulted.
  • Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xpath.internal.functions.FuncNormalizeSpace.(
박찬오
  • 1
  • 2
  • can you try without *graalvmNative*, because spring boot is managing reflection. and if you check [here](https://start.spring.io/#!type=gradle-project&language=java&platformVersion=3.0.6&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=native) they dont put that configuration in the starter. – ozkanpakdil May 14 '23 at 14:17

0 Answers0