You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by Bertrand Rigaldies <br...@gmail.com> on 2022/07/24 15:23:05 UTC

Unit tests in CLITest fail with openjdk 11+

Hi, I just joined the dev mailing list, and therefore my apology if this is the wrong place to report the following issue: With openjdk (installed with “brew install openjdk@11” on a macOS Monterey 12.2.1; same is true with openjdk 18), the unit tests in CLITest fail with the following error (see also the attached screen shot):

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:416)
	at opennlp.tools.cmdline.CLITest.installNoExitSecurityManager(CLITest.java:66)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Since the The Security Manager is deprecated (see https://openjdk.org/jeps/411), should the unit tests be re-written without the security manager or with alternatives) ?

This issue currently fails my mvn clean install on my setup. I have not tried yet with other jdks (AdoptOpenJdk, OracleJdk).

Thank you.
Bertrand Rigaldies



Re: Unit tests in CLITest fail with openjdk 11+

Posted by Bertrand Rigaldies <br...@gmail.com>.
Hi Jeff, the issue was a pilot error on my part: the brew-installed Maven uses OpenJDK 18, even though I had switched my environment’s JDK to 11 with “Jenv”. Doing so had no effect on what version Maven is using. I now have to figure out to point Maven to OpenJDK 11. Will keep you posted.

Bertrand

> On Jul 27, 2022, at 5:08 PM, Jeff Zemerick <jz...@apache.org> wrote:
> 
> Hi Bertrand,
> 
> Thanks for reporting this. This is the right place!
> 
> Could you please open a JIRA ticket for it? In the ticket, could you please provide the output of the "mvn -v" command?
> 
> In version 2 we moved to Java 11 so I'm surprised to see the tests fail for it. I am not, however, surprised to see the failures for Java 17+. 
> 
> Thanks,
> Jeff
> 
> 
> On Sun, Jul 24, 2022 at 11:23 AM Bertrand Rigaldies <brigaldiesdev@gmail.com <ma...@gmail.com>> wrote:
> Hi, I just joined the dev mailing list, and therefore my apology if this is the wrong place to report the following issue: With openjdk (installed with “brew install openjdk@11” on a macOS Monterey 12.2.1; same is true with openjdk 18), the unit tests in CLITest fail with the following error (see also the attached screen shot):
> 
> 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:416)
> 	at opennlp.tools.cmdline.CLITest.installNoExitSecurityManager(CLITest.java:66)
> 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
> 	at org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> 	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
> 	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
> 	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
> 	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
> 	at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
> 	at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
> 	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
> 	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
> 	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
> 
> Since the The Security Manager is deprecated (see https://openjdk.org/jeps/411 <https://openjdk.org/jeps/411>), should the unit tests be re-written without the security manager or with alternatives) ?
> 
> This issue currently fails my mvn clean install on my setup. I have not tried yet with other jdks (AdoptOpenJdk, OracleJdk).
> 
> Thank you.
> Bertrand Rigaldies
> 
> 
> 


Re: Unit tests in CLITest fail with openjdk 11+

Posted by Jeff Zemerick <jz...@apache.org>.
Hi Bertrand,

Thanks for reporting this. This is the right place!

Could you please open a JIRA ticket for it? In the ticket, could you please
provide the output of the "mvn -v" command?

In version 2 we moved to Java 11 so I'm surprised to see the tests fail for
it. I am not, however, surprised to see the failures for Java 17+.

Thanks,
Jeff


On Sun, Jul 24, 2022 at 11:23 AM Bertrand Rigaldies <br...@gmail.com>
wrote:

> Hi, I just joined the dev mailing list, and therefore my apology if this
> is the wrong place to report the following issue: With openjdk (installed
> with “brew install openjdk@11” on a macOS Monterey 12.2.1; same is true
> with openjdk 18), the unit tests in CLITest fail with the following error
> (see also the attached screen shot):
>
> 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:416)
> at
> opennlp.tools.cmdline.CLITest.installNoExitSecurityManager(CLITest.java:66)
> at
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
> at
> org.junit.internal.runners.statements.RunBefores.invokeMethod(RunBefores.java:33)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
> at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
> at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
> at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
> at
> com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
> at
> com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
> at
> com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
> at
> com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
> at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
>
> Since the The Security Manager is deprecated (see
> https://openjdk.org/jeps/411), should the unit tests be
> re-written without the security manager or with alternatives) ?
>
> This issue currently fails my mvn clean install on my setup. I have not
> tried yet with other jdks (AdoptOpenJdk, OracleJdk).
>
> Thank you.
> Bertrand Rigaldies
>
>
>