2012-05-31 113 views
0

在無根Android 4.0.1星系Nexus上使用Netty 3.5.6。嘗試在設備上運行Netty服務器。我有我的清單。無法在Android 4.0設備上啓動Netty服務器

Server綁定代碼:

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) 

通過#1閱讀它聽起來像第一個是固定的:Netty 3.4.1.Final does not work on Android

第二個問題很可能是權限問題,但我無法推斷出我缺少的權限。

有什麼建議嗎?

+0

我在我的清單文件中使用Internet權限 – jet

+0

問題的部分答案。端口544已被另一個進程綁定。仍然在尋找類的幫助找不到問題 – jet

+0

「在unrooted Android上使用Netty 3.5.6 ...」 - 我猜你的意思是Netty 3.4.6。最新的Netty 3.5仍然是Beta1。 –

回答

0

我在同樣的問題,因爲你在這裏找到了部分解決方案: 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. 

這是一個朝着使它工作的方向,但我不確定如何繼續,如果任何人有拼圖上的下一件將不勝感激。