我有Jboss 7服务器,SSL已启用远程连接和JNDI属性,如下所示
java.naming.security.principal=admin, server=10.10.10.10
java.naming.security.credentials=1111
java.naming.provider.url=remote://10.10.10.10:4447
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=true
jboss.naming.client.connect.options.org.xnio.Options.SSL_STARTTLS=true
如果客户端和服务器具有相同的IP,则查找成功。但是,如果我尝试从其他服务器循环,客户端和服务器不一样,它就不会失败。
我尝试启用SSL的调试日志并看到一些例外:
!ENTRY com.test.my.client.fwk 0 0 2014-11-21 15:04:49.648
!MESSAGE (Timezone is ICT.) ;6340; org.jboss.naming.remote.client.HaRemoteNamingStore logged : "Failed to connect to server remote://192.168.95.111:4447:
java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:193)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:144)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:125)
at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:241)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
!MESSAGE (Timezone is ICT.) ;6340; org.jboss.remoting.remote.client logged : "Client authentication failed for mechanism JBOSS-LOCAL-USER: javax.security.sasl.SaslException: Failed to read server challenge [Caused by java.io.FileNotFoundException: \var\opt\ams\local \tmp\auth\local3549659832926743393.challenge (The system cannot find the path specified)]"
!ENTRY com.test.my.client.fwk 0 0 2014-11-21 15:04:50.497
!MESSAGE (Timezone is ICT.) ;6340; org.jboss.remoting.remote.connection logged : "Connection error detail:
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at org.xnio.nio.AbstractNioStreamChannel.read(AbstractNioStreamChannel.java:249)
at org.xnio.ssl.JsseConnectedSslStreamChannel.handleUnwrapResult(JsseConnectedSslStreamChannel.java:526)
at org.xnio.ssl.JsseConnectedSslStreamChannel.handleHandshake(JsseConnectedSslStreamChannel.java:396)
at org.xnio.ssl.JsseConnectedSslStreamChannel.doFlush(JsseConnectedSslStreamChannel.java:638)
at org.xnio.ssl.JsseConnectedSslStreamChannel.flushAction(JsseConnectedSslStreamChannel.java:613)
at org.xnio.channels.TranslatingSuspendableChannel.flush(TranslatingSuspendableChannel.java:604)
at org.xnio.channels.FramedMessageChannel.flushAction(FramedMessageChannel.java:275)
at org.xnio.channels.TranslatingSuspendableChannel.flush(TranslatingSuspendableChannel.java:604)
at org.jboss.remoting3.remote.RemoteConnection$RemoteWriteListener.send(RemoteConnection.java:306)
at org.jboss.remoting3.remote.RemoteConnection.send(RemoteConnection.java:124)
at org.jboss.remoting3.remote.RemoteConnectionHandler.sendCloseRequestBody(RemoteConnectionHandler.java:286)
at org.jboss.remoting3.remote.RemoteConnectionProvider$3$1.cancel(RemoteConnectionProvider.java:177)
at org.xnio.AbstractIoFuture.cancel(AbstractIoFuture.java:306)
at org.xnio.AbstractIoFuture.cancel(AbstractIoFuture.java:39)
at org.jboss.remoting3.remote.RemoteConnectionProvider.closeAction(RemoteConnectionProvider.java:236)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.remoting3.EndpointImpl.closeAction(EndpointImpl.java:204)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.naming.remote.client.EndpointCache.release(EndpointCache.java:58)
at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.closeAsync(EndpointCache.java:189)
at org.jboss.naming.remote.client.InitialContextFactory$1.close(InitialContextFactory.java:231)
at org.jboss.naming.remote.client.RemoteContext.finalize(RemoteContext.java:199)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:101)
at java.lang.ref.Finalizer.access$100(Finalizer.java:32)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:190)"
!ENTRY com.test.my.client.fwk 0 0 2014-11-21 15:04:50.498
!MESSAGE (Timezone is ICT.) ;6340; org.xnio.safe-close logged : "Closing resource org.xnio.channels.FramedMessageChannel around org.xnio.ssl.JsseConnectedSslStreamChannel around TCP socket channel (NIO) <139ba40>"