为什么无法远程访问glassfish管理控制台?

时间:2018-05-16 15:04:01

标签: ssl https glassfish virtual-machine virtualbox

我在虚拟盒子里有一个带Centos7的虚拟机。我从这里安装了glassfish 5.0:Full platform - glassfish 5.0。我只是解压缩/ opt中的文件夹。我正在使用“仅限主机”。

以下是我的java版本:

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

我使用以下命令启用了安全管理员:

asadmin --host localhost --port 4848 enable-secure-admin

我进入vm shell并用数字“ifconfig”来知道ip。 然后,我进入我的Windows主机的电源shell(win + x)并输入,通过ssh连接:

ssh user@x.x.x.x

然后:

cd /opt/glassfish5/bin
./asadmin start-domain domain1

然后我回到主持人那里,打开谷歌浏览器并点击:

  1. http://x.x.x.x:8080似乎很好
  2. http://x.x.x.x:4848强制使用https,然后浏览器告诉我无法访问该网站
  3. 我试图卸载安全管理员(至少在glassfish之前给了我一个例外,其中说DAS或类似的东西需要安全管理员):

    ./asadmin --host localhost --port 4848 disable-secure-admin
    

    但我得到以下例外:

    NCLS-ADMIN-00010
    javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    Command disable-secure-admin failed.
    

    调用管理控制台后,我的日志中出现以下异常:

    [2018-05-16T16:35:59.644+0200] [glassfish 5.0] [WARNING] [] [org.glassfish.grizzly.filterchain.DefaultFilterChain] [tid: _ThreadID=42 _ThreadName=admin-listener(3)] [timeMillis: 1526481359644] [levelValue: 900] [[
      GRIZZLY0013: Exception during FilterChain execution
    java.lang.NoClassDefFoundError: sun/security/ssl/SupportedEllipticCurvesExtension
            at sun.security.ssl.HelloExtensions.<init>(HelloExtensions.java:82)
            at sun.security.ssl.HandshakeMessage$ClientHello.<init>(HandshakeMessage.java:362)
            at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:223)
            at sun.security.ssl.Handshaker.processLoop(Handshaker.java:984)
            at sun.security.ssl.Handshaker$1.run(Handshaker.java:924)
            at sun.security.ssl.Handshaker$1.run(Handshaker.java:921)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1379)
            at org.glassfish.grizzly.ssl.SSLUtils.executeDelegatedTask(SSLUtils.java:274)
            at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:708)
            at org.glassfish.grizzly.ssl.SSLBaseFilter.doHandshakeStep(SSLBaseFilter.java:622)
            at org.glassfish.grizzly.ssl.SSLBaseFilter.handleRead(SSLBaseFilter.java:334)
            at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
            at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
            at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)
            at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
            at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
            at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
            at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)
            at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
            at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
            at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
            at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
            at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)
            at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
            at java.lang.Thread.run(Thread.java:748)
    ]]
    

1 个答案:

答案 0 :(得分:3)

答案是您的Java版本对于GlassFish来说太新了。我已在此处回答:https://stackoverflow.com/a/49998266/212224

答案被低估了,但答案是正确的。要停止java.lang.NoClassDefFoundError,您需要使用不高于 8u151

的Java版本
  

这是由于Grizzly用于内部JDK类的更改   HTTP / 2。

     

GlassFish 5.0 拥有最新版本的Grizzly   兼容最新的Java 8更新。如果您使用的是GlassFish   5.0并看到这些错误,你有两个选择:

     
      
  1. 将Java降级为 8u152 或更早
  2.   
  3. Download the latest GlassFish 5.0.1 nightly,应该修复此问题
  4.         

    价:   https://github.com/javaee/glassfish/issues/22436#issuecomment-374829430