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

Native image build error #88

Open
rvankraaij opened this issue Jan 28, 2025 · 1 comment
Open

Native image build error #88

rvankraaij opened this issue Jan 28, 2025 · 1 comment

Comments

@rvankraaij
Copy link

Expected Behavior

The native image should be built successfully without errors. The application should work seamlessly with micronaut-langchain4j dependencies in the native image environment.

Actual Behaviour

The native image build fails with an error indicating that kotlin.coroutines.intrinsics.CoroutineSingletons was unintentionally initialized during the image build process.

Error: Classes that should be initialized at run time got initialized during image building: kotlin.coroutines.intrinsics.CoroutineSingletons was unintentionally initialized at build time. To see why kotlin.coroutines.intrinsics.CoroutineSingletons got initialized use --trace-class-initialization=kotlin.coroutines.intrinsics.CoroutineSingletons To see how the classes got initialized, use --trace-class-initialization=kotlin.coroutines.intrinsics.CoroutineSingletons

Steps To Reproduce

  1. Create a Micronaut application using the Micronaut CLI.
  2. Add the micronaut-langchain4j dependencies to the project.
<dependency>
    <groupId>io.micronaut.langchain4j</groupId>
    <artifactId>micronaut-langchain4j-core</artifactId>
  </dependency>
  <dependency>
    <groupId>io.micronaut.langchain4j</groupId>
    <artifactId>micronaut-langchain4j-ollama</artifactId>
  </dependency>
  1. run mvn package -Dpackaging=docker-native

Environment Information

Operating system: Ubuntu 22.04
JDK: Java(TM) SE Runtime Environment Oracle GraalVM 21.0.6+8.1

Example Application

No response

Version

4.7.3

@graemerocher
Copy link
Collaborator

we are aware, it requires altering the clients to not use okhttp likely

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

2 participants