Applet + Netty 4.0 ExceptionInInitializerError

时间:2012-10-21 16:43:08

标签: java applet netty

我使用了Netty 3.8.5库并且工作正常。但是当我在4.0.0版本中更改库时,applet已停止工作。 错误日志:

network: Cache entry not found [url: file:/D:/java/Сlient/dist/lib/netty-common-4.0.0.Alpha5.jar, version: null]
network: Cache entry not found [url: file:/D:/java/Сlient/dist/lib/netty-common-4.0.0.Alpha5.jar, version: null]
security: Validate the certificate chain using CertPath API
security: The certificate hasnt been expired, no need to check timestamping info
security: Found jurisdiction list file
security: No need to checking trusted extension for this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/D:/java/Сlient/dist/lib/netty-common-4.0.0.Alpha5.jar, version: null]
basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
network: Cache entry not found [url: file:/D:/java/Сlient/dist/lib/netty-buffer-4.0.0.Alpha5.jar, version: null]
security: Validate the certificate chain using CertPath API
security: The certificate hasnt been expired, no need to check timestamping info
security: Found jurisdiction list file
security: No need to checking trusted extension for this certificate
security: The CRL support is disabled
security: The OCSP support is disabled
security: This OCSP End Entity validation is disabled
security: Checking if certificate is in Deployment denied certificate store
security: Checking if certificate is in Deployment permanent certificate store
network: Cache entry not found [url: file:/D:/java/Сlient/dist/lib/netty-buffer-4.0.0.Alpha5.jar, version: null]
basic: Plugin2ClassLoader.getPermissions CeilingPolicy allPerms
java.lang.ExceptionInInitializerError
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:457)
    at io.netty.channel.DefaultChannelPipeline$HeadHandler.bind(DefaultChannelPipeline.java:1538)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1126)
    at io.netty.channel.DefaultChannelPipeline$10.run(DefaultChannelPipeline.java:1134)
    at io.netty.channel.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:186)
    at io.netty.channel.socket.nio.NioEventLoop.run(NioEventLoop.java:210)
    at io.netty.channel.SingleThreadEventExecutor$1.run(SingleThreadEventExecutor.java:80)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at io.netty.util.internal.DetectionUtil.<clinit>(DetectionUtil.java:43)
    ... 8 more
Ignored exception: java.lang.ExceptionInInitializerError
окт 21, 2012 8:09:56 PM io.netty.channel.DefaultChannelPipeline
WARNING: An exceptionCaught() event was fired, and it reached at the end of the pipeline.  It usually means the last inbound handler in the pipeline did not handle the exception.
java.lang.ExceptionInInitializerError
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:457)
    at io.netty.channel.DefaultChannelPipeline$HeadHandler.bind(DefaultChannelPipeline.java:1538)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1126)
    at io.netty.channel.DefaultChannelPipeline$10.run(DefaultChannelPipeline.java:1134)
    at io.netty.channel.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:186)
    at io.netty.channel.socket.nio.NioEventLoop.run(NioEventLoop.java:210)
    at io.netty.channel.SingleThreadEventExecutor$1.run(SingleThreadEventExecutor.java:80)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at io.netty.util.internal.DetectionUtil.<clinit>(DetectionUtil.java:43)
    ... 8 more

basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@147c327
security: Reset deny session certificate store

我使用DiscardServer https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/discard的示例而没有任何更改。

此行会导致错误:

ChannelFuture f = b.bind().sync();

所有文件都已签名。当我单独运行DiscardServer(而不是在applet中)时,一切正常

我的代码:

public class Applet extends JApplet
{
        @Override
    public void init()
    {   
            try {
                new DiscardServer(1020).run();
            } catch (Exception ex) {
                Logger.getLogger(Applet.class.getName()).log(Level.SEVERE, null, ex);
            }
    }
}

DiscardServer:https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/discard

1 个答案:

答案 0 :(得分:0)

我认为这是我刚刚修复的一个错误...你能尝试使用快照[1],让我知道它是否有效。这是问题[2]。

[1] https://oss.sonatype.org/content/repositories/snapshots/io/netty/netty/4.0.0.Alpha6-SNAPSHOT/

[2] https://github.com/netty/netty/issues/669