当前位置: 首页 > 知识库问答 >
问题:

Netty 代理服务器引发的异常异常

吕征
2023-03-14

我正在将本地netty服务器连接到远程https服务器以代理请求。

public class CustomInitializer extends ChannelInitializer<SocketChannel> {

    @Autowired(required = false)
    private SslContext sslContext;


    @Override
    public void initChannel(SocketChannel ch) {
        ChannelPipeline p = ch.pipeline();
        if (sslContext != null) {
            p.addLast(sslContext.newHandler(ch.alloc()));
        }
        p.addLast(new LoggingHandler(LogLevel.INFO));
        p.addLast(new HttpClientCodec());
        p.addLast(new HttpObjectAggregator(8*1024, true));
        p.addLast(new MyCustomHandler());
    }
}

下面是我如何创建ssLcontext bean

@Bean
    public SslContext sslContext(@Value("${tcp.ssl}") boolean ssl) throws SSLException, CertificateException {
        SslContext sslContext = null;
        if (ssl) {
            SelfSignedCertificate ssc = new SelfSignedCertificate();
            sslContext = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).build();
        }
        return sslContext;
    }

当我点击我的本地主机时,它应该代理到后端。我得到以下异常。但是,如果SSL关闭并且我连接到远程,这是在不同端口上运行的本地服务器,则工作正常

io.netty.handler.codec.DecoderException: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: dsffddfs
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:547)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:501)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)
io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: thjhjhhj     at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1178)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:547)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:501)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)
io.netty.handler.codec.DecoderException: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: tyuuiiio
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:547)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:501)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 678900
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1178)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1243)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
    ... 16 more

编辑

添加的日志

X`20190423173352.427``40`````io.netty.handler.logging.LoggingHandler```````eE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xc839c47e, L:/0:0:0:0:0:0:0:0:8080] READ: [id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170]
X`20190423173352.427``40`````io.netty.handler.logging.LoggingHandler```````fE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xc839c47e, L:/0:0:0:0:0:0:0:0:8080] READ COMPLETE
X`20190423173352.428``40`````io.netty.handler.logging.LoggingHandler```````gE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xc839c47e, L:/0:0:0:0:0:0:0:0:8080] READ: [id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171]
X`20190423173352.428``76`````io.netty.handler.logging.LoggingHandler```````hE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170] REGISTERED
X`20190423173352.428``40`````io.netty.handler.logging.LoggingHandler```````iE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xc839c47e, L:/0:0:0:0:0:0:0:0:8080] READ COMPLETE
X`20190423173352.428``76`````io.netty.handler.logging.LoggingHandler```````jE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170] ACTIVE
X`20190423173352.429``77`````io.netty.handler.logging.LoggingHandler```````kE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] REGISTERED
X`20190423173352.429``77`````io.netty.handler.logging.LoggingHandler```````lE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] ACTIVE
X`20190423173352.442``76`````io.netty.handler.logging.LoggingHandler```````mE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170] READ COMPLETE
X`20190423173352.442``77`````io.netty.handler.logging.LoggingHandler```````nE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ: 294B

