Skip to main content

jxta-2.5 "HelloWorld"

8 replies [Last post]
iwankoenig
Offline
Joined: 2007-06-19
Points: 0

Hi!
I am using jxta-2.5 and i try to start the Example "HelloWorld" from "JXTA Javaâ„¢ Standard Edition v2.5: Programmers Guide"

And it doesn't work!
At first: The eclipse says: "The method MessageFormat.format(String, Object[]) is not applicable for the arguments (String, boolean)".
Ok! I delete the lines:
boolean connected = manager.waitForRendezvousConnection(12000);
System.out.println(MessageFormat.format("Connected :{0}", connected));

And the eclipse says no errors.

And then i run the application "HelloWorld" and i become the follow errors in the eclipse:
Starting JXTA
Exception in thread "main" java.lang.NoSuchMethodError: method java.util.Collections.emptyList with signature ()Ljava.util.List; was not found.
at net.jxta.impl.document.LiteXMLElement.getChildren(LiteXMLElement.java:535)
at net.jxta.impl.document.LiteXMLElement.getTextValue(LiteXMLElement.java:731)
at net.jxta.impl.document.LiteXMLElement.getTextValue(LiteXMLElement.java:701)
at net.jxta.impl.document.TextElementCommon.getValue(TextElementCommon.java:113)
at net.jxta.impl.document.TextElementCommon.getValue(TextElementCommon.java:70)
at net.jxta.document.StructuredDocumentUtils.copyAsDocument(StructuredDocumentUtils.java:197)
at net.jxta.impl.protocol.PlatformConfig.setDesc(PlatformConfig.java:311)
at net.jxta.impl.protocol.PlatformConfig.setDescription(PlatformConfig.java:284)
at net.jxta.platform.NetworkConfigurator.getPlatformConfig(NetworkConfigurator.java:1584)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:362)
at HelloWorld.main(HelloWorld.java:12)

It seems, that the line "manager.startNetwork();" doesn't work.

The JAR's of JXTA are included to the project. I don't know what do i do wrong. Please help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lutfi123456
Offline
Joined: 2007-10-18
Points: 0

it does not working for me, why?

jaussiba
Offline
Joined: 2007-09-10
Points: 0

I've got an other problem

When I execute the Helloworld code. I've got anomaly output :

Starting JXTA
JXTA Started
Waiting for a rendezvous connection
Connected : false
Stopping JXTA

Why I don't have a connection= true like ine the "JXTA Javaâ„¢ Standard Edition v2.5: Programmers Guide" ?

and Second question : it's normal the red messages between outputs on my Eclipse console ? they are "normal" Info messages ?

I execute my program on a local network with 2 computers.

hamada
Offline
Joined: 2003-06-12
Points: 0

Set the following prior to starting, as the NetworkManager, by default, avoids connecting to the public rendezvous.

[b]manager.setUseDefaultSeeds(true);[/b]
manager.startNetwork();

carnado
Offline
Joined: 2007-08-21
Points: 0

Hello, anybody can help me...what wrong to my jdk1.6.0...i attach file that show the problem...i a new one in JXTA and Java

jaussiba
Offline
Joined: 2007-09-10
Points: 0

Download the lastest release version 2.5RC3

asghar
Offline
Joined: 2005-07-26
Points: 0

Hi,

…
Starting JXTA
Exception in thread "main" java.lang.[b]NoSuchMethodError[/b]: method [b]java.util.Collections.emptyList[/b] with signature ()Ljava.util.List; was not found.
….

The method
public static final List emptyList()
exists in the API of Java SE since 1.5.
It seems you are suing the JRE or JDK before 1.5.
You just need to update the installed JRE or JDK on your computer.

Asghar

jaussiba
Offline
Joined: 2007-09-10
Points: 0

Hi

I'm using the same Hello world code and I've got a problem.

I've got this exception :

Starting JXTA
Exception in thread "main" java.lang.NoSuchFieldError: SHOW_INFO
at net.jxta.platform.NetworkManager.configure(NetworkManager.java:353)
at net.jxta.platform.NetworkManager.startNetwork(NetworkManager.java:402)
at HelloWorld2.main(HelloWorld2.java:79)

And the program stop.

What's the problem ???

Thanks for your help

jaussiba
Offline
Joined: 2007-09-10
Points: 0

I found the problem

It's just a conflict between the external libraries

Message was edited by: jaussiba