Skip to main content

problem in the shareDemo & searchDemo execution

3 replies [Last post]
hadji2006
Offline
Joined: 2006-04-16
Points: 0

Hi every one,
let mi introduce: i am from Algeria and studing ingineering.
am new to Jxta and building my first application..My problem is that a have executed the searchDemo exemple on a PC and the "shareDemo" exemple in an other PC but in the "searchDemo" program there are no results on the shared files in the "shareDemo" program.

i sucpect that i have not install the jxta platform in the right way,
i have just copy the the jar files (jxta.jar,jxtacms.jar...) in the "\jdk1.5.0\jre\lib\ext\" directory and execute the search and the shareDemo and in the shareDemo the liste of all files appear, if there are any one who have the solution, please send it to me in the forum or in my
mail: meghazih@yahoo.fr.

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ae6rt
Offline
Joined: 2005-10-25
Points: 0

Hello.

Would you please be more specific about which demo you are running - that is, specify where you found the demo code, as well as how you are invoking it. Please include the classpath you are using, too.

Mark

hadji2006
Offline
Joined: 2006-04-16
Points: 0

hello Mark,

i have sent the whole directory containing the search and the sharedemo exemples

please read it and if you have time execute them and tell me where is the problem

thanks, Mark.

ae6rt
Offline
Joined: 2005-10-25
Points: 0

Good morning.

We may have to meet in the middle and compromise on this one. I'll show you how I got it to work under Linux, which involves some "batch" file to Unix "shell" syntax translations, but nothing more.

1. You need three sets of jar files: one for the Platform, one for the JXTA Shell, and one for CMS. I think you know how to get these, but for the sake of illustration, on my machine they reside in the following places:

[code]
Platform: /home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/*.jar
Shell: /home/petrovic/JXTA/Release/Bisi/shell/binding/java/jnlp/lib/*.jar
CMS: /home/petrovic/JXTA/Release/Bisi/cms/binding/java/jnlp/lib/*.jar
[/code]

It doesn't really matter specifically where you have these files on your machine, but you do need to know where they are.

2. Next, build a script to call the ShareDemo application

[code]
# set up some handy variables
home=$HOME/JXTA/Release/Bisi

cp=$home/cms/binding/java/jnlp/lib/jxtacms.jar:$home/cms/binding/java/classes
for i in $home/platform/binding/java/jnlp/lib/*.jar; do
cp=$cp:$i
done

java -classpath $cp net.jxta.test.ShareDemo
[/code]
3. This results in a call that looks like this
[code]
java -classpath /home/petrovic/JXTA/Release/Bisi/cms/binding/java/jnlp/lib/jxtacms.jar:/home/petrovic/JXTA/Release/Bisi/cms/binding/java/classes:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/bcprov-jdk14.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/javax.servlet.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jdom.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jxtaext.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jxta.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/log4j.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/org.mortbay.jetty.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/swixml.jar net.jxta.test.ShareDemo
[/code]
4. Notice this technique does not require you to copy any jar file to the ext/ directory of your Java runtime distribution.

5. On the second machine, where you will run the SearchDemo app, your invocation script looks like this
[code]
# set up some handy variables
home=$HOME/JXTA/Release/Bisi

cp=$home/cms/binding/java/jnlp/lib/jxtacms.jar:$home/cms/binding/java/classes
for i in $home/platform/binding/java/jnlp/lib/*.jar; do
cp=$cp:$i
done

java -classpath $cp net.jxta.test.SearchDemo

java -classpath /home/petrovic/JXTA/Release/Bisi/cms/binding/java/jnlp/lib/jxtacms.jar:/home/petrovic/JXTA/Release/Bisi/cms/binding/java/classes:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/bcprov-jdk14.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/javax.servlet.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jdom.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jxtaext.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/jxta.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/log4j.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/org.mortbay.jetty.jar:/home/petrovic/JXTA/Release/Bisi/platform/binding/java/jnlp/lib/swixml.jar net.jxta.test.SearchDemo
[/code]
where I assume you have created the same directory structure as for the first machine.

6. I hope that helps. I am actually not familiar with the Demo apps, but both ran on my two machines. The second machine was able to find a file shared by the first machine. I could not figure out how to actually transfer the file, but the Demo may not be written to transfiles.