class com.openpojo.random.generator.security.credentialsrandomgenerator无法访问类sun.security.krb5.credentials

o7jaxewo  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(504)

我正在进行junit测试,但在测试时出现以下错误:

java.lang.IllegalAccessError: class com.openpojo.random.generator.security.CredentialsRandomGenerator (in unnamed module @0x43bd930a) cannot access class sun.security.krb5.Credentials (in module java.security.jgss) because module java.security.jgss does not export sun.security.krb5 to unnamed module @0x43bd930a
    at com.openpojo.random.generator.security.CredentialsRandomGenerator.<clinit>(CredentialsRandomGenerator.java:39)
    at com.openpojo.registry.ServiceRegistrar.initializeRandomGeneratorService(ServiceRegistrar.java:94)
    at com.openpojo.registry.ServiceRegistrar.<init>(ServiceRegistrar.java:57)
    at com.openpojo.registry.ServiceRegistrar.<init>(ServiceRegistrar.java:49)
    at com.openpojo.registry.ServiceRegistrar$Instance.<clinit>(ServiceRegistrar.java:199)
    at com.openpojo.registry.ServiceRegistrar.getInstance(ServiceRegistrar.java:170)
    at com.openpojo.reflection.impl.PojoClassFactory.getPojoClasses(PojoClassFactory.java:66)
    at com.aig.rs.products.orchestrator.api.model.AllBeansTest.expectedNumberOfPojoClassesShouldBeDetected(AllBeansTest.java:62)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    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.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    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.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

是否存在某种兼容性问题或需要为此添加任何依赖项?
java版本详细信息:h:>java-版本openjdk版本“11.0.11”2021-04-20 openjdk运行时环境采用openjdk-11.0.11+9(构建11.0.11+9)openjdk 64位服务器vm采用openjdk-11.0.11+9(构建11.0.11+9,混合模式)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题