gpt4 book ai didi

java - 在简单的 JXTA 2.7 应用程序中获取异常

转载 作者:行者123 更新时间:2023-12-01 15:31:29 24 4
gpt4 key购买 nike

我正在 JXTA 2.7 中开发一个简单的程序,它向我显示以下错误。

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)。请大家帮帮我。

最佳答案

您需要将 netty 包含到您的类路径中。您可以从 netty.io 网站获取它。

关于java - 在简单的 JXTA 2.7 应用程序中获取异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9479671/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com