在 MacOS Big Sur (11.4)、最新的 OLP (10.0.9) 和最新的 Java (16.0.1) 下,使用“olp 目录列表”在 akka 中遇到错误。如果切换到 Java 8,同样的命令也可以工作,但这不是重点。根据用户指南 Java 16 应该没问题:
OLP CLI 需要 Java 运行时环境 (JRE) 版本 1.8.0_91 或更高版本。
错误:
$ java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
$ olp version show
Version: 10.0.9(727ba090)
$ olp api token get
Token: <XXX>
Token Expires at: 2021-07-03T03:01:21.455Z
$ olp catalog list --profile default
Uncaught error from thread [olp-akka.actor.default-dispatcher-3]: class com.typesafe.sslconfig.ssl.DefaultHostnameVerifier (in unnamed module @0x71e7a66b) cannot access class sun.security.util.HostnameChecker (in module java.base) because module java.base does not export sun.security.util to unnamed module @0x71e7a66b, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[olp]
java.lang.IllegalAccessError: class com.typesafe.sslconfig.ssl.DefaultHostnameVerifier (in unnamed module @0x71e7a66b) cannot access class sun.security.util.HostnameChecker (in module java.base) because module java.base does not export sun.security.util to unnamed module @0x71e7a66b
at com.typesafe.sslconfig.ssl.DefaultHostnameVerifier.hostnameChecker(DefaultHostnameVerifier.scala:38)
at com.typesafe.sslconfig.ssl.DefaultHostnameVerifier.matchCertificates(DefaultHostnameVerifier.scala:77)
at com.typesafe.sslconfig.ssl.DefaultHostnameVerifier.verify(DefaultHostnameVerifier.scala:51)
at akka.stream.scaladsl.TLS$.$anonfun$apply$3(TLS.scala:116)
at akka.stream.impl.io.TLSActor.handshakeFinished(TLSActor.scala:436)
at akka.stream.impl.io.TLSActor.doUnwrap(TLSActor.scala:399)
at akka.stream.impl.io.TLSActor.doInbound(TLSActor.scala:295)
at akka.stream.impl.io.TLSActor.$anonfun$bidirectional$1(TLSActor.scala:230)
at akka.stream.impl.Pump.pump(Transfer.scala:202)
at akka.stream.impl.Pump.pump$(Transfer.scala:200)
at akka.stream.impl.io.TLSActor.pump(TLSActor.scala:50)
at akka.stream.impl.BatchingInputBuffer.enqueueInputElement(ActorProcessor.scala:96)
at akka.stream.impl.BatchingInputBuffer$$anonfun$upstreamRunning$1.applyOrElse(ActorProcessor.scala:147)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
at akka.stream.impl.SubReceive.apply(Transfer.scala:18)
at akka.stream.impl.FanIn$InputBunch$$anonfun$subreceive$1.applyOrElse(FanIn.scala:242)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
at akka.stream.impl.SubReceive.apply(Transfer.scala:18)
at akka.stream.impl.SubReceive.apply(Transfer.scala:14)
at scala.PartialFunction.applyOrElse(PartialFunction.scala:127)
at scala.PartialFunction.applyOrElse$(PartialFunction.scala:126)
at akka.stream.impl.SubReceive.applyOrElse(Transfer.scala:14)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:175)
at akka.actor.Actor.aroundReceive(Actor.scala:539)
at akka.actor.Actor.aroundReceive$(Actor.scala:537)
at akka.stream.impl.io.TLSActor.aroundReceive(TLSActor.scala:50)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:614)
at akka.actor.ActorCell.invoke(ActorCell.scala:583)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:268)
at akka.dispatch.Mailbox.run(Mailbox.scala:229)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)