Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

META-INF resources missing in dockerNative #60

Open
dmitry-worker opened this issue Apr 21, 2024 · 0 comments
Open

META-INF resources missing in dockerNative #60

dmitry-worker opened this issue Apr 21, 2024 · 0 comments

Comments

@dmitry-worker
Copy link

dmitry-worker commented Apr 21, 2024

Good day! I'm trying to make my native with swagger-ui
And it turns out that I'm missing META-INF information for it.

Exception in thread "main" java.lang.ExceptionInInitializerError: META-INF resources are missing, please check https://tapir.softwaremill.com/en/latest/docs/openapi.html#using-swaggerui-with-sbt-assembly
        at sttp.tapir.swagger.SwaggerUI$.$init$$$anonfun$2(SwaggerUI.scala:22)
        at scala.Option.getOrElse(Option.scala:201)
        at sttp.tapir.swagger.SwaggerUI$.<clinit>(SwaggerUI.scala:24)
        at sttp.tapir.swagger.bundle.SwaggerInterpreter.fromEndpoints(SwaggerInterpreter.scala:28)
        at sttp.tapir.swagger.bundle.SwaggerInterpreter.fromEndpoints$(SwaggerInterpreter.scala:11)

Since the common setup - based on traditional openJDK works fine - I assume the problem is with my configuration for dockerNative plugin. Am I missing some config options that allow adding META-INF information to native image?

My settings:

  object dockerNative extends DockerNativeConfig {
    // Native Image parameters
    override def nativeImageName         = "addr"
    override def nativeImageGraalVmJvmId = T("graalvm-java17:22.3.3")
    override def nativeImageClassPath    = runClasspath()
    override def nativeImageMainClass    = "Main"
    override def nativeImageOptions = Seq(
      "--no-fallback",
      "--enable-url-protocols=http,https",
      "--initialize-at-build-time=org.slf4j.LoggerFactory",
      "--initialize-at-build-time=org.slf4j.simple.SimpleLogger",
      "--initialize-at-build-time=org.slf4j.helpers.Reporter",
      "--initialize-at-build-time=org.slf4j.impl.StaticLoggerBinder",
      "--initialize-at-run-time=io.netty.channel.epoll",
      "--initialize-at-run-time=io.netty.handler.ssl",
      "--initialize-at-run-time=io.netty.channel.unix",
      "--initialize-at-run-time=io.netty.channel.kqueue",
      // "--trace-class-initialization=<put_your_class_here>",
      "-Djdk.http.auth.tunneling.disabledSchemes=",
    ) ++ (if (sys.props.get("os.name").contains("Linux")) Seq("--static") else Seq.empty)

    // Docker image parameters
    def baseImage    = "ubuntu:22.04"
    def tags         = List("dv/addr")
    def exposedPorts = Seq(8888)
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant