JADE (NetBeans IDE 6.8) and Rev Studio 4.0
zeeshan aamir
shani.runrev at gmail.com
Sat Mar 20 12:44:42 EDT 2010
hi Zryip,
if you try this code in Netbeans then you see that it work fine. and giving
the output. but the main problem is that i made this in JADE and i want to
cummnicate JADE with Rev. i try the Jan Schenkel examples from
http://www.quartam.com
hare in this link. rmj.zip and tea.zip it work fine on JAVA and Rev, so
tahts why i try JADE program.
I copy from src in netbeans where netbeanss program store. and take it in
same folder where it is rev file i have then i compile this to make a .class
javac Server.java
it makes Server.class.
but i try same meathod to check the connectivity but it not works.
Regards,
ZEESHAN
On Sat, Mar 20, 2010 at 2:56 PM, zryip theSlug <zryip.theslug at gmail.com>wrote:
> 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
> _______________________________________________
> 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
>
More information about the use-livecode
mailing list