Should I be using RMI

Hi,
Two questions really:
1) Should I be using RMI
2) If so how much of the program should use RMI
I am about to start building a database driven application. However, I am unsure whether to make it 2-tier not using RMI or 3-tier using RMI.
The various different clients all need to add,update and delete things in the database which will be done over JDBC. However, all the clients also need to be notified of certain activities taking place on any of the other clients, for instance if one client adds a record the other clients need to be informed of this.
I assume that the broadcasting of the these messages to the listening clients would need to be done using RMI or some other distributed systems technology. Is this a correct assumption?
However, when one of the clients does a query on the database should this be done directly, bypassing the servers. I was thinking this as passing record sets from the database server to the application server and then onto the client applicaiton would result in significant network traffic. Therefore, I assume, that for the other parts of the applicaiton which don't involve the broadcasting of information to all the clients I should just make the database connections within the client programs and connect directly to the database. Is this also a correct assumption?
Any comments on this would be much appreciated.
Thanks in advance
Robert Miles

Here's the approach that my company took for a database-centered set of applications.
We wanted multi-user access, and we wanted an object interface, because there is substantial application logic that we preferred to put on the server.
The design we created uses
o apiobjects, which are held by clients, and which in turn simply hold references to
o apiserver objects, which belong to a client session, and which in turn simply hold references to
o dbobjects, which belong to the system, and represent the database data being used by one or more active clients.
Note that in this design, RMI is hidden in the apiobjects. It is important, but not to the client, whether or not the apiobject holds real data, or accesses the server and returns the data.
One other note about this architecture: The data is organized into an object tree. The top of the tree is an "entry" object which the client instantiates and uses to log in; the login returns a "server" object, which is the root for accessing all other objects.
For event notification we ask the client to define an event manager, and tell the "server" about it. (There are also some fairly extensive filter definition capabilities.) On the server side, and event manager, when told about an event, searches the sessions for managers to be notified, and notifies them by calling a method on the event manager.
What about other applications accessing the DB? Well we are still discussing this.
o One consideration I can think of is locking. If all your locking can be convincingly consigned to the DBMS, then maybe you can implement a completely-separate access path.
o Another consideration - one not necessarily shared by my colleagues - is that the boundaries around applications are not always rigid, and the first time a new application crosses the RMI-vs_other boundary, well you'll have some work to redo.

