问题
I am developing a simple program in JXTA 2.7 and it is showing me the following error.
public static void main(String[] args) throws IOException, PeerGroupException {
System.setProperty(Logging.JXTA_LOGGING_PROPERTY, Level.OFF.toString());
NetworkManager manager = new NetworkManager(NetworkManager.ConfigMode.EDGE, "Test");
System.out.println(" S t a r t ing JXTA");
manager.startNetwork();
System.out.println(" JXTA St a r t ed ");
}
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/socket/httptunnel/HttpTunnelClientChannelFactory
at net.jxta.impl.endpoint.netty.http.NettyHttpTunnelTransport.createClientSocketChannelFactory(NettyHttpTunnelTransport.java:27)
at net.jxta.impl.endpoint.netty.NettyTransport.initClient(NettyTransport.java:124)
at net.jxta.impl.endpoint.netty.NettyTransport.init(NettyTransport.java:76)
at net.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:677)
at net.jxta.impl.peergroup.GenericPeerGroup.loadModule(GenericPeerGroup.java:801)
at net.jxta.impl.peergroup.StdPeerGroup.loadAllModules(StdPeerGroup.java:295)
at net.jxta.impl.peergroup.StdPeerGroup.initFirst(StdPeerGroup.java:842)
at net.jxta.impl.peergroup.Platform.initFirst(Platform.java:214)
at net.jxta.impl.peergroup.GenericPeerGroup.init(GenericPeerGroup.java:907)
at net.jxta.peergroup.WorldPeerGroupFactory.newWorldPeerGroup(WorldPeerGroupFactory.java:312)
at net.jxta.peergroup.WorldPeerGroupFactory.<init>(WorldPeerGroupFactory.java:182)
at net.jxta.peergroup.NetPeerGroupFactory.<init>(NetPeerGroupFactory.java:203)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:408)
at jxta_my.JXTA_My.main(JXTA_My.java:36)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.socket.httptunnel.HttpTunnelClientChannelFactory
......
I am not able to figure out what is going wrong here. I have downloaded the missing libraries jetty and has given it into the library path(netbeans 7.0.1). Anyone please help me out.
回答1:
You need to include netty into your classpath. You can get it from netty.io website.
来源:https://stackoverflow.com/questions/9479671/getting-exception-in-simple-jxta-2-7-application