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

issue with Cassandra in pekko-sample-distributed-workers-scala #109

Open
pierreboudes opened this issue May 15, 2024 · 2 comments
Open

issue with Cassandra in pekko-sample-distributed-workers-scala #109

pierreboudes opened this issue May 15, 2024 · 2 comments

Comments

@pierreboudes
Copy link

On a stable Debian (OpenJDK 17), the example pekko-sample-distributed-workers-scala will fail on a exception while using sbt run or sbt "runMain worker.Main cassandra".

The logs

Starting Cassandra on port client port: 9042 storage port 45209 host 127.0.0.1 java version 17.0.10+7-Debian-1deb12u1
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.apache.cassandra.security.ThreadAwareSecurityManager (file …/pekko-samples/pekko-sample-distributed-workers-scala/target/cassandra-db/cassandra-bundle.jar)
WARNING: Please consider reporting this to the maintainers of org.apache.cassandra.security.ThreadAwareSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
Exception (java.lang.AssertionError) encountered during startup: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @11b03c1f
java.lang.AssertionError: java.lang.reflect.InaccessibleObjectException: Unable to make field private int java.io.FileDescriptor.fd accessible: module java.base does not "opens java.io" to unnamed module @11b03c1f
…
[error] 	at worker.Main$.startCassandraDatabase(Main.scala:101)
@pjfanning
Copy link
Contributor

you could add something like this to the build.sbt

run / javaOptions ++= Seq("--add-opens", "java.base/java.lang=ALL-UNNAMED")

unfortunately, this will cause issues if you use Java 8 or 11

when we get around to doing a PR to fix this, we'll probably need to add a condition that checks the java runtime version

@pierreboudes
Copy link
Author

Thank you for your quick answer ! I also had to add run / fork := true as warned by sbt ([warn] Compile / run / javaOptions will be ignored, Compile / run / fork is set to false). Unfortunately I still have the error. I also tried adding the same option for java.util (random pick on Internet).

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