Similar Messages

  • Should may application use RMI?

    Here is the client of a news ticker i have produced. i wish to use client/ server to some how update the news items the client displays. At the moment i am 80% into implementing sockets but with further research am now considering RMI. My only problem is that i have around 2 weeks till my deadline so will not pursue this if it is too much work.
    i am using a 2d array in the client code that holds he news item title and URL. Would the RMI server hold this array instead and the client ask for this information at fixed intervals?
    help would be greatly appreciated.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    public class Test7 extends JFrame
      private JFrame tickerFrame;
      private JPanel tickerpanel,stocktickerpanel;
      private JTextField displayArea;
      //private Socket client;
      //private String NewsServer;
      private ObjectOutputStream output;
      private ObjectInputStream input;
            public Test7 ()
                    super("client");
                    tickerFrame = new JFrame("Notification Ticker");
                    tickerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    tickerFrame.setSize(new Dimension(100, 100));
                    displayArea = new JTextField();
                    tickerFrame.getContentPane().add(new JScrollPane( displayArea ), BorderLayout.NORTH );
                    tickerFrame.getContentPane().add(new Marquee( getTexts() ), BorderLayout.CENTER);
                    tickerFrame.getContentPane().add(new Stock( getStocks() ), BorderLayout.SOUTH);
                    tickerFrame.pack();
                    tickerFrame.setVisible(true);
                    //stocktickerpanel = new JPanel ();
                    //stockpanel.setSize (stockpanel.getPreferredSize ());
                    //add (stockpanel);
            public String[][] getStocks ()
              return new String[][]
                  {"BARC", "+2.1"},
                  {"PFC", "0.5"},
                  {"HDF", "-3.2"},
                  {"DDF", "+3.8"}
            public String[][] getTexts ()
                    return new String[][]
                            {"National","This is a national headline", "http://news.bbc.co.uk/1/hi/world/middle_east/3665775.stm"},
                            {"Busines","This is a business headline", "http://news.bbc.co.uk/1/hi/business/3665193.stm"},
                            {"Political","Here is a political headline", "http://news.bbc.co.uk/1/hi/uk_politics/3697675.stm"},
                            {"Enterainment","Entertainment headline here", "http://news.bbc.co.uk/1/hi/entertainment/music/3665545.stm"}
           private class Stock extends JPanel
                   private boolean paused;
                   public Stock (String[][] stocks)
                            MouseListener listener = new MouseAdapter ()
                                    public void mouseEntered (MouseEvent event)
                                            paused = true;
                                    public void mouseExited (MouseEvent event)
                                            paused = false;
                            addMouseListener (listener);
                            stocktickerpanel = new JPanel ();
                            stocktickerpanel.addMouseListener (listener);
                            for( int i = 0; i < stocks.length;  i ++ )
                                    if( i > 0 )
                                            stocktickerpanel.add (Box.createHorizontalStrut (20));
                                    }StockDisp stck = new StockDisp (stocks[0],stocks[i][1]);
    stck.addMouseListener (listener);
    stocktickerpanel.add (stck);
    add (stocktickerpanel);
    paused = false;
    new Thread (new Runnable ()
    public void run ()
    while( true )
    if( ! paused )
    int x = stocktickerpanel.getX () - 1;
    if( x < -stocktickerpanel.getWidth () )
    x = getWidth ();
    stocktickerpanel.setLocation (x, 0);
    }try
    Thread.sleep (22);
    catch( InterruptedException exception )
    }).start ();
    private class StockDisp extends JLabel
    URL url;
    public StockDisp (String name, final String price)
    setText ("<html><u>"+ name +(" : ") + price + "</u></html>");
    setForeground (Color.RED);
    addMouseListener (new MouseAdapter ()
    private class Marquee extends JPanel
    {              //private JPanel panel;
    private boolean paused;
    public Marquee (String[][] texts)
    MouseListener listener = new MouseAdapter ()
    public void mouseEntered (MouseEvent event)
    paused = true;
    setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    public void mouseExited (MouseEvent event)
    paused = false;
    addMouseListener (listener);
    tickerpanel = new JPanel ();
    tickerpanel.addMouseListener (listener);
    for( int i = 0; i < texts.length; i ++ )
    if( i > 0 )
    tickerpanel.add (Box.createHorizontalStrut (20));
    }Link link = new Link (texts[i][0],texts[i][1],texts[i][2]);
    link.addMouseListener (listener);
    tickerpanel.add (link);
    tickerpanel.setLocation (0, 0);
    tickerpanel.setSize (tickerpanel.getPreferredSize ());
    add (tickerpanel);
    paused = false;
    new Thread (new Runnable ()
    public void run ()
    while( true )
    if( ! paused )
    int x = tickerpanel.getX () - 1;
    if( x < -tickerpanel.getWidth () )
    x = getWidth ();
    tickerpanel.setLocation (x, 0);
    }try
    Thread.sleep (30);
    catch( InterruptedException exception )
    }).start ();
    public Dimension getPreferredSize ()
    Dimension preferredSizeOfPanel = tickerpanel.getPreferredSize ();
    return new Dimension (preferredSizeOfPanel.width / 2, preferredSizeOfPanel.height);
    private class Link extends JLabel
    URL url;
    public Link (String type,String text, final String surl)
    setText ("<html>"+ type +(" : ") + text + "</html>");
    setForeground (Color.BLUE);
    addMouseListener (new MouseAdapter ()
    public void mouseClicked (MouseEvent event)
    {                                   //System.out.println (text);
    try
    url = new URL( surl );
    catch( MalformedURLException e )
    //System.out.println (url);
    //BrowserControl.displayURL(text);
    BrowserControl.displayURL(surl);
    private static void createAndShowGUI()
    {        //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    Test7 ticker = new Test7();
    //ticker.runClient();
    public static void main(String[] args)
    //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();

    Yeah, I would say you could use RMI no problem. You might use UDP if you need more speed, but RMI is fine and will gaurantee message delivery. You could just use JMS or messaging I suppose, or even JMX, or other of a million possible solutions.
    I guess I'd do it like this:
    Central data (network/data model) is on some server.
    When data changes on the server, push out to client (multicast if needed?)
    How and what you push (the data) depends on how much data needs to be sent and how often

  • Should I use RMI for this??

    Hi:
    I am a complete newbie on RMI, I want to know whether the following task should be achieved by using RMI. Basically, I have a java application sitting on a server machine (unix machine), and I want to be able to call that application from another client machine using the command line prompt (client machine is WIN2000). I was told to open a TCP port to do this. Umm, basically, does this task involve RMI at all?
    Please give me some general direction on this problem, thanx a lot.

    You could perform the communication as mentioned, having a process open a server socket on the server machine and wait for information to be sent from a client. You will end up defining the format and protocols used in the communications over the socket, but if sufficiently simple, this approach would work fine.
    If you want to send more complex data or commands, or invoke methods on the server from the client, RMI is a good avenue to explore. It requires some infrastructure, however: you must be running an RMIRegistry process on the server, you must properly put your stubs and interfaces somewhere they can be dynamically downloaded (or packaged up with the client), and you must work through various RMI Security issues.
    These things are not hard to pick up, however, and the RMI path in the Java Tutorial is a good place to start learning about such things.

  • Using RMI from another language

    I've been playing around with an idea of connecting to some Java library with RMI from a another programming language.
    I know that deep inside RMI uses sockets to send the data, so any language supporting sockets should be able to use RMI as well, it's a matter of creating the protocol for that language x.
    Does anyone if there's a library like this for any language?
    Is the RMI protocol free for studying? I found a couple of articles on RMI internals, but they don't go into this much of details.
    [http://www.developer.com/article.php/10915_3455311_3/Understanding-Java-RMI-Internals.htm|http://www.developer.com/article.php/10915_3455311_3/Understanding-Java-RMI-Internals.htm]
    [http://java.sun.com/developer/onlineTraining/rmi/RMI.html|http://java.sun.com/developer/onlineTraining/rmi/RMI.html]

    dave_spaghetti wrote:
    jtahlborn wrote:
    dave_spaghetti wrote:
    jtahlborn wrote:
    dave_spaghetti wrote:
    The RMI-IIOP sounds good, but the language(Flex/ActionScript) I was first thinking about does not have a CORBA support. Another need for an open source project maybe. I'll have to learn more about CORBA to see how complicated it is.doesn't flex/actionscript already have a java binding api?There's BlazeDS and GraniteDs, if that's what you meant. Those are Java EE apps running on top of an application server
    I'm thinking of something running local machine only. And like I said, I'm just thinking whether it would be possible at all.
    Edited by: dave_spaghetti on Mar 26, 2010 12:02 PMyes, that's what i was thinking of. the graniteds web page claims it runs on standalone tomcat or jetty. jetty is pretty lightweight. if it were me, i'd look at using these existing libraries before reinventing a (rather complex) wheel.Thanks for the reply and sorry for my reply coming so late.
    These are very valuable notes. I'll consider them. I think at least Tomcat has something called "embedded mode", which could be useful here.jetty has an embedded mode as well, we use it that way in our product. works great.

  • Select,delete in MS ACcess using RMI

    Hi,
    I am using RMI in order to remotely connect to an MS Access database
    But when executing the following
    Statement stmt_access;
    String res1_access = "DELETE FROM CUSTOMERS WHERE cid='"+CID+"' ";
    stmt_access.executeUpdate(res1_access);
    I am getting the error
    data type mismatch in criteria...
    Does anyone know if there is something in my statement?
    CID is a String and cid is a defined as a Text field in Access database.
    I should mention that the same statement works fine in Oracle.
    Is there any difference in the syntax of select and delete statements in MS Access?Because I suppose that the error is in thw where clause(in insert statements i don't have problems)
    I would be greatfull if someone has an idea...

    Seems to be some confusion in the above.
    You need to post the exact statements that are causing the problem.
    For your code the way to produce those is by using System.out.println() on the line before you use it. That does not mean by guessing or by printing it out twenty lines before.
    And the create statement is the one that you used to create the database, again not just a guess on your part correct?
    Keep in mind that if you do not get a SQLException then it means all of the SQL is executing correctly, but something is wrong with the data (or your presumptions about the data) which is the problem.

  • Binary file transfer using RMI

    Thanx in advance !!!
    My Query:
    Is there any restriction on the maximum size of a binary file that can be transferred over RMI?
    In an application (and as per the requirements), I am converting the file contents to a byte array on the client machine and transferring using RMI method calls. At the server side, I am reconstructing the file using the same byte array.
    Writing a Java FTP application is out of question.
    So please advise.
    Vikas

    RMI uses TCP/IP so the default should be close to the standard IP limit.

  • 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

  • How to configure OC4J using RMI/IIOP with SSL

    Any help?
    I just mange configure the OC4J using RMI/IIOP but base on
    But when I follow further to use RMI/IIOP with SSL I face the problem with: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    p/s: I use self generate keystore which should be ok as I can use it for https connection.
    Any one can help?
    Below is the OC4J log:
    D:\oc4j\j2ee\home>java -Djavax.net.debug=all -DGenerateIIOP=true -Diiop.runtime.debug=true -jar oc4j.jar
    05/02/23 16:43:16 ================ IIOPServerExtensionProvider.preInitApplicationServer
    05/02/23 16:43:38 ================= IIOPServerExtensionProvider.postInitApplicationServer
    05/02/23 16:43:38 ================== config = {SEPS={IIOP={ssl-port=5556, port=5555, ssl=true, trusted-clients=*, ssl-client-server-auth-port=5557, keystore=D:\\oc4j\\j2ee\\home\\server.keystore, keystore-password=123456, truststore=D:\\oc4j\\j2ee\\home\\server.keystore, truststore-password=123456, ClassName=com.oracle.iiop.server.IIOPServerExtensionProvider, host=localhost}}}
    05/02/23 16:43:38 ================== server.getAttributes() = {threadPool=com.evermind.server.ApplicationServerThreadPool@968fda}
    05/02/23 16:43:38 ================== pool: null
    05/02/23 16:43:38 ====================== In startServer ...
    05/02/23 16:43:38 ==================== Creating an IIOPServer ...
    05/02/23 16:43:38 ========= IIOP server being initialized
    05/02/23 16:43:38 SSL port: 5556
    05/02/23 16:43:38 SSL port 2: 5557
    05/02/23 16:43:43 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(IIOP_CLEAR_TEXT, 5555, null)
    05/02/23 16:43:43 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = IIOP_CLEAR_TEXT port = 5555 )
    05/02/23 16:43:44 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(SSL, 5556, null)
    05/02/23 16:43:44 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = SSL port = 5556 )
    05/02/23 16:43:45 ***
    05/02/23 16:43:45 found key for : mykey
    05/02/23 16:43:45 chain [0] = [
    Version: V1
    Subject: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
    Key: SunJSSE RSA public key:
    public exponent:
    010001
    modulus:
    b1239fff 2ae5d31d b01a0cfb 1186bae0 bbc7ac41 94f24464 e92a7e33 6a5b0844
    109e30fb d24ad770 99b3ff86 bd96c705 56bf2e7a b3bb9d03 40fdcc0a c9bea9a1
    c21395a4 37d8b2ce ff00eb64 e22a6dd6 97578f92 29627229 462ebfee 061c99a4
    1c69b3a0 aea6a95b 7ed3fd89 f829f17e a9362efe ccf8034a 0910989a a8573305
    Validity: [From: Wed Feb 23 15:57:28 SGT 2005,
                   To: Tue May 24 15:57:28 SGT 2005]
    Issuer: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    SerialNumber: [    421c3768]
    Algorithm: [MD5withRSA]
    Signature:
    0000: 34 F4 FA D4 6F 23 7B 84 30 42 F3 5C 4B 5E 18 17 4...o#..0B.\K^..
    0010: 73 69 73 A6 BF 9A 5D C0 67 8D C3 56 DF A9 4A AC sis...].g..V..J.
    0020: 88 AF 24 28 C9 39 16 22 29 81 01 93 86 AA 1A 5D ..$(.9.")......]
    0030: 07 89 26 22 91 F0 8F DE E1 4A CF 17 9A 02 51 7D ..&".....J....Q.
    0040: 92 D3 6D 9B EF 5E C1 C6 66 F9 11 D4 EB 13 8F 17 ..m..^..f.......
    0050: E7 66 58 9F 6C B0 60 7C 39 B4 E0 B7 04 A7 7F A6 .fX.l.`.9.......
    0060: 4D A5 89 E7 F4 8A DC 59 B4 E7 A5 D4 0A 35 9A F1 M......Y.....5..
    0070: A2 CD 3A 04 D6 8F 16 B1 9E 6F 34 40 E8 C0 47 03 ..:[email protected].
    05/02/23 16:43:45 ***
    05/02/23 16:43:45 adding as trusted cert:
    05/02/23 16:43:45 Subject: CN=Client, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    05/02/23 16:43:45 Issuer: CN=Client, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    05/02/23 16:43:45 Algorithm: RSA; Serial number: 0x421c3779
    05/02/23 16:43:45 Valid from Wed Feb 23 15:57:45 SGT 2005 until Tue May 24 15:57:45 SGT 2005
    05/02/23 16:43:45 adding as trusted cert:
    05/02/23 16:43:45 Subject: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    05/02/23 16:43:45 Issuer: CN=Server, OU=Bar, O=Foo, L=Some, ST=Where, C=UN
    05/02/23 16:43:45 Algorithm: RSA; Serial number: 0x421c3768
    05/02/23 16:43:45 Valid from Wed Feb 23 15:57:28 SGT 2005 until Tue May 24 15:57:28 SGT 2005
    05/02/23 16:43:45 trigger seeding of SecureRandom
    05/02/23 16:43:45 done seeding SecureRandom
    05/02/23 16:43:45 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): getEndpoint(SSL_MUTUALAUTH, 5557, null)
    05/02/23 16:43:45 com.sun.corba.ee.internal.iiop.GIOPImpl(Thread[Orion Launcher,5,main]): createListener( socketType = SSL_MUTUALAUTH port = 5557 )
    05/02/23 16:43:45 matching alias: mykey
    matching alias: mykey
    05/02/23 16:43:46 ORB created ..com.oracle.iiop.server.OC4JORB@65b738
    05/02/23 16:43:47 com.sun.corba.ee.internal.corba.ClientDelegate(Thread[Orion Launcher,5,main]): invoke(ClientRequest) called
    05/02/23 16:43:47 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): process: dispatching to scid 2
    05/02/23 16:43:47 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): dispatching to sc [email protected]7
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ClientDelegate(Thread[Orion Launcher,5,main]): invoke(ClientRequest) called
    05/02/23 16:43:48 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): process: dispatching to scid 2
    05/02/23 16:43:48 com.oracle.iiop.server.OC4JORB(Thread[Orion Launcher,5,main]): dispatching to sc com.sun.corba.ee.internal.corba.ServerDelegate@9300cc
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Entering dispatch method
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Consuming service contexts, GIOP version: 1.2
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Has code set context? false
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Dispatching to servant
    05/02/23 16:43:48 com.sun.corba.ee.internal.corba.ServerDelegate(Thread[Orion Launcher,5,main]): Handling invoke handler type servant
    05/02/23 16:43:48 NS service created and started ..org.omg.CosNaming._NamingContextExtStub:IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000000000001000000000000007c000102000000000c31302e312e3231342e31310015b3000000000031afabcb0000000020d309e06a0000000100000000000000010000000c4e616d65536572766963650000000004000000000a0000000000000100000001000000200000000000010001000000020501000100010020000101090000000100010100
    05/02/23 16:43:48 NS ior = ..IOR:000000000000002b49444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000000000001000000000000007c000102000000000c31302e312e3231342e31310015b3000000000031afabcb0000000020d309e06a0000000100000000000000010000000c4e616d65536572766963650000000004000000000a0000000000000100000001000000200000000000010001000000020501000100010020000101090000000100010100
    05/02/23 16:43:48 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): Server getConnection(119e583[Unknown 0x0:0x0: Socket[addr=/127.0.0.1,port=1281,localport=5556]], SSL)
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): host = 127.0.0.1 port = 1281
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Listener,5,main]): Created connection Connection[type=SSL remote_host=127.0.0.1 remote_port=1281 state=ESTABLISHED]
    com.sun.corba.ee.internal.iiop.MessageMediator(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): Creating message from stream
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, handling exception: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, SEND TLSv1 ALERT: fatal, description = unexpected_message
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, WRITE: TLSv1 Alert, length = 2
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeSocket()
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ReaderThread(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): IOException in createInputStream: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05/02/23 16:45:14 javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.d(DashoA12275)
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA12275)
    05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.messages.MessageBase.readFully(MessageBase.java:520)
    05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.messages.MessageBase.createFromStream(MessageBase.java:58)
    05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.MessageMediator.processRequest(MessageMediator.java:110)
    05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.IIOPConnection.processInput(IIOPConnection.java:339)
    05/02/23 16:45:14 at com.sun.corba.ee.internal.iiop.ReaderThread.run(ReaderThread.java:63)
    05/02/23 16:45:14 Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.InputRecord.b(DashoA12275)
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
    05/02/23 16:45:14 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    05/02/23 16:45:14 ... 6 more
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.IIOPConnection(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): purge_calls: starting: code = 1398079696 die = true
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called close()
    05/02/23 16:45:14 JavaIDL Reader for 127.0.0.1:1281, called closeInternal(true)
    05/02/23 16:45:14 com.sun.corba.ee.internal.iiop.ConnectionTable(Thread[JavaIDL Reader for 127.0.0.1:1281,5,main]): DeleteConn called: host = 127.0.0.1 port = 1281

    Good point, I do belive what you are referring to is this:
    Any client, whether running inside a server or not, has EJB security properties. Table 15-2 lists the EJB client security properties controlled by the ejb_sec.properties file. By default, OC4J searches for this file in the current directory when running as a client, or in ORACLE_HOME/j2ee/home/config when running in the server. You can specify the location of this file explicitly with the system property setting -Dejb_sec_properties_location=pathname.
    Table 15-2 EJB Client Security Properties
    Property Meaning
    # oc4j.iiop.keyStoreLoc
    The path and name of the keystore. An absolute path is recommended.
    # oc4j.iiop.keyStorePass
    The password for the keystore.
    # oc4j.iiop.trustStoreLoc
    The path name and name of the truststore. An absolute path is recommended.
    # oc4j.iiop.trustStorePass
    The password for the truststore.
    # oc4j.iiop.enable.clientauth
    Whether the client supports client-side authentication. If this property is set to true, you must specify a keystore location and password.
    # oc4j.iiop.ciphersuites
    Which cipher suites are to be enabled. The valid cipher suites are:
    TLS_RSA_WITH_RC4_128_MD5
    SSL_RSA_WITH_RC4_128_MD5
    TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
    SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
    TLS_RSA_EXPORT_WITH_RC4_40_MD5
    SSL_RSA_EXPORT_WITH_RC4_40_MD5
    TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
    SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
    nameservice.useSSL
    Whether to use SSL when making the initial connection to the server.
    client.sendpassword
    Whether to send user name and password in clear form (unencrypted) in the service context when not using SSL. If this property is set to true, the user name and password are sent only to servers listed in the trustedServer list.
    oc4j.iiop.trustedServers
    A list of servers that can be trusted to receive passwords sent in clear form. This has no effect if client.sendpassword is set to false. The list is comma-delimited. Each entry in the list can be an IP address, a host name, a host name pattern (for example, *.example.com), or * (where "*" alone means that all servers are trusted.

  • ApplicationInitialContextFactory should only be used inside Orion server :(

    Hi
    I was trying to deploy a J2EE application on OAS 10g(10.1.2 standalone)
    Please help in debugging this error which reappears every time in spite of changes made in orion-web.xml as suggested in a forum message earlier.
    ERROR javax.naming.NamingException: com.evermind.server.ApplicationInitialContextFactory should only be used inside Orion server environments. For client com.evermind.server.ApplicationClientInitialContextFactory or com.evermind.server.rmi.RMIInitialContextFactory should be used
         at com.evermind.server.PreemptiveApplicationContext.getContext(PreemptiveApplicationContext.java:31)
         at com.evermind.naming.FilterContext.lookup(FilterContext.java:138)
         at javax.naming.InitialContext.lookup(InitialContext.java:349)
         at in.co.iflex.icrs.util.ServiceLocator.getRemoteHome(ServiceLocator.java:99)
         at in.co.iflex.icrs.factory.facade.FacadeFactoryJ2EE.getSMSFacade(Unknown Source)
         at in.co.iflex.icrs.util.SessionManager.getUserNames(Unknown Source)
         at in.co.iflex.icrs.servlet.FrontViewController.loadConfiguration(FrontViewController.java:139)
         at org.apache.velocity.servlet.VelocityServlet.initVelocity(VelocityServlet.java:230)
         at org.apache.velocity.servlet.VelocityServlet.init(VelocityServlet.java:198)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
         at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2821)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:680)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    The following error appear in redirected output/errors server log file
    Error creating Tag Library Descriptor Cache : null java.lang.NullPointerException
    at oracle.jsp.parse.tldcache.ApplicationTldCacheImpl.getCurrentResources(ApplicationTldCacheImpl.java:85)
    at oracle.jsp.parse.tldcache.TldCacheImpl.initCache(TldCacheImpl.java:100)
    at oracle.jsp.parse.tldcache.ApplicationTldCacheImpl.<init>(ApplicationTldCacheImpl.java:59)
    at com.evermind.server.http.HttpApplication.initDefaultServlets(HttpApplication.java:5106)
    at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:941)
    at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
    at com.evermind.server.Application.getHttpApplication(Application.java:890)
    at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
    at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
    at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
    at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)
    at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)
    at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)
    at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)
    at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)
    at java.lang.Thread.run(Thread.java:534)
    Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
    Thanks

    Hi Avi
    I am still getting the same error .
    I already had <ejb-ref> entry in web.xml.
    <ejb-ref>
    <ejb-ref-name>SMSBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>in.co.iflex.icrs.sms.ejb.common.SMSHome</home>
    <remote>in.co.iflex.icrs.sms.ejb.common.SMSRemote</remote>
    </ejb-ref>
    Let me give more details.
    My ejb-jar.xml entry:
    <session>
         <description>SMS Bean</description>
         <display-name>SMSBean</display-name>
         <ejb-name>SMSBean</ejb-name>
         <home>in.co.iflex.icrs.sms.ejb.common.SMSHome</home>
         <remote>in.co.iflex.icrs.sms.ejb.common.SMSRemote</remote>
         <ejb-class>in.co.iflex.icrs.sms.ejb.internal.SMSFacadeBean</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>
    </session>
    The orion-web.xml entry:
    <ejb-ref-mapping name="SMSBean" />
    Folks, is anybody able to sense what is wrong here?
    Thanks

  • Remote Browsing using RMI

    Hi,
    Read a lot of forums about how to create a Remote file browser using RMI and JFileChooser.
    Not done any RMI coding I thought I'd give it a try. I have finally after 2 days managed to do it.
    This is an overview.
    Create a RemoteFile class that extends Remote.. eg.
    import java.rmi.*;
    import java.io.*;
    import java.net.*;
    public interface RemoteFile extends Remote {
        public boolean canRead() throws RemoteException;
        public boolean canWrite() throws RemoteException;
        public int compareTo(File pathname) throws RemoteException;etc.etc
    Then create an implementation class...
    import java.rmi.server.*;
    import java.io.*;
    import java.net.*;
    public class RemoteFileImpl extends UnicastRemoteObject implements RemoteFile {
        private File f;
        public RemoteFileImpl(File sf) throws java.rmi.RemoteException {
            f=sf;
        public boolean canRead() throws java.rmi.RemoteException {
            return f.canRead();
        }etc etc for all other File functions.
    Then we create a RemoteFileSystemView interface, again extending remote...
    public interface RemoteFileSystemView extends Remote {
        public RemoteFile createFileObject(File dir, String filename) throws RemoteException;
        public RemoteFile createFileObject(String path) throws RemoteException;blah blah
    Then An implementation class...
    import javax.swing.filechooser.*;
    import java.io.*;
    public class RemoteFileSystemViewImpl extends java.rmi.server.UnicastRemoteObject implements RemoteFileSystemView {
        int length;
        private FileSystemView fs;
        public RemoteFileSystemViewImpl() throws java.rmi.RemoteException {
            fs=FileSystemView.getFileSystemView();
        public RemoteFile createFileObject(String path) throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.createFileObject(path));
        public RemoteFile createFileObject(java.io.File dir, String filename) throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.createFileObject(dir,filename));
        //public RemoteFileImpl createFileSystemRoot(java.io.File f) throws java.rmi.RemoteException {
        //    return new RemoteFileImpl(fs.createFileSystemRoot(f));
        public RemoteFile createNewFolder(java.io.File containingDir) throws java.rmi.RemoteException {
            RemoteFile tempf;
            try{
                tempf= new RemoteFileImpl(fs.createNewFolder(containingDir));
            } catch (IOException e){System.out.println(e); tempf=null;}
            return  tempf;
        public RemoteFile getDefaultDirectory() throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.getDefaultDirectory());
        public String[] getFiles(java.io.File dir, boolean useFileHiding) throws java.rmi.RemoteException {
            String[] tempf= new String[fs.getFiles(dir,useFileHiding).length];
            int i;
            File[] f = fs.getFiles(dir,useFileHiding);
            for(i=0;i<tempf.length;i++) tempf=f[i].toString();
    return tempf;
    public RemoteFile getHomeDirectory() throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getHomeDirectory());
    public RemoteFile getParentDirectory(java.io.File dir) throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getParentDirectory(dir));
    public String[] getRoots() throws java.rmi.RemoteException {
    String[] tempf= new String[fs.getRoots().length];
    System.out.println("fs is-"+fs.getRoots().length);
    int i;
    File[] f = fs.getRoots();
    for(i=0;i<tempf.length;i++) {tempf[i]=f[i].toString();}
    System.out.println("Roots="+tempf[0]);
    return tempf;
    public String getSystemDisplayName(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemDisplayName(f);
    public javax.swing.Icon getSystemIcon(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemIcon(f);
    public String getSystemTypeDescription(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemTypeDescription(f);
    public boolean isComputerNode(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isComputerNode(dir);
    public boolean isDrive(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isDrive(dir);
    public boolean isFileSystem(java.io.File f) throws java.rmi.RemoteException {
    return fs.isFileSystem(f);
    public boolean isFileSystemRoot(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isFileSystemRoot(dir);
    public boolean isFloppyDrive(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isFloppyDrive(dir);
    public boolean isHiddenFile(java.io.File f) throws java.rmi.RemoteException {
    return fs.isHiddenFile(f);
    public boolean isParent(java.io.File folder, java.io.File file) throws java.rmi.RemoteException {
    return fs.isParent(folder,file);
    public boolean isRoot(java.io.File f) throws java.rmi.RemoteException {
    return fs.isRoot(f);
    public Boolean isTraversable(java.io.File f) throws java.rmi.RemoteException {
    return fs.isTraversable(f);
    public RemoteFile getChild(File parent, String fileName) throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getChild(parent,fileName));
    Notice that whenever I should be passing a File, I pass a RemoteFile instead! Also.. when I am passing a File Array, I instead pass a String array. Reason is.. I havent managed to get File arrays through RMI.. Any Help anyone?!?!?!?!
    I got round it by simply passing a String array and relying on the client to reconstruct a File array locally using the String array. Messy... perhaps.. any suggestions welcome!
    Next.. use rmic to create Stubs and Skels for the 2 implementations and write an RMI server.. eg.
    import java.rmi.Naming;
    public class RemoteServerRMI {
        /** Creates a new instance of RemoteServerRMI */
        public RemoteServerRMI() {
            try {
                RemoteFileSystemView c = new RemoteFileSystemViewImpl();
                Naming.rebind("rmi://localhost:1099/FileService", c);
            } catch (Exception e) {
                System.out.println("Trouble: " + e);
        public static void main(String[] args) {
            new RemoteServerRMI();
    }Yes.. simple and shamelessly lifted from the tutorials.
    and Finally the client....
    import javax.swing.filechooser.*;
    import java.rmi.*;
    import java.net.MalformedURLException;
    import java.io.*;
    import javax.swing.*;
    public class RemoteFileSystemViewClient extends FileSystemView {
        static RemoteFileSystemView c;
        public RemoteFileSystemViewClient() {
            try {
                c = (RemoteFileSystemView) Naming.lookup("rmi://localhost:1099/FileService");
            catch (MalformedURLException murle) {
                System.out.println();
                System.out.println(
                "MalformedURLException");
                System.out.println(murle);
            catch (RemoteException re) {
                System.out.println();
                System.out.println(
                "RemoteException");
                System.out.println(re);
            catch (NotBoundException nbe) {
                System.out.println();
                System.out.println(
                "NotBoundException");
                System.out.println(nbe);
        public File getHomeDirectory() {
            File tempf;
            try {
                tempf= new File(c.getHomeDirectory().gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createFileObject(File dir, String filename) {
            File tempf;
            try {
                tempf= new File(c.createFileObject(dir, filename).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createFileObject(String path) {
            File tempf;
            try {
                tempf=new File(c.createFileObject(path).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createNewFolder(File containingDir) throws RemoteException {
            File tempf;
            try {
                tempf=new File(c.createNewFolder(containingDir).getAbsolutePath());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File getChild(File parent, String fileName) {
            File tempf;
            try {
                tempf=new File(c.getChild(parent,fileName).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File getDefaultDirectory() {
            File tempf;
            try {
                tempf=new File(c.getDefaultDirectory().gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File[] getFiles(File dir, boolean useFileHiding) {
            File[] tempf;
            try {
                tempf=new File[c.getFiles(dir,useFileHiding).length];
                String[] rtempf=c.getFiles(dir, useFileHiding);
                int i;
                for(i=0;i<c.getFiles(dir, useFileHiding).length;i++) tempf=new File(rtempf[i]);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public File getParentDirectory(File dir) {
    File tempf;
    try {
    tempf= new File(c.getParentDirectory(dir).gettoString());
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public File[] getRoots(){
    File[] tempf;
    try {
    String[] rtempf= c.getRoots();
    System.out.println("in");
    tempf=new File[rtempf.length];
    int i;
    for(i=0;i<c.getRoots().length;i++) tempf[i]=new File(rtempf[i]);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public String getSystemDisplayName(File f) {
    String tempf;
    try{
    tempf=c.getSystemDisplayName(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public javax.swing.Icon getSystemIcon(File f) {
    javax.swing.Icon tempf;
    try{
    tempf=c.getSystemIcon(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public String getSystemTypeDescription(File f) {
    String tempf;
    try {
    tempf=c.getSystemTypeDescription(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public boolean isComputerNode(File dir) {
    boolean tempf;
    try {
    tempf= c.isComputerNode(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isDrive(File dir) {
    boolean tempf;
    try {
    tempf= c.isDrive(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFileSystem(File f) {
    boolean tempf;
    try {
    tempf= c.isFileSystem(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFileSystemRoot(File dir) {
    boolean tempf;
    try {
    tempf= c.isFileSystemRoot(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFloppyDrive(File dir) {
    boolean tempf;
    try {
    tempf= c.isFloppyDrive(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isHiddenFile(File f) {
    boolean tempf;
    try {
    tempf= c.isHiddenFile(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isParent(File folder, File file) {
    boolean tempf;
    try {
    tempf= c.isParent(folder,file);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isRoot(File f) {
    boolean tempf;
    try {
    tempf= c.isRoot(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public Boolean isTraversable(File f) {
    Boolean tempf;
    try {
    tempf= c.isTraversable(f);
    } catch (RemoteException re){System.out.println(re);tempf=new Boolean(false);}
    return tempf;
    public static void main(String[] args) {
    RemoteFileSystemViewClient rc = new RemoteFileSystemViewClient();
    JFileChooser fch= new JFileChooser(rc);
    fch.showOpenDialog(null);
    Notice.. the getFiles and getRoots, procedures, get String arrays from the RMI and reconstruct local File arrays.
    I managed to browse up and down directories with this, and even.. to my surprise, create folders!
    If you got any improvements please let me know at [email protected]

    Copyright &copy; Esmond Pitt, 2007. All rights reserved.
    * RemoteFileSystem.java
    * Created on 13 May 2007, 14:39
    import java.io.File;
    import java.io.IOException;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.swing.Icon;
    * @author Esmond Pitt
    public interface RemoteFileSystem extends Remote
         File createFileObject(String path) throws RemoteException;
         File[] getFiles(File dir, boolean useFileHiding) throws RemoteException;
         File createFileObject(File dir, String filename) throws RemoteException;
         File getChild(File parent, String fileName) throws RemoteException;
         boolean isFloppyDrive(File dir) throws RemoteException;
         boolean isFileSystemRoot(File dir) throws RemoteException;
         boolean isFileSystem(File f) throws RemoteException;
         boolean isDrive(File dir) throws RemoteException;
         boolean isComputerNode(File dir) throws RemoteException;
         File createNewFolder(File containingDir) throws RemoteException, IOException;
         File getParentDirectory(File dir) throws RemoteException;
         String getSystemDisplayName(File f) throws RemoteException;
         Icon getSystemIcon(File f) throws RemoteException;
         String getSystemTypeDescription(File f) throws RemoteException;
         File getDefaultDirectory() throws RemoteException;
         File getHomeDirectory() throws RemoteException;
         File[] getRoots() throws RemoteException;
         // File     createFileSystemRoot(File f) throws RemoteException;
    import java.io.File;
    import java.io.IOException;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.Icon;
    import javax.swing.filechooser.FileSystemView;
    * @author Esmond Pitt
    * @version $Revision: 3 $
    public class RemoteFileSystemServer extends UnicastRemoteObject implements RemoteFileSystem
         private FileSystemView     fs = FileSystemView.getFileSystemView();
         private Logger     logger = Logger.getLogger(this.getClass().getName());
         /** Creates a new instance of RemoteFileSystemServer */
         public RemoteFileSystemServer(int port) throws RemoteException
              super(port);
              logger.log(Level.INFO, "exported on port {0} and receiving calls fs={1}", new Object[]{port, fs});
         public File createFileObject(String path)
              logger.log(Level.FINE, "createFileObject({0})", path);
              return fs.createFileObject(path);
         public File createFileObject(File dir, String filename)
              logger.log(Level.FINE, "createFileObject({0},{1})", new Object[]{dir, filename});
              return fs.createFileObject(dir, filename);
         public File[] getFiles(File dir, boolean useFileHiding)
              logger.log(Level.FINE, "getFiles({0},{1})", new Object[]{dir, useFileHiding});
              return fs.getFiles(dir, useFileHiding);
         public File getChild(File parent, String fileName)
              logger.log(Level.FINE, "getChild({0},{1})", new Object[]{parent, fileName});
              return fs.getChild(parent, fileName);
         public boolean isFloppyDrive(File dir)
              logger.log(Level.FINE, "isFloppyDrive({0})", dir);
              return fs.isFloppyDrive(dir);
         public boolean isFileSystemRoot(File dir)
              logger.log(Level.FINE, "isFileSystemRoot({0})", dir);
              return fs.isFileSystemRoot(dir);
         public boolean isFileSystem(File f)
              logger.log(Level.FINE, "isFileSystem({0})", f);
              return fs.isFileSystem(f);
         public boolean isDrive(File dir)
              logger.log(Level.FINE, "isDrive({0})", dir);
              return fs.isDrive(dir);
         public boolean isComputerNode(File dir)
              logger.log(Level.FINE, "isComputerNode({0})", dir);
              return fs.isComputerNode(dir);
         public File createNewFolder(File containingDir) throws IOException
              logger.log(Level.FINE, "createNewFolder({0})", containingDir);
              return fs.createNewFolder(containingDir);
         public File getParentDirectory(File dir)
              logger.log(Level.FINE, "getParentDirectory({0})", dir);
              return fs.getParentDirectory(dir);
         public String getSystemDisplayName(File f)
              logger.log(Level.FINE, "getSystemDisplayName({0})", f);
              return fs.getSystemDisplayName(f);
         public Icon getSystemIcon(File f)
              logger.log(Level.FINE, "getSystemIcon({0})", f);
              return fs.getSystemIcon(f);
         public String getSystemTypeDescription(File f)
              logger.log(Level.FINE, "getSystemTypeDescription({0})", f);
              return fs.getSystemTypeDescription(f);
         public File getDefaultDirectory()
              logger.log(Level.FINE, "getDefaultDirectory()");
              return fs.getDefaultDirectory();
         public File getHomeDirectory()
              logger.log(Level.FINE, "getHomeDirectory()");
              return fs.getHomeDirectory();
         public File[] getRoots()
              logger.log(Level.FINE, "getRoots()");
              return fs.getRoots();
          public File createFileSystemRoot(File f)
              return fs.createFileSystemRoot(f);
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.rmi.Naming;
    import java.rmi.NotBoundException;
    import java.rmi.RemoteException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.Icon;
    import javax.swing.filechooser.FileSystemView;
    * @author Esmond Pitt
    * @version $Revision: 4 $
    public class RemoteFileSystemView extends FileSystemView
         private Logger     logger = Logger.getLogger(this.getClass().getName());
         private RemoteFileSystem     fs;
         public RemoteFileSystemView(String host)
         throws NotBoundException, RemoteException, MalformedURLException
              String     url = "rmi://"+host+"/"+RemoteFileSystem.class.getName();
              this.fs = (RemoteFileSystem)Naming.lookup(url);
              logger.log(Level.INFO, "Connected to {0} via {1}", new Object[]{url, fs});
         public File createFileObject(String path)
              logger.entering(this.getClass().getName(), "createFileObject", path);
              try
                   return fs.createFileObject(path);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "path="+path, exc);
                   return null;
         public File[] getFiles(File dir, boolean useFileHiding)
              logger.entering(this.getClass().getName(), "getFiles", new Object[]{dir, useFileHiding});
              try
                   return fs.getFiles(dir, useFileHiding);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir+" useFileHiding="+useFileHiding, exc);
                   return null;
         public File createFileObject(File dir, String filename)
              logger.entering(this.getClass().getName(), "createFileObject", new Object[]{dir, filename});
              try
                   return fs.createFileObject(dir, filename);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir+" filename="+filename, exc);
                   return null;
         public File getChild(File parent, String fileName)
              logger.entering(this.getClass().getName(), "getChild", new Object[]{parent, fileName});
              try
                   return fs.getChild(parent, fileName);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "parent="+parent+" fileName="+fileName, exc);
                   return null;
         public boolean isFloppyDrive(File dir)
              logger.entering(this.getClass().getName(), "isFloppyDrive", dir);
              try
                   return fs.isFloppyDrive(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isFileSystemRoot(File dir)
              logger.entering(this.getClass().getName(), "isFileSystemRoot", dir);
              try
                   return fs.isFileSystemRoot(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isFileSystem(File file)
              logger.entering(this.getClass().getName(), "isFileSystem", file);
              try
                   return fs.isFileSystem(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return false;
         public boolean isDrive(File dir)
              logger.entering(this.getClass().getName(), "isDrive", dir);
              try
                   return fs.isDrive(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isComputerNode(File dir)
              logger.entering(this.getClass().getName(), "isComputerNode", dir);
              try
                   return fs.isComputerNode(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public File createNewFolder(File containingDir) throws IOException
              logger.entering(this.getClass().getName(), "createNewFolder", containingDir);
              try
                   return fs.createNewFolder(containingDir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "containingDir="+containingDir, exc);
                   return null;
         public File getParentDirectory(File dir)
              logger.entering(this.getClass().getName(), "getParentDirectory", dir);
              try
                   return fs.getParentDirectory(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return null;
         public String getSystemDisplayName(File file)
              logger.entering(this.getClass().getName(), "getSystemDisplayName", file);
              try
                   return fs.getSystemDisplayName(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public Icon getSystemIcon(File file)
              logger.entering(this.getClass().getName(), "getSystemIcon", file);
              try
                   return fs.getSystemIcon(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public String getSystemTypeDescription(File file)
              logger.entering(this.getClass().getName(), "getSystemTypeDescription", file);
              try
                   return fs.getSystemTypeDescription(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public File getDefaultDirectory()
              logger.entering(this.getClass().getName(), "getDefaultDirectory");
              try
                   return fs.getDefaultDirectory();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getDefaultDirectory()", exc);
                   return null;
         public File getHomeDirectory()
              logger.entering(this.getClass().getName(), "getHomeDirectory");
              try
                   return fs.getHomeDirectory();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getHomeDirectory()", exc);
                   return null;
         public File[] getRoots()
              logger.entering(this.getClass().getName(), "getRoots");
              try
                   return fs.getRoots();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getRoots()", exc);
                   return null;
         protected File createFileSystemRoot(File file)
              logger.entering(this.getClass().getName(), "createFileSystemRoot", file);
              logger.log(Level.SEVERE, "createFileSystemRoot called with ({0})", new Object[]{file});
              try
                   return fs.createFileSystemRoot(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "", exc);
              return null;
    }

  • Class loading using rmi

    Hi
    I am developing my application as an applet .I use JMF in my application for media streaming. I need the required classes in javax.media and com.ibm( Really this does n't matter. I want to load some classes not written by me ) from a remote machine as reqiured in order to minimise the size of the applet. I cant define any interface since these are not my classes.Can any body give an idea regarding this
    A reply will be gratefully acknowledged
    Thank you

    The server must have all of the following class files in its class path:
    implementation (of course)
    interface
    stubs
    skeletons (if not using RMI version 1.2 stubs)
    The client should have only:
    implementation (of the client)
    interface
    The web server should have
    stubs
    any class files that are used on the server as return arguments for RMI calls that are not in the client.
    The classpath of rmiregistry should be empty
    The server's codebase should point to the root directory or jar file on the web server where the class files are located.
    Look at the web server's log files to see what files the client and rmiregistry are trying to load if you are getting errors.

  • Using RMI from applets

    Hi everyone,
    I have an applet that uses RMI to communicate with an RMI registry that is on the originating server for the applet. To enable the applet to make RMI calls over port 1099 I have had to modify the policy file of my Java plug-in (to grant socket permissions to the server over port 1099).
    My understanding was that applets by default were able to communicate with their originating servers. Is this correct?
    I am asking because I want end-users to be able to use this applet in their browsers without having to perform any security configurations. At the moment, if they don't have a Java plug-in, one will be automatically downloaded and installed on their system (which is great). But, as the application currently stands, they will then have to make an additonal step to modify their policy file.
    This doesn't seem right to be. Any suggestions?
    Thanks in advance.
    Kind regards,
    Ben Deany

    I tried this a couple of years ago. In theory, it should work. If I remember correctly, I believe that the RMI API kept trying to crawl out of the sandbox by doing things that seemed to have no relation to RMI. Finally, I got a certificate and life got much simpler.

  • Actually in my project The middle tier was written using RMI.The Database i

    Actually in my project The middle tier was written using RMI.The Database interaction was defined in the middle
    tier itself.My problem is , the queries we post to the database should interact with XML Database which in turn should
    interact with the actual Relational Database from which the XML Database was built.
    Thanks in Advance

    Leave the phone alone and let it cool down.

  • How to call java stored procedure using RMI?

    Is it possible to make a call to java stored procedure using RMI. ?
    How can I run the RMI registry on the Oracle Server ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Thomas Grounds ([email protected]):
    Is it possible to make a call to java stored procedure using RMI. ?
    In principle it is possible. See the Java-Doc.s of Oracle 8.1.6.
    I have successful granted the java.net.SocketPermissions in my USER_JAVA_POLICY view (see Doc.) Now I was able to use the RMI-Sockets, but following
    failure try to connect to RMI-Object via RMIregistry an Oracle Error occurs
    ORA-03113: end-of-file on communication channel
    and after that my Oracle Connection is closed.
    How can I run the RMI registry on the Oracle Server ?<HR></BLOCKQUOTE>
    I think you do not need the RMI registry on Oracle Server. It should be possible to start the RMI registry wherever you want in your network and access it via the right registry string.
    Ciao
    Margit
    null

  • To call methods inside the same application is possible to use RMI ?

    hello,
    What I should like to know is if RMI can easily be used to implement comunication (calling methods) inside classes that are part of the one same application... This should be a restrict case to use RMI...
    The reason to do it come from the need to use the instance of a class knonwing it only as Object... This can be good to do if some code is used for general pupose in many different contexts.
    In this case you can pass to the "server class" a parameter 'o' of type Object (all the classes extend Object) of the "customer class" to get back informations if some elaboration happen inside the "server class"...
    This purpose is generally implemented with event listeners, but perhaps it could be done easily using RMI too (I dont know it...).
    Using RMI in this simple situation, don't should require anything of complicate (stub, .... mashalling parametres....) to have the reference to method of the "customer class" to call. The "server class" already recives a reference of the "customer class" how parameter of type Object, and the mame of the method too.
    I propose a simple thoeric example to explain really what I said before:
    Class Server {
        String methodName;
        Object obj;
        pubic Server( Oject o , String metName){  // constructor
            obj = o;
            methodName = metName;
            // some thing is done and, at last, the method callbakMethod() is executed
            callbakMethod();
        }// constructor
        public void callbakMethod(){ // this method have the purpose to call customerMethod()
              Class c = owner.getClass();                            
              Method m = null;
                  try {
                          m = c.getMethod("callBackMethod",null);     
                         * // (1)
                          // I think that here we could have the possibility to call
                          // the method  customerMethod() belonging to class Customer..
                          // I don't know if it possible and  ...  (and if it is possible) I am not able to do it*
        }// callbakMethod()
    }  // class Server
    Class Custmer{
        public Customer() { // constructor
              Server s = new Server (this, "customerMethod");
        } // constructor
        customerMethod() {    // I would this method is called from class Server
            // do some thing.....
        }  //customerMethod
    }  // class CustomerMy ask is: it is possible to call customerMethod() from the Server class ?...
    If the aswer is yes, I wold know the sintax to use to do it, please.
    thank you
    regards
    tonyMrsangelo

    RMI doesn't help you in the slightest here. You can just realize it all using local method invocation. All RMI does is to make that remote. If the objects aren't remote there is no point.

Maybe you are looking for

  • One page in my site has 3 columns but when I publish the site it shows up with 2 columns

    I set up the site with 2 columns per page, except for one page which has 3 columns. I looks right in iweb, but when I publish the site it still shows up with 2 columns like the other pages...any idea how to correct that?

  • Acrobat 3D and Tablet-PC journal file

    I have a Tablet-PC (Toshiba M205-S810) and the Journal program, pen based, creates *.jnt files. I just tried printing a PDF from a *.jnt (journal) file, and the PDF is full of "giberish", ASII characters all over the page. I can print a PDF from Jour

  • Problem getting layers panel to show.

    I cannot get the layers panel to show even though it is checked.  Using CC 2014, OS 10.10.1 Affects all my Illustrator files.

  • Google chrome & Internet explorer is not working in my windows 7 professional "

    Hi  Team I m facing the issue that , when i sent any screenshot from my gmail account using google chrome & IE , it display that not responding & close the program" as i have clean format my windows 7 & after that still issue is same please help me

  • Additional sap objects links in dms

    hi, all i have an issue in dms. 1] the custemer needs dms link with routing 2] needs dms link with bom header and bom item i think, case 1. needs additional object setting, plz explain in details case 2 .dms not allows to link bom header and bom item