Closed fbarthelery closed 1 year ago
Thanks for the heads up. I'll see what I can do...
This should be fixed in Kobweb libs version 0.13.4 (probably will release in about a week). You can set your version to 0.13.4-SNAPSHOT right now if you need it earlier.
Background from this point on, in case anyone is interested.
Relevant JEP: https://openjdk.org/jeps/411
Basically, a common use case for using the security manager is to prevent code from exiting.
In my code, I'm delegating to Playwright a request to install a browser, if necessary. Playwright makes this confusingly hard to do -- there's no easy method to call. They do provide a main method which they expect you to call on the command line, but I found a way to call it from code directly inside Gradle instead, which was nice!
Of course, it exits. :scream:
This, why I was using the SecurityManager.
Now that the Java team is deciding to deprecate the SecurityManager, it sounds like figuring out how to handle preventing exists is an important thing for the Java devs to figure out, according to the JEP linked above.
However, I don't get the best feeling that I should wait for it, because...
1) it seems like some users are getting exceptions now?? (I still don't know why this was an exception and not a warning) 2) I imagine any new APIs introduced to fix this issue (as they're considering) will require using a brand-spanking new JDK, but so far, a goal of Kobweb has been to allow its code to run on older JDKs if possible, currently floored at JDK11. Jumping up to JDK 20 just for this sort of issue doesn't seem worth it.
I found an ugly workaround for now (just fork the Playwright code in my own codebase, it's not too many lines). It seems to be working fine.
Probably a technically better way would be to spawn a new process (via ProcessBuilder) if I can set up the classpath correctly, but initial attempts to accomplish this failed so I postponed this for now.
When running kobwebExport task, on latest Java version, the task failed with
UnsupportedOperationException