【问题标题】:Unable to launch Netty server on Android 4.0 device无法在 Android 4.0 设备上启动 Netty 服务器
【发布时间】:2012-06-26 16:09:49
【问题描述】:

在无根的 Android 4.0.1 Galaxy Nexus 上使用 Netty 3.5.6。尝试在设备上运行 Netty 服务器。我的清单中有。

服务器绑定代码:

rtspSA= new InetSocketAddress(InetAddress.getLocalHost(),544);
Channel rtspChannel = bootstrap.bind(rtspSA);
allChannels.add(rtspChannel);

我收到两个错误:

E/dalvikvm( 8884): Could not find class 'java.util.concurrent.LinkedTransferQueue', referenced from method org.jboss.netty.util.intenal.QueueFactory.createQueue

E/NettyServer( 8884): org.jboss.netty.channel.ChannelException: Failed to bind to: localhost/127.0.0.1:544
E/NettyServer( 8884): Caused by: java.net.BindException: bind failed: EACCES (Permission denied)

通过 Stackoverflow 阅读,听起来第一个是固定的:Netty 3.4.1.Final does not work on Android

第二个问题可能是权限问题,但我无法推断出我缺少哪个权限。

有什么建议吗?

【问题讨论】:

  • 我的清单文件中有使用互联网权限
  • 对问题的部分回答。端口 544 已被另一个进程绑定。仍在寻找关于类未发现问题的帮助
  • “在无根的 Android 上使用 Netty 3.5.6...”

标签: android netty


【解决方案1】:

我和你遇到同样的问题,在这里找到了部分解决方案: https://github.com/netty/netty/issues/272

关于这部分的一些事情:

You can now disable it via a system property.
3.x:
-Dorg.jboss.netty.tryUnsafe=false    
4.x
-Dio.netty.tryUnsafe=false
By default it will try to use Unsafe.

我参与了

    System.setproperty(new property(" _ but I'm not sure what goes in here _"))

在我的代码上,但我仍然不确定它是否正常工作,可能是错误的字符串或与:

It also can help if you have a custom ClassLoader in place or try to run in a non oracle/sun jdk.

这是让它发挥作用的一个方向,但我不确定如何继续,如果有人有下一块拼图将不胜感激。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-19
    • 2017-08-01
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    • 2016-03-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多