-
-
Notifications
You must be signed in to change notification settings - Fork 875
Description
Summary
OrientDB 3.2.46 fails with a serialization error when running on Java 17, preventing applications from using the embedded database.
Environment
- OrientDB Version: 3.2.46 (latest as of Dec 2024)
- Java Version: OpenJDK 17 (temurin-17.0.17)
- Operating System: Linux (Ubuntu/Debian-based)
- Application: JBake 2.7.0-SNAPSHOT static site generator
- Build Tools: Gradle 9.2.1 and Maven 3.9.9
Error Message
ERROR org.jbake.util.Logging - An unexpected error occurred:
Error during record serialization: Error on serialization of Serializable
DB name="cache" DB name="cache"
Expected Behavior
OrientDB should work with Java 17 as stated in the OrientDB documentation which claims support for Java 11-21.
Actual Behavior
When JBake attempts to use OrientDB for its content storage cache, the database fails during record serialization, causing all operations to fail.
Steps to Reproduce
Minimal Reproduction Case
-
Clone JBake repository:
git clone https://github.com/jbake-org/jbake.git cd jbake -
Ensure Java 17 is active:
java -version # Should show version 17 -
Build JBake:
./gradlew :jbake-dist:installDist
-
Initialize and bake a test project:
cd /tmp mkdir test-project && cd test-project /path/to/jbake/jbake-dist/build/install/jbake/bin/jbake -i /path/to/jbake/jbake-dist/build/install/jbake/bin/jbake -b
-
Observe the error - The bake command fails with the serialization error shown above.
Alternative: Run JBake Smoke Tests
# With Gradle
./gradlew :jbake-dist:smokeTest
# With Maven
mvn test -pl jbake-distBoth will fail with 6/6 tests showing the serialization error.
JVM Arguments Attempted
The following --add-opens arguments were added but did NOT fix the issue:
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMEDThese arguments are necessary for module access in Java 17 but do not resolve the serialization bug.
Workaround
Downgrading to Java 11 makes the issue disappear completely. All tests pass and the application works perfectly with Java 11.
# Using SDKMAN example
sdk use java 11.0.x-tem
./gradlew :jbake-dist:smokeTest
# All tests pass ✅Related Information
OrientDB Usage in JBake
JBake uses OrientDB as an embedded in-memory database for its ContentStore class:
class ContentStore(val cacheDir: File, val documentsTypesNames: Collection<String>) {
private val db: ODatabaseDocument
private val orient: OrientDB
init {
orient = OrientDB("memory:$databaseName", OrientDBConfig.defaultConfig())
// ... initialization code
}
}Full Error Context
21:52:25.855 INFO org.jbake.app.Crawler - NEW: /tmp/jbake-website-test/project/content/community/index.adoc
21:52:25.929 INFO org.jbake.parser.AsciidoctorEngine - Initializing Asciidoctor engine...
21:52:31.129 INFO org.jbake.parser.AsciidoctorEngine - Asciidoctor engine initialized.
21:52:31.677 INFO c.o.orient.core.db.OrientDBEmbedded - - shutdown storage: cache ...
21:52:31.692 ERROR org.jbake.util.Logging - An unexpected error occurred:
Error during record serialization: Error on serialization of Serializable
DB name="cache" DB name="cache"
Impact
This bug prevents JBake (and likely other OrientDB-dependent applications) from running on Java 17, which is a Long-Term Support (LTS) release. As Java 11 support ends, this becomes a critical blocker for applications that need to upgrade.
Questions
- Is there a known fix for this serialization issue in Java 17?
- Is OrientDB 4.x compatible with Java 17?
- Are there any configuration changes that would make 3.2.46 work with Java 17?
- Should the documentation be updated to clarify Java version compatibility?
Additional Context
- Issue appeared after JBake upgraded from Java 11 to Java 17
- OrientDB 3.2.46 is the latest version in the 3.2.x series
- Similar serialization issues have been reported in OrientDb serialization error on data read #9943
- This issue affects both Gradle and Maven builds identically
Requested Action
- Confirm whether OrientDB 3.2.x is expected to work with Java 17
- Provide a fix or workaround if available
- If not fixable in 3.2.x, provide guidance on migrating to a Java 17-compatible version
- Update documentation to clearly state Java version compatibility
Thank you for your attention to this issue!