Skip to main content

[Newbie] HelloJXTA with exception[solved]

2 replies [Last post]
star03629
Offline
Joined: 2010-03-21
Points: 0

I am the very newbie with JXTA
Below is the HelloJXTA.java

========================================================
import java.io.InputStream;
import net.jxta.peergroup.PeerGroup;
import net.jxta.peergroup.PeerGroupFactory;
import net.jxta.exception.PeerGroupException;

public class HelloJXTA {

public static void main(String args[]) {
System.out.println ("Starting JXTA ....");
HelloJXTA myapp = new HelloJXTA();
myapp.startJXTA();
System.exit(0);
}

public void startJXTA() {

PeerGroup pg = null;
try {
pg = PeerGroupFactory.newNetPeerGroup();
}catch (PeerGroupException e) {
System.out.println("fatal error : group creation failure");
e.printStackTrace();
System.exit(1);
}

System.out.println("Hello JXTA! :)");
System.out.println (" Group name = " + pg.getPeerGroupName());
System.out.println (" Group ID = " + pg.getPeerGroupID().toString());
System.out.println (" Peer name = " + pg.getPeerName());
System.out.println (" Peer ID = " + pg.getPeerID().toString());
}
}

=================================================

I have passed the compilation safely
and came out the message

Starting JXTA ....

But When i run the HelloJXTA.class, and finished the configuration with the JXTA configurator, the error message as shown below

Loaded Security Providers into system class loader
java.lang.NoSuchMethodError: org.bouncycastle.jce.X509Principal.getEncoded()[B
at net.jxta.impl.membership.pse.PSEUtils.genCert(PSEUtils.java:236)
at net.jxta.impl.peergroup.ConfigDialog.saveValues(ConfigDialog.java:1988)
at net.jxta.impl.peergroup.ConfigDialog.access$700(ConfigDialog.java:123)
at net.jxta.impl.peergroup.ConfigDialog$3.actionPerformed(ConfigDialog.java:1572)
at java.awt.Button.processActionEvent(Button.java:392)
at java.awt.Button.processEvent(Button.java:360)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Exception in thread "main" net.jxta.exception.JxtaError: Canceled during configuration
at net.jxta.impl.peergroup.ConfigDialog.untilDone(ConfigDialog.java:1632)
at net.jxta.impl.peergroup.DefaultConfigurator.getPlatformConfig(DefaultConfigurator.java:222)
at net.jxta.impl.peergroup.NullConfigurator.getConfigParams(NullConfigurator.java:162)
at net.jxta.peergroup.PeerGroupFactory.newPlatform(PeerGroupFactory.java:403)
at net.jxta.peergroup.PeerGroupFactory.getWorldPeerGroup(PeerGroupFactory.java:574)
at net.jxta.peergroup.PeerGroupFactory.newNetPeerGroup(PeerGroupFactory.java:545)
at HelloJXTA.startJXTA(HelloJXTA.java:24)
at HelloJXTA.main(HelloJXTA.java:12)

I have tried the bcprov-jdk16-145, and added it into classpath
I also checked the document with bcprov-jdk, and org.bouncycastle.jce.X509Principal.getEncoded() function is right there

and i have changed the environment(eclipse IDE/windows CMD) and the configuration
however, the exception is still appear
So... may anyone help me to solve this problem ?! i had search the answer whole day already and there is no a suitable solution for my case>.<
Thx thx...

Message was edited by: star03629

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
richard25
Offline
Joined: 2008-12-03
Points: 0

Hi,

Why do you do not use, the code of JXTA 2.6.

And read and look the Dependencies :
Programmer's Guide 2.6 (Beta1) - PDF, ODT.
Release Notes 2.6 (Beta1) - PDF, ODT.

http://jxse.kenai.com/Developers/Developers.html

And give feed back.

https://jxta.dev.java.net/servlets/ReadMsg?list=announce&msgNo=34

Cheers

star03629
Offline
Joined: 2010-03-21
Points: 0

Solved

I have tried to change the combination of all those lib(.jar) version.
The main reason that i think should be the version conflict
and finally one of the combination run successfully, that i searched at internet

The list as showed below are the library which i have used
jxta.jar
log4j.jar
beepcore.jar
jxtasecurity.jar
cryptix-asn1.jar
cryptix32.jar
jxtaptls.jar
minimalBC.jar

Message was edited by: star03629