JADE (NetBeans IDE 6.8) and Rev Studio 4.0

zryip theSlug zryip.theslug at gmail.com
Sat Mar 20 09:56:22 EDT 2010


2010/3/19 zeeshan aamir <shani.runrev at gmail.com>:
 …………………………………………………………………………………………
>
>
>
> //Code for Server.java  (JADE)
> package Server;
>
> import java.io.DataInputStream;
> import java.io.IOException;
> import java.net.ServerSocket;
> import java.net.Socket;
>
> public class Server {
> public static void main (String[] args) throws IOException{
> ServerSocket server=new ServerSocket(6800);
> System.out.println("Server Started");
> Socket client= server.accept();
> DataInputStream in= new DataInputStream(client.getInputStream());
>
> System.out.println("Client Syas: " + in.readUTF());
> }
> }
>
> .................................................................................................
> /7code for client Socket. (JADE)
>
>
> package Cleint;
>
> import java.io.DataOutputStream;
> import java.io.IOException;
> import java.net.Socket;
>
> public class Cleint {
> public static void main (String[] args) throws IOException {
> Socket client= new Socket("localhost",6800);
> System.out.println("Connected to server");
> DataOutputStream out = new DataOutputStream(client.getOutputStream());
> out.writeUTF ("AllowServer");
>
>
> }
>
> }
> .....................................................................
>
> *RunRev* Main
>
> function StackPath
>   local tPath
>   --
>   put the effective filename of this stack into tPath
>   set the itemDelimiter to slash
>   delete item -1 of tPath
>   --
>   return tPath
> end StackPath
> ////////////////////////////////////////////
> *For Server  Communication Button in Rev*
>
>
> on mouseUp
>   local tDefaultFolder, tResult
>   --
>   put the defaultFolder into tDefaultFolder
>   set the defaultFolder to StackPath()
>   --
>   put shell("Server 6800") into tResult
>   --
>   set the defaultFolder to tDefaultFolder
>   answer tResult
> end mouseUp
>
> *
> Clinet button coading in Rev
> *
>
>
>
> on mouseUp
>    local tDefaultFolder, tProcess
>   --
>   put the defaultFolder into tDefaultFolder
>   set the defaultFolder to StackPath()
>   --
>   put "Client" into tProcess
>   open process tProcess for neither
>   --
>   set the defaultFolder to tDefaultFolder
> end mouseUp
>
>
>
> ………………………………………………………………..
>
>
>
> I am very thankful to you for this kindness in advice.
>
>
>
> Kindly reply me on your earliest.
>
>
> Regards,
>
> shani
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

Hello Zeeshan,

I'm not a specialist, but you actually listen on the 6800 port but you
are not sure that your port is open. You throw the exception but not
catch it.
To avoid bugs, add a couple of try/catch statement like this :

public class Server {
 public static void main (String[] args) throws IOException{
 try {
 ServerSocket server=new ServerSocket(6800);
} catch (IOException serverException) {
System.out.println("Server error : Could not listen on port 6800");
System.exit(-1);
}
 System.out.println("Server Started");
Socket client = null;
try {
Socket client= server.accept();
} catch (IOException serverException) {
System.out.println("Server error : Accept failed on port 6800");
System.exit(-1);
}
 DataInputStream in= new DataInputStream(client.getInputStream());
}
}

> put shell("Server 6800") into tResult

You have no need to pass the port in the shell command, or manage the
parameter in the string array of the main call.

> java.lang.NoClassDefFoundError: Server (wrong name: Server/Server)

It's a ClassNotFoundException. Maybe checks your class path.


At this point, it seems to me that the problem comes from java and not for RR.


Regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the use-livecode mailing list