Client-Server using RMI on Win2000

I have a client server application using RMI that works on Win NT4.0 when I am connected
to a network or when the it is not connected (workstation is client and server).
This same application does not work as a standalone (not connected to network) when running
on Win2000. I've been able to start the server (still under Win2000) by adding a Microsoft
Loopback Adapter but the client do (can) not communicate ( see) the server(s) at all.
Does anyone knows the difference between WinNT4.0 and Win2000 network,
configure Win2000 for client-server on RMI loopback?
Thanks,
Isagani

Yes, I did. But let me expand on the problem and observations.
Running under Win2000 and connected to the network and working.
- I use netstat -n (a util ) to see how my application is running when it is working.
The port (1101) the apps uses eventually loops back to the system and the app is able
create the multicast sockets it needs and can join the group. And everyone is happy.
When not connected to the network, port 1101 makes a connection back to the system
but somehow the system breaks the loop back, basically throwing an exception.
I do not these problem with WinNT4.0
Any ideas?
Thanks,
Isagani

Similar Messages

  • File Transfer b/w Client - Server using JSP

    Hi,
    I need to implement a file transfer between the client and the server using JSP / Beans. The files can be XML Documents, Images (.gif,.jpeg) or even MS Word documents.
    The user has a set directory on his file system where the files are to be saved upon download and retrieved upon upload. This system is similar to a check-in check-out system.
    How do I get a reference to the directory on the users file system and then either save the downloaded files there or retrieve the files that need to be uploaded.
    Thanks
    coffeejava

    The only way you can do this is by using an applet, a jsp page or servlet does not have access to the system that the browser is running on. Furthermore if you were planning on using the html file form object you cannot set a value for that programmatically. It's not allowed for security reasons.

  • How to access streaming vedio from server using RMI

    Hello please provide me the solution
    i have one vedio file in remote system and i want to import it to my local system using RMI after that i have to control it like vedio player.This entire application should be developed in struts.
    please give me a basic idea how to approch and wht r the files i need to import and is there any classes available to control the remote streaming vedio.

    If you are using Struts then you are in a web environment. So there is no RMI for the client (browser), it is just HTTP.
    About streaming video take a look at JMF (Java Media Framework). And if you are over HTTP you can use something like this to embed your video streaming:
    <html>
    <body>
    <object width="320" height="63"
    classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
    ccclassid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
    standby="Cargando los componentes del Reproductor de Windows Media de Microsoft..."
    type="application/x-oleobject">
                <param name="filename" value="http://192.168.1.31:1025/01_Alegria.mp3">
                <param name="url" value="http://200.32.112.67/Estacion_del_Sol">
                <param name="AutoStart" value="true">
                <param name="volume" value="100">
                <param name="uiMode" value="mini">
                <embed type="application/x-mplayer2"
            pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
            width=218
            height=129> </embed>
            </object>
                <param name="url" value="http://200.59.146.10/rockandpop-ba">
    </body>
    </html>Hope it helps

  • Client Server using Internet [ask]

    I have a client server project who connect between LAN connection and now I want to upgrade it into internet connection. I have search several programs who has similar architecture but none is suitable. Could anybody help me out how to build basic client server which connect using internet connection?
    I have attach my previous program below, I really appreciated if anyone may modify it so be able connect trough internet.
    Solved!
    Go to Solution.
    Attachments:
    Client.vi ‏262 KB
    Server.vi ‏164 KB

    Hi,
    with your program, you seem to have the full control over your house ;-). Why it shouldn't work over internet as it is? You have TCP open, TCP close...in Internet, you simply have to use other IP-adresses as the local ones. So can you specify your question? Or is it a problem with your LAN-infrastructure, that you have to configure your router to have access from outside?
    I don't see why it shouldn't work over Inet...
    christian
    THINK G!! ;-)
    Using LabView 2010 and 2011 on Mac and Win
    Programming in Microsoft Visual C++ (Win), XCode (Mac)

  • Issue with Ftp Client / Server using Sockets

    I have developed a Ftp Client and a Ftp Server. The client Connects to the Ftp Server and sends files to the ftp server. It is a multi threaded server and can have multiple clients connecting to it.
    If a client goes down...the server waits till the client comes up
    Similarly the client waits if a server goes down and reconnects when the server is again up and running
    i am having a strange issue here. When two clients go down and reconnect to the server...They take a long time to connect and transferring of files takes a long time...
    Other wise in all other scenarios the duo work properly.
    Any feedback and suggestion about this strange issue from all you java gurus out there will be deeply appreciated.
    Here is the client code
    import java.net.*;
    import java.net.Socket;
    import java.net.InetAddress;
    import java.io.*;
    import java.io.File;
    import java.util.*;
    import java.lang.*;
    import java.lang.Object;
    import javax.crypto.*;
    import java.util.regex.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    import java.io.InputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.File.*;
    import java.nio.channels.FileLock;
    public class  FTPClient {
         public static void main(String[] args) throws Exception
              Timer timer = new Timer("Test Timer");
              timer.scheduleAtFixedRate(new TimerTask()
                   private int counter = 0;
                                            public void run() {
                                                                     try     {                                                                                
                                                                              System.out.println(counter++);
                                                                               Socket soc=new Socket("xxx.x.x.xx",5217);
                                                                               System.out.println("Socket Initialised.");          
                                                                               transferfileClient t=new transferfileClient(soc);
                                                                               t.SendFile();
                                                                               System.out.println("run complete.");                                                                           
                                                                          catch(Exception ex)
                                                           }, 10000, 40000);
         static class transferfileClient
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;
         BufferedReader br;
         transferfileClient(Socket soc)
              try
                   ClientSoc=soc;
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   br=new BufferedReader(new InputStreamReader(System.in));
              catch(Exception ex)
         //encrypto routine starts
    class DesEncrypter {
           Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03
            // Iteration count
            int iterationCount = 19;   
            DesEncrypter(String passPhrase) {
                try {
                             // Create the key
                             KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                             SecretKey key = SecretKeyFactory.getInstance(
                             "PBEWithMD5AndDES").generateSecret(keySpec);
                             ecipher = Cipher.getInstance(key.getAlgorithm());
                             dcipher = Cipher.getInstance(key.getAlgorithm());   
                             // Prepare the parameter to the ciphers
                             AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                             // Create the ciphers
                             ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                             dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends     
         void SendFile() throws Exception
                   try
                   String directoryName; 
                   // File object referring to the directory.
                   String[] files;        // Array of file names in the directory.        
                   //directory = new File ( "C:\\FTP\\" ) ; 
                   File directory1 = new File("C:\\FTP");
                        boolean successmk = directory1.mkdir();
                        if (!successmk) {
                             // Directory creation failed /Already Exists
                        File directory = new File("C:\\FTP\\ftpc");
                        boolean successmk1 = directory.mkdir();
                        if (!successmk1) {
                             // Directory creation failed /Already Exists
                   //directory = new File ( "E:\\FTP-encrypted" ) ;           
                if (directory.isDirectory() == false) {
                    if (directory.exists() == false)
                       System.out.println("There is no such directory!");
                    else
                      System.out.println("That file is not a directory.");
                else {
                    files = directory.list();
                    System.out.println("Files in directory \"" + directory + "\":");
                    for (int i = 0; i < files.length; i++)
                             String patternStr = "xml";
                             Pattern pattern = Pattern.compile(patternStr);
                             Matcher matcher = pattern.matcher(files);
                             boolean matchFound = matcher.find();
                                       if (matchFound) {                                   
                                       System.out.println(" " + files[i]);                                        
                                       String filename;
                                       filename=files[i];                                   
                                       File f=new File(directory,filename);
                                       FileLock lock = null;                                   
                                       FileOutputStream fos = new FileOutputStream(f, true);
                                       lock = fos.getChannel().tryLock();
                                                 if (lock == null) {
                                                 System.out.println(" Failed to get the file lock: means that the file is locked by other instance.");
                                                 fos.close();
                                                 else
                                                                     InetAddress addr = InetAddress.getLocalHost();                                                                      
                                                                               // Get IP Address
                                                                               //byte[] ipAddr = addr.getAddress();
                                                                               String ip= addr.toString();                                                                      
                                                                               // Get hostname
                                                                               //String hostname = addr.getHostName();
                                       System.out.println(" Lock Acquired.");
                                       lock.release();
                                       fos.close();
                                       dout.writeUTF("SEND");
                                            dout.writeUTF(ip);
                                       dout.writeUTF(filename);
              //String msgFromServer=din.readUTF();          
    DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
    // Encrypt
              FileInputStream fino=new FileInputStream(f);
              encrypter.encrypt(fino,
    new FileOutputStream("ciphertext.txt"));               
              fino.close();
              FileInputStream fin=new FileInputStream("ciphertext.txt");          
              int ch;
              do
                   ch=fin.read();
                   dout.writeUTF(String.valueOf(ch));
              while(ch!=-1);
              fin.close();          
              String option;
                        option=din.readUTF();
                             if((option.compareTo("Delete")==0))     
                                  boolean success = (new File("ciphertext.txt")).delete();
                                  boolean success1 = f.delete();
                                  if (success) {
                                  System.out.println("File Sent ...");
                                  if (success1) {
                                  System.out.println("--File deleted from Client ...");
         for (int j = 0; j < 999999999; j++){}
                                       }//pattermatch loop ends here
    else
                             { //System.out.println("   " + "Not an XML file-------->" +files[i]);
    for (int jb = 0; jb < 111999999; jb++){}
              }// for loop ends here for files in directory
                   }//else loop ends for directory files listing               
         System.out.println("sendfile finished...");
         return;
         }               catch(Exception ex)          {ex.printStackTrace();}                    
         }//sendfile ends here     
         public void displayMenu() throws Exception
                   System.out.println(" Send File");                    
                        SendFile();
                        return;          
    And here is the server code...
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.text.Format;
    import java.lang.Object;
    import java.lang.*;
    import javax.crypto.*;
    import javax.crypto.spec.PBEKeySpec;
    import javax.crypto.spec.PBEParameterSpec;
    import java.security.spec.AlgorithmParameterSpec;
    import java.security.spec.KeySpec;
    public class FTPServer
    {     public static void main(String args[]) throws Exception
         {     ServerSocket soc=new ServerSocket(5217);
              System.out.println("FTP Server Started on Port Number 5217");
              while(true)
                   System.out.println("Waiting for Connection ...");
                   transferfile t=new transferfile(soc.accept());               
    class transferfile extends Thread
         Socket ClientSoc;
         DataInputStream din;
         DataOutputStream dout;     
         transferfile(Socket soc)
         {     try
              {     ClientSoc=soc;                              
                   din=new DataInputStream(ClientSoc.getInputStream());
                   dout=new DataOutputStream(ClientSoc.getOutputStream());
                   System.out.println("FTP Client Connected ...");
                   System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
                   //System.out.println("FTP Client Connected ..." + ClientSoc.getRemoteSocketAddress());
                   start();               
              catch(Exception ex)
    //encrypto routine starts
    class DesEncrypter {
            Cipher ecipher;
            Cipher dcipher;   
            // 8-byte Salt
            byte[] salt = {
                (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
                (byte)0x56, (byte)0x35, (byte)0xE3, (byte)0x03 };   
            // Iteration count
            int iterationCount = 19;   
           DesEncrypter(String passPhrase) {
                try {
                    // Create the key
                    KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
                    SecretKey key = SecretKeyFactory.getInstance(
                        "PBEWithMD5AndDES").generateSecret(keySpec);
                    ecipher = Cipher.getInstance(key.getAlgorithm());
                    dcipher = Cipher.getInstance(key.getAlgorithm());   
                    // Prepare the parameter to the ciphers
                    AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);   
                    // Create the ciphers
                    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
                } catch (java.security.InvalidAlgorithmParameterException e) {
                } catch (java.security.spec.InvalidKeySpecException e) {
                } catch (javax.crypto.NoSuchPaddingException e) {
                } catch (java.security.NoSuchAlgorithmException e) {
                } catch (java.security.InvalidKeyException e) {
            // Buffer used to transport the bytes from one stream to another
            byte[] buf = new byte[1024];   
            public void encrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes written to out will be encrypted
                    out = new CipherOutputStream(out, ecipher);   
                    // Read in the cleartext bytes and write to out to encrypt
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                    out.close();
                } catch (java.io.IOException e) {
            public void decrypt(InputStream in, OutputStream out) {
                try {
                    // Bytes read from in will be decrypted
                    in = new CipherInputStream(in, dcipher);   
                    // Read in the decrypted bytes and write the cleartext to out
                    int numRead = 0;
                    while ((numRead = in.read(buf)) >= 0) {
                        out.write(buf, 0, numRead);
                        //added later on
                        in.close();                    
                    out.close();
                } catch (java.io.IOException e) {
    }     //encryptor routine ends
    //not implemented right now as we arent using the ftp server to download stuff...can be activated later on if we want
         void SendFile() throws Exception
              String filename=din.readUTF();
              File f=new File(filename);
              if(!f.exists())
                   dout.writeUTF("File Not Found");
                   return;
              else
              {     dout.writeUTF("READY");
                   FileInputStream fin=new FileInputStream(f);
                   int ch;
                   do
                        ch=fin.read();
                        dout.writeUTF(String.valueOf(ch));
                   while(ch!=-1);     
                   fin.close();     
                   dout.writeUTF("File Received Successfully");                                   
         String Compare(String filename) throws Exception
                        ///dout.writeUTF("entering compare");
                        String dateTempString=new String();
                        Date dateValue=new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                        dateTempString = formatter.format(dateValue);
                        File dir1 = new File("C:\\FTPnew");
                        boolean success2 = dir1.mkdir();
                        if (!success2) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success = dir.mkdir();
                        if (!success) {
                             // Directory creation failed /Already Exists
                        File ftemp=new File(dir,dateTempString + filename);
                        File fnewtemp=new File(dir,"new-enc-"+filename);
                        // Create encrypter/decrypter class
                        DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                        FileOutputStream fout=new FileOutputStream(fnewtemp);     
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();
                        //dout.writeUTF("written temp en file");
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(fnewtemp),
                    new FileOutputStream(ftemp));
                        //String Option;
                        dout.writeUTF("Delete");                    
                        System.out.println("File Upload Successfull--Duplicate file with timestamp Created");          
                        boolean success1 = fnewtemp.delete();                    
                        return "hello" ;
         void ReceiveFile() throws Exception
              String ip=din.readUTF();
              System.out.println("\tRequest Coming from Internal IP Address : "+ ip);
              String filename=din.readUTF();
              if(filename.compareTo("File not found")==0)
                   return;
              // Destination directory
       File dir11 = new File("C:\\FTPnew");
                        boolean success22 = dir11.mkdir();
                        if (!success22) {
                             // Directory creation failed /Already Exists
                        File dir = new File("C:\\FTPnew\\server");
                        boolean success21 = dir.mkdir();
                        if (!success21) {
                             // Directory creation failed /Already Exists
              File f=new File(dir ,"enc-"+filename);
              File fe=new File(dir,filename);
              String option;
              if(fe.exists())
                   //dout.writeUTF("File Already Exists");
                   String compvalue = Compare(filename);
                   //dout.writeUTF(compvalue);
                   if(compvalue.compareTo("hello")==0)
                        //dout.writeUTF("Transfer Completed");
                        return;
                   option=din.readUTF();
              else
                   //dout.writeUTF("SendFile");
                    option="Y";
                   if(option.compareTo("Y")==0)
                        // Generate a temporary key.       
            // Create encrypter/decrypter class
             DesEncrypter encrypter = new DesEncrypter("My Pass Phrase!");
                 FileOutputStream fout=new FileOutputStream(f);                    
                        int ch;
                        String temp;
                        do
                        {     temp=din.readUTF();
                             ch=Integer.parseInt(temp);
                             if(ch!=-1)
                                  fout.write(ch);                         
                        }while(ch!=-1);
                        fout.close();                    
                        // Decrypt
                    encrypter.decrypt(new FileInputStream(f),
                    new FileOutputStream(fe));          
                        boolean success2 = f.delete();
                        dout.writeUTF("Delete");
                        System.out.println("File Upload Successfull");                    
                   else
                        return;
         public void run()
              while(true)
                   try
                   String Command=din.readUTF();
                   if(Command.compareTo("SEND")==0)
                        System.out.println("\tSEND Command Received ...");     
                        ReceiveFile();
                        continue;
                   catch(Exception ex)
                        //System.out.println("\tClient Terminated Abnormally ...........");
                        continue;

    Please note that this is not an FTP client and server. FTP is defined by a standard IETF protocol and this isn't it.
    Then, move the following lines:
    din=new DataInputStream(ClientSoc.getInputStream());
    dout=new DataOutputStream(ClientSoc.getOutputStream());
    System.out.println("FTP Client Connected ...");
    System.out.println("External IP of Client ..." + ClientSoc.getInetAddress());
    //System.out.println("FTP Client Connected ..."+ClientSoc.getRemoteSocketAddress());from the constructor into the run() method. i.e. don't do anything with the socket in the thread which handles the accept().

  • Client/server RMI app using Command pattern: return values and exceptions

    I'm developing a client/server java app via RMI. Actually I'm using the cajo framework overtop RMI (any cajo devs/users here?). Anyways, there is a lot of functionality the server needs to expose, all of which is split and encapsulated in manager-type classes that the server has access to. I get the feeling though that bad things will happen to me in my sleep if I just expose instances of the managers, and I really don't like the idea of writing 24682763845 methods that the server needs to individually expose, so instead I'm using the Command pattern (writing 24682763845 individual MyCommand classes is only slightly better). I haven't used the command pattern since school, so maybe I'm missing something, but I'm finding it to be messy. Here's the setup: I've got a public abstract Command which holds information about which user is attempting to execute the command, and when, and lots of public MyCommands extending Command, each with a mandatory execute() method which does the actual dirty work of talking to the model-functionality managers. The server has a command invoker executeCommand(Command cmd) which checks the authenticity of the user prior to executing the command.
    What I'm interested in is return values and exceptions. I'm not sure if these things really fit in with a true command pattern in general, but it sure would be nice to have return values and exceptions, even if only for the sake of error detection.
    First, return values. I'd like each Command to return a result, even if it's just boolean true if nothing went wrong, so in my Command class I have a private Object result with a protected setter, public getter. The idea is, in the execute() method, after doing what needs to be done, setResult(someResult) is called. The invoker on the server, after running acommand.execute() eventually returns acommand.getResult(), which of course is casted by the client into whatever it should be. I don't see a way to do this using generics though, because I don't see a way to have the invoker's return value as anything other than Object. Suggestions? All this means is, if the client were sending a GetUserCommand cmd I'd have to cast like User user = (User)server.executeCommand(cmd), or sending an AssignWidgetToGroup cmd I'd have to cast like Boolean result = (Boolean)server.executeCommand(cmd). I guess that's not too bad, but can this be done better?
    Second, exceptions. I can have the Command's execute() method throw Exception, and the server's invoker method can in turn throw that Exception. Problem is, with a try/catch on the client side, using RMI (or is this just a product of cajo?) ensures that any exception thrown by a remote method will come back as a java.lang.reflect.InvocationTargetException. So for example, if in MyCommand.execute() I throw new MySpecialException, the server's command invoker method will in turn throw the same exception, however the try/catch on the client side will catch InvocationTargetException e. If I do e.getCause().printStackTrace(), THERE be my precious MySpecialException. But how do I catch it? Can it be caught? Nested try/catch won't work, because I can't re-throw the cause of the original exception. For now, instead of throwing exceptions the server is simply returning null if things don't go as planned, meaning on the client side I would do something like if ((result = server.executeCommand(cmd)) == null) { /* deal with it */ } else { /* process result, continue normally */ }.
    So using the command pattern, although doing neat things for me like centralizing access to the server via one command-invoking method which avoids exposing a billion others, and making it easy to log who's running what and when, causes me null-checks, casting, and no obvious way of error-catching. I'd be grateful if anyone can share their thoughts/experiences on what I'm trying to do. I'll post some of my code tomorrow to give things more tangible perspective.

    First of all, thanks for taking the time to read, I know it's long.
    Secondly, pardon me, but I don't see how you've understood that I wasn't going to or didn't want to use exceptions, considering half my post is regarding how I can use exceptions in my situation. My love for exception handling transcends time and space, I assure you, that's why I made this thread.
    Also, you've essentially told me "use exceptions", "use exceptions", and "you can't really use exceptions". Having a nested try/catch anytime I want to catch the real exception does indeed sound terribly weak. Just so I'm on the same page though, how can I catch an exception, and throw the cause?
    try {
    catch (Exception e) {
         Throwable t = e.getCause();
         // now what?
    }Actually, nested try/catches everywhere is not happening, which means I'm probably going to ditch cajo unless there's some way to really throw the proper exception. I must say however that cajo has done everything I've needed up until now.
    Anyways, what I'd like to know is...what's really The Right Way (tm) of putting together this kind of client/server app? I've been thinking that perhaps RMI is not the way to go, and I'm wondering if I should be looking into more of a cross-language RPC solution. I definitely do want to neatly decouple the client from server, and the command pattern did seem to do that, but maybe it's not the best solution.
    Thanks again for your response, ejp, and as always any comments and/or suggestions would be greatly appreciated.

  • Why timesten is slow in client/server mode

    i am testing Timesten client/server mode and find that
    it is to slow.
    when using dircet mode, timesten can precoss about 40000 query pre second
    but when change to client/ server mode
    it can only process 1500 query pre second.
    here is my config and test sql.
    [Test_tt702]
    Driver=//u01/oracle/TimesTen/tt70/lib/libtten.a
    DataStore=//u01/oracle/TimesTen/tt70/info/DemoDataStore/Test_tt702
    DatabaseCharacterSet=US7ASCII
    TempSize=64
    PermSize=250
    Temporary=1
    TypeMode=1
    CREATE TABLE TEST999
    A1 number NOT NULL PRIMARY KEY ,
    A2 number,
    A3 number
    network card is 1000m,
    query code:
    PreparedStatement pSel = dbConn.prepareStatement("select a1,a2 from TEST999 where a1=?");
    rs = null;
    int a1=0;
    int a2=0;
    for(int i=0;i<80000 ;i++)
         pSel.setInt(1,i );
    rs=pSel.executeQuery( );
    if (rs.next()) {
         a1 = rs.getInt(1);
         a2 = rs.getInt(2);
         if( i%8000==0) {
         System.out.println("select "+ i +" res="+a1 +" time " + getTime_v2());
         rs.close();
    direct mode time : 80000 query is 2 second
    client/server mode in the same machine : 80000 query is 12 second
    client/server mode in the different machine : 80000 query is 54 second
    any one have idea about this?
    is it the jdbc driver 's promble?

    it is to be expected that there will be a big difference in performance between direct mode and client/server due to much greater overhead in client/server, especially if the client is on a different machine. However, the differences you are seeing here are larger than I would normally expect.
    You say (I think) that the network is 1 GB, correct? What is the hardware spec of the test machine(s)? Have you tuned the O/S network stack for optimal performance?
    Typically, for local client/server using the fastest IPC mode (shmipc) I expect performance of around 20-30% of direct mode and for remote client/server with a GB LAN I would expect performance of around 10-20% of direct mode.
    Chris

  • Establish a connection through RF modem's on client & server side & to set up PPP communication for data transfer

    hi
    can any1 over here help me out in how to establish connection between 2 RF modem's for data transfer , between client & server USing LABVIEW?
    I want to establish a connection between 2 PC's through  RF modem on client & server side & to set up PPP communication for data transfer.
    (I have tried data transfer through RS-232 using TCP/IP whn the 2 PC's are connected over ethernet... which is working.
    I also tried connecting loopback cable between 2 PC's COM port & geting data transfer using VIsa configure serial port & other visa functions  ... which is working)
    can u guide me how to establish connection between 2 RF modem's using LABview?
    & how does the data transfer take place between 2 RF modems through RS-232?
    is it using TCP/IP?
    If you got any links to go abt this issue do send me related links .. or any examples .....
    I am currently using Labview version 8.
    Waiting in anticipation.. reply ASAP..
    thanking you
    Regards
    Yogan..

    Howdy yogan,
    Maybe you could clarify a few things for me, and we'll see how we can help ya. TCP/IP protocol occurs through an ethernet connection; RS-232 communication occurs through an RS-232 serial connection, typically through a cable that has a DB9 connector on both ends. Do you mean that the RF modems in question have the option to communicate via RS-232 and/or via TCP/IP ethernet? Specific information like the manufacturer of your RF modems, the model number of your RF modems, and how you connect the modems to the PC would enable us to give you more efficient support.
    You can check our Instrument Driver Network (IDNet) to see if a plug-and-play/IVI driver already exists for your RF modem. (You'll need to know its manufacturer and model number.) In the case that you do find an IDNet driver for your modem, you can use this KnowledgeBase article for instructions on how to use the driver.
    Another excellent resource to consider is the NI Example Finder. You can access this within LabVIEW by navigating to Help»Find Examples and then searching for serial or TCP/IP examples.
    Message Edited by pBerg on 03-10-2008 04:35 PM
    Warm regards,
    pBerg

  • Client\server Forms

    Oracle Forms6i in a client\server environment is a great product that still works very well for us. We do not need (or want) a web-based solution. Our system only needs to support our in-house users (about 400 currently).
    I am very disappointed in the direction that Oracle is forcing us to go (web-based) if we want to stay with the Oracle tools that we know well. This isn't so much a request for help, it's more an attempt to communicate to the Oracle Forms manager(s) that going away from client\server is very disappointing to us and looks to be a bad business decision.

    Mark,
    I must appologize, but I though that things are easier to search and find on this forum. I tried for half an hour but wasn't able to spot the main thread ;-(
    The summary of it is that there was a big discussion on this forum after Oracle announced its desupport date for Forms and Reports client/server (sometime in July if I remember well). Along with this desupport date there was a discussion whether or not Oracle Forms supports XP. The initial decision of not supporting XP was reverted and XP now is supported since patch 13.
    For client/server the desupport date is January 1st 2005 for error correction and January 1st 2008 for extended assistance support. Thus Forms6i client/server will be around until end of 2007.
    Most discussions on this forum were about the cost going with moving Forms to the Web, especially keeping in mind that client/server runtime was for free.
    Another issue was the size of the Oracle9iAS installation which is 6GB all in all though Forms users may not use all the Oracle Application Server components.
    Last but not least, many customers didn't feel ready to move their applications to the Web in this period of time, especially those that run character mode applications.
    The installation issue gets fixed with the upcoming Oracle Application Server 10g which has a installation option that only installs the software required to run Forms and Reports.
    The migration is assisted by a Forms Migration Assistant in Forms9i as well as material that we compiled and published on OTN. The WebUtil library finally was developed to close the gap between client/server functionality and teh Web functionality.
    I can't talk about pricing, because this is not in the scope of my professional work, but OTN offered a special upgrade promotion for Forms users when moving their applications to teh Web.
    Client/server as it is in Forms6i will not come back, this is how it seems.
    There have been discussions on this forum if one could simulate client/server using the Forms Web components installed on a local client. Webstart was mentioned as one possible solution as it would allow you to have Forms applications started and run from an icon on the user desktop. Currently there are some investigations in Forms development going into this direction.
    The majority of customers that posted their opinion on the client/server desupport did not like the client/server desupport plan at all.
    The OTN forum postings where brought to Oracle senior management attention by Forms Product Managers monitoring this list.
    The benefit of a Web only version of Forms - and you may disagree - is integration with the J2EE stack Oracle has within Oracle9iAS and OracleAS 10g.
    J2EE is a technology that more and more customers evaluate for future development efforts. Having Forms integrating with J2EE applications(as seamlessly as possible)is the best way to make sure that Forms users can leverage their investment in the Forms technology. Even more, you can extend Forms applications with J2EE or have it communicating with it (the same applies to Reports)
    Many new features that we implemented in Forms6i and Forms9i worked on the Web only (SSO, Enterprise Manager monitoring, client side Java etc).
    Mark, hope that this summary gives you a good idea of what the discussions were about and that we do care of what customers do with Forms.
    Just in case that I missed an argument or presented it too positive (my memory is subjective and not perfect), I am sure that the forum members which already contributed to this posting will add additional comments. Others may join in too.
    Frank

  • Possible to use RMI to upload client side image files?

    Is it possible to use RMI to upload client side image files? My intent is to allow remote clients to upload a number of small image files (jpg & gif) to a central server DBMS, by modifying a "Customer" object (eg adding a new Image object to a vector of Images?) Is this possible? Any suggestions greatly appreciated :))

    Is it possible to use RMI to upload client side image
    files? One possibility is to implement a serializable image object that you can upload to the server as any other object. When your server receives this serialized image object, just generate a new gif/jpg from it.
    But if your client-program is an applet, the situation is different: how can applet read image-file from users harddrive?
    krera

  • Problem connecting RMI-Server using a servlet

    Hi All..
    I have a RMI-client server model woring fine in AIX box.I am currently in a need to create one web client(may be with servlet or JSP).
    I wrote a sample servlet which try to connect to the RMI server. But when I run the servlet Its simply try to connect and then wait for unlimited time,not even print any exception/error.
    Both my RMI sevrer and Tomcat are in the same box.
    I am sending the servlet code for your reference.
    import java.rmi.*;
    import java.rmi.registry.Registry;
    import java.rmi.registry.LocateRegistry;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import ir77.mon.engine.*;
    public class WebClient extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    XmlServerIntf xmlServerIntf = null;
    PrintWriter out = res.getWriter();
    res.setContentType("text/plain");
    try{
    out.println("Connecting to server......");
    //Seems this one is sufficient.(either this code or the below one)
    //String strServerUrl = "rmi://" + "192.168.100.22" + "/ir77.mon.engine";
    //xmlServerIntf = (XmlServerIntf) Naming.lookup(strServerUrl);
    //Try with this one also
    Registry reg = LocateRegistry.getRegistry("192.168.100.22", 2004);
    xmlServerIntf = (XmlServerIntf) reg.lookup("rmi://192.168.100.22/ir77.mon.engine");
    out.println("Connected to server");
    catch (Exception e){
    System.out.println("Exception in WebClient"+e);
    when I run the servlet in the browser with "http://192.168.100.22:8080/WebClient" its simply prints " Connecting to server......" and waits.
    Note : 192.168.100.22 - where my rmi server starts and 2004 -where I created by rmiregistry.I created it using LocateRegistry.createRegistry(2004);
    I have tried starting tomcat with "-security" option too but no responds as well.
    Do I have to provide some grant permission in catlina.policy file?If yes what?
    currently I have tried with giving all permission..
    Do I need to change the RMI server code?
    Any help will be highly appreciated....

    Hi genady,
    Oh....Ya I like to...I thought no body was interested...as I didn't get any reply from anybody....
    Well The first thing is that with the look up method in the servlet
    it should be like :
    Registry reg = LocateRegistry.getRegistry("ip address of the rmi server", port number);
    RMIServerInterface = (type cast with RMIServerInterface) reg.lookup("rmi binding string");
    Now you are able to get the server interface object & you can call any method.
    Next you have to provide the grant permission in the catalina.policy file to the folder where you have your application like....
    grant codeBase "file:${catalina.home}/webapps/ROOT/WEB-INF/classes/-" {
    permission java.security.AllPermission;
    Or you can give specific permissions also.
    Finally you have to run the tomcat as : $catalina.sh start -security
    Note: One more thing you have to keep in mind that's the structure of your application. ie com.mon.yourapp.......u have to create the same structure in tomcat's classes folder .
    Its done...........

  • RMI or RTSP for Video Client/Server??????

    I am about to write a media streaming server and client in Java using JMF. I would like to use RMI to control the media streams, however, RTSP looks like a good alternative. Can anyone here provide me with any pro's and con's to using either approach.
    Thanks.

    hi, i am currently working on a project that streams video via JMF. the protocol i used is RTSP... it seems quite ok with RTSP to stream local static files through the LAN (Wireless LAN).
    by the way . i am asked to send 2 streams with different resolutions (screen sizes) for laptops and PDAs respectively.... do you have any idea to create the two streams >?

  • An rmi client server design problem

    I am implementng a networked cards game in java using rmi . The server keeps track of the turn of the players and activates ther clients(on an applet) whose turn it is to play .
    Both client and server call each others methods.
    Prblem one :
    Right now if a a client disconnects , a process run through all the clients active and gets a remote exception on the server and removes ALL the 4 players i nthat particulat group. If I want to save the state and allow any player to contuniue from there , how will I do it?
    Problem 2:
    How do I keep track of the time a client takes to play.
    If he takes longer than say 5 mintes , I should disconnect him.

    There seem to be two issues at stake: <b>catching the remote exception</b> and <b>multithreading</b> your application on the server.
    When a client disconnects "suddenly" (without logging off via remote method call to alert server), the remote method call by the server to all <i>n</i> players triggers a remote exception that must be caught and dealt with accordingly (do I understand that it is causing the application to exit at present?) When caught, you must identify which player is "gone" and remove that client from the pool of client objects.
    Right now, it sounds as if the app is NOT multithreaded. You can create a low-priority thread that looks at a time variable for each player to determine its last moment of play. This means every successful remote call from client-server or vice-versa will update that client's 'lastplayed' variable with (long) System.currentTimeMillis() for example.

  • One RMI client and mutliple RMI server implementation

    Hi,
    We are planning to implement a RMI. In the design approach we are planning to have 1 client and mutiple RMI server and each RMI server register to a system. All the RMI server will have the same functionality. The decision to call particualr RMI server is done at runtime based on some parameter. I am not clear on how to implement the same as I am new to RMI technology, so it would be great if you can suggest some good approach for doing the same.
    Thanks,
    Ramreddy

    greetings,
    your client and server are in the same class?
    i.e. server object (interface implementation instance)
    and lookup are within the same execution thread
    i believe this defeats the purpose of RMI
    the objective is to utilize object methods on different machines
    otherwise, you can just use a local method within your server/client mainline (of course, it ceases to become "remote" at that point)
    logistically, there is also the problem of the runtime not being able to resolve the skeleton/proxy components correctly (since it's probably searching for a client stub which doesn't exist...); maybe you could fake it out by compiling a phony client class - again, this won't provide any advantage but it might run
    perhaps if you shared your system/network setup and a bit more about your design objectives someone in this forum could provide some assistance
    good luck,
    D

  • SENDING EMAIL USING ORACLE9i CLIENT/SERVER

    I HAVE DOWNLOADED 2 UTILITY LIBRARIES D2KCOMN and D2KWUTIL TO MY COMPUTER. THESE 2 LIBRARIES ARE COPIED TO AN ORACLE FORM. ON THE FORM, THERS IS A BUTTON. IN THE WHEN-BUTTON-PRESSED-TRIGGER, I HAVE CODED
    WIN_API_SHELL.WINEXEC('"C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\OUTLOOK.EXE"-c IPM.Note/m"'||:email.recipient_name||'&cc='||
    :email.recipient_name2||'&subject='||:email.subject||
    '&body='||:email.mes||'"',WIN_API.SW_SHOWNORMAL,TRUE);
    :email.recipient_name,
    :email.recipient_nam2,
    :email.subject, and
    :email.mess
    ARE FIELDS ON THE ORACLE FORM.
    THE NAMES ARE DEFINED BY THE PROGRAMMER.
    THE NAMES OF THE FIELDS ARE NOT RESERVED WORDS.
    WHEN THE CODE IS EXECUTED, MICROSOFT OUTLOOK IS OPENED AND THE RECIPIENT LINE, COURTESY COPY LINE, SUBJECT LINE
    AND BODY OF A NEW MESSAGE ARE PREPOPUTATED WITH THESE FIELDS FROM AN ORACLE FORM.
    THIS ROUTINE WORKS FINE ON AN ORACLE6i CLIENT SERVER BUT IT WILL NOT WORK WELL ON AN ORACLE9i CLIENT SERVER.
    WHAT DO I NEED TO DO TO CHANGE MY CODE? DO I NEED TO USE NEW UTILITY LIBRARIES? I WOULD SURE LIKE TO KNOW WHAT TO DO.

    Oracle9i Forms does not support client server - so you are running in a different environment (even though you may still only be onl two tiers).
    Regards
    Grant Ronald
    Forms Product Management

Maybe you are looking for

  • How to connect apple tv and airport express on same Hi-Fi?

    Hello everybody, My question first : Is it possible to output the sounds directly from the Apple TV to my Airport Express (via Airplay, wifi, or whatever connection) and connect with the jack my Airport Express to the stereo? This way I could hear th

  • Can't upgrade from 10.1.3 to 10.4 (Tiger on DVD)

    I have an old iMac which I decided to upgrade to Tiger. I added RAM to get to 640 MB. Then I installed the 10.1.3 OS that came with the computer. Now I'm trying to upgrade it to Tiger (10.4) but the computer just spits out the disk whenever I insert

  • File Resolution Export Problem

    I'm having problems with the resolution option when I export my images as jpegs in Lightroom. In the export dialog box, I enter the file resolution as 240ppi, but once the file is exported and I open it in Photoshop or Bridge, the resolution is 72ppi

  • Using only part of a song in iMovie?

    I've been using iMovie for a while and it's great but one thing I haven't been able to figure out yet is an easy way to use just a portion of a song. I want to use about six or seven different songs in my iMovie project, but only use certain parts of

  • I have accidently deleted the IPHoto App. I was looking for photos that were accidientrly deleted. my photos had disappeared

    I have lost my photos and was looking for them on my laptop. I'm not sure what happened... but now I do not have my IPhoto application either. I looked in trash but have not found it. Now I have two problems: no app and no photos too.