langchain4j/langchain4j-onnx-scoring/src
moaedy 404fe9c418
Onnxruntime.dll: Dynamic Link Library (DLL) initialization routine failed (#5242)
## Issue

Closes #5241

## Change

Routes the inline `new OrtSession.SessionOptions()` calls in
`OnnxScoringModel` through a new `newDefaultSessionOptions()` helper
that catches
`UnsatisfiedLinkError`/`NoClassDefFoundError`/`ExceptionInInitializerError`
via `wrapNativeLibraryLoadFailure(Throwable)` and rethrows a
`RuntimeException` naming the missing Microsoft Visual C++
Redistributable, JVM/native architecture mismatch, and security-software
DLL blocking as likely causes, with a link to the official install docs.

Replaces the opaque `Dynamic Link Library (DLL) initialization routine
failed` failure on Windows with an actionable message.

## General checklist

- [x] There's an open issue for the change I want to make, and it's
clear from the issue what needs to be done.
- [x] read the [Contributing
Guidelines](https://github.com/langchain4j/langchain4j/blob/main/CONTRIBUTING.md).
- [x] read the [Coding
Conventions](https://github.com/langchain4j/langchain4j/blob/main/CODING_CONVENTIONS.md).
- [x] followed the contribution workflow described in the [Code of
Conduct](https://github.com/langchain4j/langchain4j/blob/main/CODE_OF_CONDUCT.md).
- [x] added unit tests for my change.
- [ ] added documentation for my change.
- [ ] reviewed another contributor's PR.

Closes #5241
2026-06-25 15:46:02 +02:00
..
main/java/dev/langchain4j/model/scoring/onnx Onnxruntime.dll: Dynamic Link Library (DLL) initialization routine failed (#5242) 2026-06-25 15:46:02 +02:00
test/java/dev/langchain4j/model/scoring/onnx Onnxruntime.dll: Dynamic Link Library (DLL) initialization routine failed (#5242) 2026-06-25 15:46:02 +02:00