X`20190423173352.442``76`````io.netty.handler.logging.LoggingHandler```````oE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170] WRITE: 0B
X`20190423173352.442``76`````io.netty.handler.logging.LoggingHandler```````pE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56170] FLUSH
X`20190423173352.443``76`````io.netty.handler.logging.LoggingHandler```````qE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56170] INACTIVE
X`20190423173352.443``76`````io.netty.handler.logging.LoggingHandler```````rE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56170] FLUSH
X`20190423173352.443``76`````io.netty.handler.logging.LoggingHandler```````sE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56170] CLOSE
X`20190423173352.443``76`````io.netty.handler.logging.LoggingHandler```````tE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0xca2cb8c7, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56170] UNREGISTERED
X`20190423173352.450``77`````io.netty.handler.logging.LoggingHandler```````uE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 734B
X`20190423173352.452``77`````io.netty.handler.logging.LoggingHandler```````vE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ COMPLETE
X`20190423173352.452``77`````io.netty.handler.logging.LoggingHandler```````wE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173352.452``77`````io.netty.handler.logging.LoggingHandler```````xE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.452``77`````io.netty.handler.logging.LoggingHandler```````yE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173352.453``77`````io.netty.handler.logging.LoggingHandler```````zE````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ: 126B
X`20190423173352.456``77`````io.netty.handler.logging.LoggingHandler```````0E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 6B
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````1E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 45B
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````2E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````3E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ COMPLETE
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````4E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````5E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````6E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.457``77`````io.netty.handler.logging.LoggingHandler```````7E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173352.458``77`````io.netty.handler.logging.LoggingHandler```````8E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ: 512B
X`20190423173352.458``77`````io.netty.handler.logging.LoggingHandler```````9E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ: 87B
X`20190423173352.460``77`````io.netty.handler.logging.LoggingHandler```````-E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8] REGISTERED
X`20190423173352.460``77`````io.netty.handler.logging.LoggingHandler```````_E````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] READ COMPLETE
X`20190423173352.460``77`````io.netty.handler.logging.LoggingHandler```````AF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.461``77`````io.netty.handler.logging.LoggingHandler```````BF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 0B
X`20190423173352.461``77`````io.netty.handler.logging.LoggingHandler```````CF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173352.461``77`````io.netty.handler.logging.LoggingHandler```````DF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8] CONNECT: dom.fbde.lol.hepd.com/122.126.80.1:443
X`20190423173352.483``77`````io.netty.handler.logging.LoggingHandler```````EF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 - R:dom.fbde.lol.hepd.com/122.126.80.1:443] WRITE: 0B
X`20190423173352.484``77`````io.netty.handler.logging.LoggingHandler```````FF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 - R:dom.fbde.lol.hepd.com/122.126.80.1:443] FLUSH
X`20190423173352.484``77`````io.netty.handler.logging.LoggingHandler```````GF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 - R:dom.fbde.lol.hepd.com/122.126.80.1:443] ACTIVE
X`20190423173402.488``77`````io.netty.handler.logging.LoggingHandler```````HF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 - R:dom.fbde.lol.hepd.com/122.126.80.1:443] FLUSH
X`20190423173402.488``77`````io.netty.handler.logging.LoggingHandler```````IF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 - R:dom.fbde.lol.hepd.com/122.126.80.1:443] CLOSE
X`20190423173402.489``77`````io.netty.handler.logging.LoggingHandler```````JF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] WRITE: 31B
X`20190423173402.489``77`````io.netty.handler.logging.LoggingHandler```````KF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] FLUSH
X`20190423173402.490``77`````io.netty.handler.logging.LoggingHandler```````LF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 - R:/0:0:0:0:0:0:0:1:56171] CLOSE
X`20190423173402.490``77`````io.netty.handler.logging.LoggingHandler```````MF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 ! R:dom.fbde.lol.hepd.com/122.126.80.1:443] CLOSE
X`20190423173402.490``77`````io.netty.handler.logging.LoggingHandler```````NF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 ! R:dom.fbde.lol.hepd.com/122.126.80.1:443] INACTIVE
X`20190423173402.490``77`````io.netty.handler.logging.LoggingHandler```````OF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x8c3b87f8, L:/10.3.49.27:56172 ! R:dom.fbde.lol.hepd.com/122.126.80.1:443] UNREGISTERED
X`20190423173402.490``77`````io.netty.handler.logging.LoggingHandler```````PF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56171] INACTIVE
X`20190423173402.491``77`````io.netty.handler.logging.LoggingHandler```````QF````INFO`io.netty.handler.logging.LoggingHandler`[id: 0x08537ac8, L:/0:0:0:0:0:0:0:1:8080 ! R:/0:0:0:0:0:0:0:1:56171] UNREGISTERED

共有1个答案

卫仲卿
2023-03-14

当您收到NotSslRecordException异常时,您最好的起点是错误之后的随机字节blob。

您的“blob”以以下字节开始:504f5354…

将十六进制数据转换回字符串后,您会得到< code>50 = P,< code>4f = O,< code>53 = S,< code>54 = T,最终结果:< code>POST

由于我们现在将二进制 blob 的开头转换为 String,因此我们现在需要弄清楚哪些协议使用这些“魔术字符串”。我们不必寻找它,这是一个HTTP请求,你不能使用HTTPS来接收它。

解决方案很简单,使用https连接到服务器,而不是http:

https://localhost:8080/

 类似资料:
  • 我正在处理一个Spring启动应用程序。我尝试处理异常。但我想我这样做的方式有问题,因为它总是抛出内部服务器错误500。 我尝试设置自定义异常类,并且还使用带有@响应状态的响应状态代码。但是不管异常是什么,它只会抛出内部服务器错误。我使用的是intellij,我在异常中给出的消息打印在那里,但响应正文empty.This我想一定是因为它抛出了内部服务器错误。 控制器类 intellij 中的终端打

  • 我已经阅读了netty代理服务器示例。但是,我想知道如何实现一个与代理对话的客户端。我正在实现的解决方案是服务器,每当客户端连接到服务器时,它都需要连接到套接字服务器。因此,连接到服务器的每个客户端都能够从另一台服务器发送/接收数据。 我需要帮助用netty实现这样的体系结构,因为服务器端是在netty上构建的。

  • 我的应用程序有许多RPC调用,它们都有一个.onFailure(可抛出捕获)方法。我有一个在客户端和服务器代码之间共享的类 不记录在例外中。如果用户没有基于会话/cookie/权限等的相关权限,则由服务器抛出。 理想情况下,我希望在将其他异常传递给.onFailure()代码之前,在一个地方处理此异常,因为此处理是如此普遍,而且出于安全考虑,需要如此。有一个GWT。setUncaughtExcep

  • 我正在尝试分析Oracle数据库中的Java存储过程。我的用户已被授予角色,但当我运行

  • 你可以使用raise语句 引发 异常。你还得指明错误/异常的名称和伴随异常 触发的 异常对象。你可以引发的错误或异常应该分别是一个Error或Exception类的直接或间接导出类。 如何引发异常 例13.2 如何引发异常 #!/usr/bin/python # Filename: raising.py classShortInputException(Exception):     '''A u

  • 我有一个rest服务,它将抛出一个异常,我想知道什么将是最好的方式来处理这一点。 我想知道这是rest服务中处理异常的正确方式吗? 我在用泽西。