2014-07-18 228 views
0

哪個JAR包含org.jboss.netty.channel.socket.nio?我是而不是使用maven或常春藤,只是螞蟻(從netbeans)。錯誤:包org.jboss.netty.channel.socket.nio不存在

螞蟻編譯給出:

-do-compile: 
    [javac] Compiling 4 source files to /home/thufir/NetBeansProjects/EchoClient/build/classes 
    [javac] /home/thufir/NetBeansProjects/EchoClient/src/net/bounceme/dur/netty/client/ObjectEchoClient.java:3: error: package org.jboss.netty.channel.socket.nio does not exist 
    [javac] import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory; 

在類路徑是:

[email protected]:~/NetBeansProjects/EchoClient/nbproject$ 
[email protected]:~/NetBeansProjects/EchoClient/nbproject$ head -n 58 project.properties | tail -n 29 
endorsed.classpath= 
excludes= 
file.reference.netty-all-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final-sources.jar 
file.reference.netty-all-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final.jar 
file.reference.netty-buffer-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final-sources.jar 
file.reference.netty-buffer-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final.jar 
file.reference.netty-codec-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final-sources.jar 
file.reference.netty-codec-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final.jar 
file.reference.netty-codec-http-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final-sources.jar 
file.reference.netty-codec-http-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final.jar 
file.reference.netty-codec-socks-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final-sources.jar 
file.reference.netty-codec-socks-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final.jar 
file.reference.netty-common-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final-sources.jar 
file.reference.netty-common-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final.jar 
file.reference.netty-example-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final-sources.jar 
file.reference.netty-example-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final.jar 
file.reference.netty-handler-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final-sources.jar 
file.reference.netty-handler-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final.jar 
file.reference.netty-tcnative-1.1.30.Fork2-linux-x86_64.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-linux-x86_64.jar 
file.reference.netty-tcnative-1.1.30.Fork2-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-sources.jar 
file.reference.netty-transport-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final-sources.jar 
file.reference.netty-transport-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final.jar 
file.reference.netty-transport-rxtx-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final-sources.jar 
file.reference.netty-transport-rxtx-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final.jar 
file.reference.netty-transport-sctp-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final-sources.jar 
file.reference.netty-transport-sctp-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final.jar 
file.reference.netty-transport-udt-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final-sources.jar 
file.reference.netty-transport-udt-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final.jar 
includes=** 
[email protected]:~/NetBeansProjects/EchoClient/nbproject$ 

這是一個從下載:

http://netty.io/downloads.html

網狀,4.0.21.Final.tar .bz2

我將該下載的每個JAR添加到項目中。是的,我意識到它沒有使用CLI javac classpath,但JAR在項目中以及在上面的輸出中都是可見的。

我翻看了一些JAR文件,無法找到這個特定的類。

回答

2

您似乎在嘗試使用netty 4.0構建針對netty 3.x開發的應用程序。已有API changes,包括頻道創建和引導。此外,軟件包前綴已從org.jboss.netty更改爲反映項目狀態更改的io.netty。

使用API documentation(不再記錄NioClientSocketChannelFactory)與您正在使用的版本相對應,並檢出提供的示例(netty-example-4.0.21.Final-sources.jar)以幫助移植您擁有的任何代碼針對netty 3.x構建。

+0

謎解決了!示例代碼來自netty的github存儲庫。明天我會在接受答案之前仔細研究一下,以確保我明白髮生了什麼。 – Thufir