0

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.

ATR
  • 2,160
  • 4
  • 22
  • 43
  • Did the answer below help, @ankur-trapasiya? – halfer Mar 01 '12 at 19:23
  • Actually i downloaded the netty from the given website and included it in library. Even i also put them in ext/lib folder of my jdk. But still it is showing me the same error. – ATR Mar 01 '12 at 19:51
  • 1
    OK, well add a comment after Norman's answer - otherwise he won't be pinged that you've commented. – halfer Mar 01 '12 at 19:54

1 Answers1

1

You need to include netty into your classpath. You can get it from netty.io website.

Norman Maurer
  • 23,104
  • 2
  • 33
  • 31
  • I have done as you said but still it is not working. i have included the jar file in libraries(netbeans). – ATR Mar 01 '12 at 20:27
  • What version of Netty are you using? See [here](http://stackoverflow.com/questions/9482029/jxta-practical-jxta-ii-examples-exception-when-netmanager-startnetwork-is/9485309#9485309) – halfer Mar 01 '12 at 22:16
  • I am the one who released JXTA 2.6 and 2.7. And yes, you need to have the proper version of Netty in your class path. We delivered a temporary one in the jar dependencies, because the code was not already included in Netty's final release. But things should be cleared by now. – Jérôme Verstrynge Mar 11 '12 at 00:16
  • @JVerstry : That problem got solved. I want to send a message from one peer to another peer. I am not getting any simple exact example for that. From many days i am reading just documents of JXTA. Can you give any link to such a simple example where one peer in network sends a simple hello message to another peer in the same network using jxta 2.7/2.6 ? – ATR Mar 12 '12 at 15:03