Getting exception in simple JXTA 2.7 Application

和自甴很熟 提交于 2019-12-12 04:57:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!