Closed lordofthejars closed 2 months ago
This is very likely a problem in langgraph4j
, but it would require some investigation
My guess is that it tries to load the class from the base runtime class loader where the langgraph4j classes are instead of the child runtime one where your app classes are.
The TCCL should be used to load the classes to make sure layered class loaders are supported.
Unfortunately, the JDK serialization API is quite limited in this regard thus why things like https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/input/ClassLoaderObjectInputStream.html exist.
In any case, that’s not something we can fix in Quarkus as the dev mode layered class loader infrastructure is here to stay.
Note that the problem is not limited to Quarkus, any project using a layered class loader where the langgraph4j classes are in a different class loader as the class you load will have this issue.
It will require an upstream fix.
Describe the bug
I am using a library that uses
java.io.ObjectInput
andjava.io.ObjectOutput
to serialize some objects.The application packaged in a JAR works, but if I run it with quarkus dev, I get a
java.lang.ClassNotFoundException
.The full-stack trace:
The code is https://github.com/lordofthejars-ai/quarkus-langgraph-examples/tree/main/weather-graph
Expected behavior
Service works without any exception
Actual behavior
An exception is thrown.
How to Reproduce?
Start the service with
quarkus dev
andcurl localhost:8080/weather
Output of
uname -a
orver
Darwin Kernel Version 21.6.0
Output of
java -version
openjdk version "21.0.1" 2023-10-17 LTS
Quarkus version or git rev
3.14.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)apache-maven-3.9.8
Additional information
No response