本文介绍了在简单的JXTA 2.7应用程序中获取异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在用JXTA 2.7开发一个简单的程序,它向我显示了以下错误.
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 ");
}
错误:
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
......
我无法弄清楚这里出了什么问题.我已经下载了 jetty 缺少的库,并将其输入到库路径(netbeans 7.0.1)中. .有人请帮帮我.
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.
推荐答案
您需要将netty包含在类路径中.您可以从netty.io网站上获得它.
You need to include netty into your classpath. You can get it from netty.io website.
这篇关于在简单的JXTA 2.7应用程序中获取异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!