Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nailgun mode fails for Java 19 #221

Open
davexparker opened this issue Mar 28, 2023 · 2 comments
Open

Nailgun mode fails for Java 19 #221

davexparker opened this issue Mar 28, 2023 · 2 comments

Comments

@davexparker
Copy link
Member

Running PRISM in Nailgun server mode (-ng), which is the default for make tests, fails on Java 19:

Exception in thread "NGServer(null, 2113)" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
	at java.base/java.lang.System.setSecurityManager(System.java:425)
	at com.martiansoftware.nailgun.NGServer.run(NGServer.java:396)
	at java.base/java.lang.Thread.run(Thread.java:1589)

This is because Nailgun uses Security Manager functionality, which is deprecated from version 19.

The preferred solution will be to upgrade Nailgun (lib/nailgun-server.jar and src/prism/ngprism.c (and src/prism/ng.c.orig)) to a newer version from https://github.com/facebook/nailgun. There is a patch, which is not yet merged.

In the meantime, a temporary fix is to pass -Djava.security.manager=allow to java, e.g., by adding this to bin/prism:

PRISM_JAVA_PARAMS=-Djava.security.manager=allow

But this cannot easily be added to the main version of PRISM because earlier JDKs (11 and earlier) do not support this option.

@davexparker
Copy link
Member Author

Update: Modified versions of Nailgun that remove the Security Manager (e.g., the patch above) will not suffice, since there is then no way to catch Java exiting with an error (which means the Nailgun server closes if PRISM fails).

@davexparker
Copy link
Member Author

There is a fix in b2642c1 that automatically applies the PRISM_JAVA_PARAMS=-Djava.security.manager=allow workaround within prism-auto if Java is newer than version 19. This at least allows regression testing (make tests) to complete with new releases of Java. But callingprism -nailgun directly does not work without a manual fix. And this will need resolving properly (likely finding a replacement for Nailgun) if the Security Manager is properly removed in a later version of Java.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant