UnmarshalException, client and rmi

Hello,
I'm developing client/server application using RMI. The problem occurs when I want to run it all and test. I do as follows:
(first of all, I compile each project (server and client) from Eclipse.
then with server:
rmic engine/ServerImplementation.class
start rmiregistry
java SpikServerand with client:
java -Djava.security.policy=c:\wideopen.policy SpikClient 127.0.0.1and then I receive such an errors:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: engine.ServerImplementation_Stub
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at java.rmi.Naming.lookup(Unknown Source)
        at engine.ClientImplementation.connect(ClientImplementation.java:44)
        at userInterface.Console.run(Console.java:19)
        at SpikClient.main(SpikClient.java:9)
Caused by: java.lang.ClassNotFoundException: engine.ServerImplementation_Stub
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
        at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
        at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
        at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
        at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
        at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        ... 5 moreHow can I fix it? Any suggestions are welcome. If more information are required just let me know, I will deliver them.
Kind regards,
John.

I read that part of a faq but still I don't know what should I do. I don't want to use http or ftp protocols to transfer needed data. On the other hand I can run an example from this page: http://www.javacamp.org/moreclasses/rmi/rmi6.html without any problem. I also read that before running rmiregistry the classpath should be unset. And I do so but after starting rmiregistry I have to set classpath to make work derby database (set CLASSPATH=C:\eclipse-java-europa-win32\eclipse\plugins\org.apache.derby.core_10.3.2\derby.jar;C:\eclipse-java-europa-win32\eclipse\plugins\org.apache.derby.core_10.3.2\derbytools.jar;.)
so maybe that's the problem? What do you think about this?

Similar Messages

  • Distributed transactions across RMI-IIOP client to RMI-IIOP server do not work

    Hi,
              Based on the links below:
              http://e-docs.bea.com/wls/docs61/jta/trxrmi.html#1018506
              http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
              It appears that is possible to have distributed transactions across RMI-IIOP
              clients and RMI-IIOP applications (servers).
              I followed up the "Transactions Sample RMI Code" section but it appears that
              the transaction context is not propagated from client to server. I am also
              surprised by the note:
              Note: These code fragments do not derive from any of the sample applications
              that ship with WebLogic Server. They merely illustrate the use of the
              UserTransaction object within an RMI application.
              The above note suggests that there is no sample code available.
              Is there anyone who successfully had RMI-IIOP applications (servers)
              participating in distributed transactions?
              Is there any sample code that illustrates RMI-IIOP applications (servers)
              participating in distributed transactions?
              If anyone thinks that this should work I will post my code that does not
              work.
              Regards,
              Dan Cimpoesu
              

    But if you look to the diagram:
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1040200
    it suggests that transactional context is passed from clients to RMI-IIOP
    servers.
    Am I wrong?
    Dan
    "Andy Piper" <[email protected]> wrote in message
    news:[email protected]..
    "Dan Cimpoesu" <[email protected]> writes:
    Transactions over IIOP are not supported or implemented in WLS 6.1 or
    previous. This is a feature of WLS 7.0. In 7.0 we implement OTS.
    andy
    Hi,
    Based on the links below:
    http://e-docs.bea.com/wls/docs61/jta/trxrmi.html#1018506
    http://e-docs.bea.com/wls/docs61/jta/gstrx.html#1067532
    It appears that is possible to have distributed transactions across
    RMI-IIOP
    clients and RMI-IIOP applications (servers).
    I followed up the "Transactions Sample RMI Code" section but it appearsthat
    the transaction context is not propagated from client to server. I amalso
    surprised by the note:
    Note: These code fragments do not derive from any of the sampleapplications
    that ship with WebLogic Server. They merely illustrate the use of the
    UserTransaction object within an RMI application.
    The above note suggests that there is no sample code available.
    Is there anyone who successfully had RMI-IIOP applications (servers)
    participating in distributed transactions?
    Is there any sample code that illustrates RMI-IIOP applications(servers)
    participating in distributed transactions?
    If anyone thinks that this should work I will post my code that does not
    work.
    Regards,
    Dan Cimpoesu

  • SSL and RMI: Client hangs when trying to connect

    Hi all,
    Sorry for the cross-posting (I first posted to the RMI forum) but I thought someone here might be able to shed some light. The original message follows.
    I have a very simple client/server model implemented using RMI. Previously I used the default socket factories for creating sockets/connections and everything worked fine, but now I want to use SSL to encrypt all the traffic and I'm running into some trouble. The client is able to get the correct remote registry on the correct port, but when it tries to do registry.lookup("ServerName") to get a reference to the server object, it hangs indefinitely.
    Briefly, here are the changes from default RMI:
    As the docs suggested, I created a pair of custom socket factory classes (one for the client and one for the server) that create SSL sockets, and I put the following line in my server's constructor:
    super(0, new CustomClientSocketFactory(), new CustomServerSocketFactory());
    [my server extends UnicastRemoteObject].
    The custom factories are quite simple; the client consists of:
    public class CustomClientSocketFactory implements RMIClientSocketFactory, Serializable {
    public Socket createSocket(final String iHost, final int iPort) throws IOException {
    return SSLSocketFactory.getDefault().createSocket(iHost, iPort);
    and the server:
    public class CustomServerSocketFactory implements RMIServerSocketFactory {
    public ServerSocket createServerSocket(final int iPort) throws IOException {
    return SSLServerSocketFactory.getDefault().createServerSocket(iPort);
    Everything else is the same as before. I start the server on the remote machine, which starts its own registry on a certain port; then I start the client on the local machine. The client gets the registry and then ... nothing happens.
    I know this is somewhat vague, but the changes are small from the working code so I must be doing something wrong in creating SSL sockets. Is there something I can do to trace the process or figure out what's causing the hang? Am I missing some required authentication or other code in the server socket factory (my understanding from the docs is that authentication is optional)? Any other ideas about what's going on?
    Thanks,
    - Matt

    Matt, did you ever determine anything about your Strange Behavior #2. I'm running int the exact same issue. We've been using JSSE without problem for more than 2 years now. I'm currently trying to connect to a new SSL server and the connections setup is taking about 4 minutes (not the SecureRandom seeding) (see my comment in the trace: "this is where it sits for about 3 minutes")
    Trace:
    init context
    trigger seeding of SecureRandom
    done seeding SecureRandom
    %% No cached client session
    *** ClientHello, v3.1
    RandomCookie: GMT: 1005755098 bytes = { 7, 203, 184, 206, 249, 120, 35, 155, 160, 131, 72, 68, 12, 35, 64, 75, 63, 202, 161, 95, 42, 130, 74, 248, 145, 108, 49, 189 }
    Session ID: {}
    Cipher Suites: { 0, 5, 0, 4, 0, 9, 0, 10, 0, 18, 0, 19, 0, 3, 0, 17 }
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 59
    0000: 01 00 00 37 03 01 3C F3 9B DA 07 CB B8 CE F9 78 ...7..<........x
    0010: 23 9B A0 83 48 44 0C 23 40 4B 3F CA A1 5F 2A 82 #...HD.#@K?.._*.
    0020: 4A F8 91 6C 31 BD 00 00 10 00 05 00 04 00 09 00 J..l1...........
    0030: 0A 00 12 00 13 00 03 00 11 01 00 ...........
    SbATAOutAdapter, WRITE: SSL v3.1 Handshake, length = 59
    [write] MD5 and SHA1 hashes: len = 77
    0000: 01 03 01 00 24 00 00 00 20 00 00 05 00 00 04 01 ....$... .......
    0010: 00 80 00 00 09 06 00 40 00 00 0A 07 00 C0 00 00 .......@........
    0020: 12 00 00 13 00 00 03 02 00 80 00 00 11 3C F3 9B .............<..
    0030: DA 07 CB B8 CE F9 78 23 9B A0 83 48 44 0C 23 40 ......x#...HD.#@
    0040: 4B 3F CA A1 5F 2A 82 4A F8 91 6C 31 BD K?.._*.J..l1.
    SbATAOutAdapter, WRITE: SSL v2, contentType = 22, translated length = 16310
    !!! This is where it sits for about 3 minutes !!!!
    %% No cached client session
    *** ClientHello, v3.1
    RandomCookie: GMT: 1005755287 bytes = { 8, 151, 45, 75, 86, 164, 141, 52, 216, 145, 81, 24, 157, 215, 246, 206, 87, 83, 153, 41, 88, 38, 3, 119, 190, 13, 0, 28 }
    Session ID: {}
    Cipher Suites: { 0, 5, 0, 4, 0, 9, 0, 10, 0, 18, 0, 19, 0, 3, 0, 17 }
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 59
    0000: 01 00 00 37 03 01 3C F3 9C 97 08 97 2D 4B 56 A4 ...7..<.....-KV.
    0010: 8D 34 D8 91 51 18 9D D7 F6 CE 57 53 99 29 58 26 .4..Q.....WS.)X&
    0020: 03 77 BE 0D 00 1C 00 00 10 00 05 00 04 00 09 00 .w..............
    0030: 0A 00 12 00 13 00 03 00 11 01 00 ...........
    SbATAOutAdapter, WRITE: SSL v3.1 Handshake, length = 59
    [write] MD5 and SHA1 hashes: len = 77
    0000: 01 03 01 00 24 00 00 00 20 00 00 05 00 00 04 01 ....$... .......
    0010: 00 80 00 00 09 06 00 40 00 00 0A 07 00 C0 00 00 .......@........
    0020: 12 00 00 13 00 00 03 02 00 80 00 00 11 3C F3 9C .............<..
    0030: 97 08 97 2D 4B 56 A4 8D 34 D8 91 51 18 9D D7 F6 ...-KV..4..Q....
    0040: CE 57 53 99 29 58 26 03 77 BE 0D 00 1C .WS.)X&.w....
    SbATAOutAdapter, WRITE: SSL v2, contentType = 22, translated length = 16310
    SbATAOutAdapter, READ: SSL v3.1 Handshake, length = 74
    *** ServerHello, v3.1
    RandomCookie: GMT: 1005755466 bytes = { 145, 7, 69, 98, 152, 52, 222, 159, 96, 162, 220, 85, 77, 107, 82, 203, 25, 94, 208, 124, 2, 245, 96, 208, 224, 254, 139, 206 }
    Session ID: {68, 7, 167, 168, 236, 202, 48, 147, 191, 204, 208, 122, 24, 43, 132, 50, 65, 220, 172, 189, 17, 18, 197, 11, 150, 59, 201, 103, 86, 176, 115, 68}
    Cipher Suite: { 0, 5 }
    Compression Method: 0
    %% Created: [Session-1, SSL_RSA_WITH_RC4_128_SHA]
    ** SSL_RSA_WITH_RC4_128_SHA
    Anybody have any ideas?
    Thanks,
    Marcel

  • 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

  • Conflict between socket and RMI

    Hi
    I wrote a program in client-server using socket and it was fine. I also wrote a client-server program using RMI. Fine as well. But after I connected the client-server using socket (open socket, send-receive messages, close socket), then use RMI. I got java.rmi.NotBoundException.
    Would anyone have a look and provide your feedback please? Thanks.
    big J
    *****************this is Server.java ***************************
    package single;
    import java.io.*;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.net.*;
    import java.rmi.*;
    public class Server
    extends Thread {
    public static final int SOCKETPORT = 5555;
    private String serverName;
    public Server() throws IOException {
    System.out.println("*** socket opened ***");
    serverName = new String("localhost");
    ServerSocket serverSocket = new ServerSocket(SOCKETPORT);
    Socket socket = serverSocket.accept();
    InputStream is = socket.getInputStream();
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
    System.out.println(bufferedReader.readLine());
    OutputStream os = socket.getOutputStream();
    PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os), true);
    printWriter.println("from server");
    os.close();
    is.close();
    socket.close();
    System.out.println("*** socket closed ***");
    public void runServer() {
    System.out.println("*** start of run():RMI ***");
    System.setSecurityManager(new SecurityManager());
    try {
    RMIInterfaceImpl rMIInterfaceImpl = new RMIInterfaceImpl();
    Naming.bind("//" + serverName + ":9999/RMIInterface", rMIInterfaceImpl);
    catch (RemoteException ex) {
    catch (MalformedURLException ex) {
    catch (AlreadyBoundException ex) {
    System.out.println("*** end of run():RMI ***");
    public static void main(String args[]) throws Exception {
    Server server = new Server();
    server.runServer();
    ******************this is Client.java **************************
    package single;
    import java.io.*;
    import java.net.*;
    import java.rmi.Naming;
    public class Client {
    private String serverName;
    private final static int SOCKETPORT = 5555;
    public Client() throws IOException {
    serverName = new String("localhost");
    Socket socket = new Socket(serverName, SOCKETPORT);
    OutputStream os = socket.getOutputStream();
    PrintWriter printWriter=new PrintWriter(os, true);
    printWriter.println("from client");
    InputStream is = socket.getInputStream();
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
    System.out.println(bufferedReader.readLine());
    is.close();
    os.close();
    socket.close();
    public void runClient() throws Exception {
    System.out.println("*** start of runClient():RMI ***");
    System.setSecurityManager(new SecurityManager());
    RMIInterface rMIInterfaceImpl = (RMIInterface) Naming.lookup(
    "//" + serverName + ":9999/RMIInterface");
    String str = rMIInterfaceImpl.print();
    System.out.println(str);
    rMIInterfaceImpl.serverSide();
    System.out.println("*** end of runClient():RMI ***");
    public static void main(String args[]) throws Exception {
    Client client = new Client();
    client.runClient();
    ***************** this is RMIInterface.java ***********************
    package single;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    interface RMIInterface
    extends Remote {
    String print() throws RemoteException;
    void serverSide() throws RemoteException;
    ********************* this is RMIInterfaceImpl.java ***************
    package single;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    public class RMIInterfaceImpl
    extends UnicastRemoteObject
    implements RMIInterface {
    public RMIInterfaceImpl() throws RemoteException {}
    public String print() {
    return new String("hello world");
    public void serverSide(){
    System.out.println("this should appear in serverside");

    I think you have a timing problem between your client and server. As soon as your client and server programs have finished their socket communication, they will both do their "runServer"/"runClient" methods. If the client attempts to lookup the server before the server has registered itself via Naming.bind(), I would expect that's why you're getting a NotBoundException in the client.
    You probably wouldn't use the design of your test client/server for something significant, but a quick and dirty way to make this work might be to have the client call Thread.sleep() for a few seconds before trying to do the lookup.

  • Communication between client and server

    I am using sockets for communication between the client and the server. is there any other way that i can use for communication between the client and server???

    Plenty of ways: JMS, SOAP, RMI, a RESTful API, writing-files-to-a-shared-directory-on-the-disk, Sneakernet, ...
    Some of them use sockets (or better TCP/IP) as the underlying protocol.
    But to give you a good answer, you would have to tell us why you want a different way. I hope you're not searching for a different way just for the sake of being different.

  • Problem using CORBA clients with RMI/EJB servers..!!!???

    Hi,
    I have a question on using EJB / or RMI servers with CORBA clients using
    RMI-IIOP transport, which in theory should work, but in practice has few
    glitches.
    Basically, I have implemented a very simple server, StockTreader, which
    looks up for a symbol and returns a 'Stock' object. In the first example, I
    simplified the 'Stock' object to be a mere java.lang.String, so that lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case 1) and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
    But the problem arises when I tried using the RMI server (via IIOP) with the
    CORBA client, when the client tries to narrow the object ref obtained from
    the naming service into the CORBA idl defined type (StockTrader) it ends up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a PortableRemoteObject derived
    class, to make it IIOP compliant), and then the server to register the stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming =NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ": " +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to register the RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref name (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the naming
    service, the operation StockTraderHelper.narrow() fails in the segment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registered in a CORBA
    server (as opposed to an RMI server), but works correctly with no casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

    On the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
    include the examples.
    "<=one way=>" wrote:
    With reference to your and other messages, it appears that one should not
    expect that WLS RMI-IIOP will work in a complex real-life system, at least
    not now. In other words, support for real-life CORBA clients is not an
    option in the current release of WLS.
    TIA
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
    needs for uses who need to use IDL to talk to the Weblogic server,
    generically. This example illustrates the simplest connectivity; it does not
    address how
    to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
    this topic either, a point which is telling if all the less happy to hear.
    For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
    correct; better examples are forth coming.
    Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
    programming model is busted; busted in the sense that there are no C++
    libraries to support the EJB model, and busted in the sense that there is
    simply no
    support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
    in productive ways.
    For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
    dispatch IIOP request into RMI server objects. The way I look at it is this:
    it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
    practically nothing to do with CORBA.
    ST wrote:
    Eduardo,
    Can you give us more details about the comment below:
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
    use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
    implementation. We
    don't need a "HelloWorld" example, we need a concrete serious example(fully
    tested and seriously documented) that works so that we can get a betteridea
    on how to integrate CORBA and EJB.
    Thanks,
    Said
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    Please post request to the news group...
    As I said, you must separate the idl related classes (class files and
    java
    files) from the rmi classes... in the rmic step, you must set a newtarget
    (as you did), emit the java files into that directory (it's not clearyou
    did this), then remove all the rmi class files from the class path... ifyou
    need to compile more classes at that point, copy the java files to theidl
    directly is you must, but you can not share the types in any way.
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
    an idl client in java to work.
    Harindra Rajapakshe wrote:
    Hi Eduardo,
    Thanks for the help. That is the way I compiled my CORBA client, by
    separating the IDL-generated stubs from the RMI ones, but still I
    get a
    CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
    Here's what I did;
    + Define the RMI interfaces, in this case a StockTrader interface.
    + Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
    making
    it IIOP compliant
    + Implemnnt an RMI server, and compile using JDK1.2.2
    + use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
    utility rmic;
    rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
    + generate Java mappings to the IDL generated above, using RMI-IIOPplugin
    util,
    idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
    This creates source for the package stock and also
    org.omg.CORBA.*
    package, presumably IIOP type marshalling
    + compile all classes generated above using JDK1.2.2
    + Implement client (CORBA) using the classes generated above, NOTthe
    RMI
    proxies.
    + start RMI server, with stockTrader server obj
    + start tnameserv
    + start CORBA client
    Then the client errors when trying to narrow the obj ref from the
    naming
    service, into the CORBA IDL defined interface using,
    org.omg.CORBA.Object obj =naming.resolve(nn);
    StockTrader trader =StockTraderHelper.narrow(obj); // THIS
    ERRORS..!!!
    throwing a CORBA.BAD_PARAM exception.
    any ideas..?
    Thanks in advance,
    -hari
    ----- Original Message -----
    From: Eduardo Ceballos <[email protected]>
    Newsgroups: weblogic.developer.interest.rmi-iiop
    To: Hari Rajapakshe <[email protected]>
    Sent: Wednesday, July 26, 2000 4:38 AM
    Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
    Please see the post on june 26, re Errors compiling... somewherein
    there,
    I suspect, you are referring to the rmi class file when you are
    obliged
    to
    completely segregate these from the idl class files.
    Hari Rajapakshe wrote:
    Hi,
    I have a question on using EJB / or RMI servers with CORBA
    clients
    using
    RMI-IIOP transport, which in theory should work, but in practice
    has
    few
    glitches.
    Basically, I have implemented a very simple server,
    StockTreader,
    which
    looks up for a symbol and returns a 'Stock' object. In the firstexample, I
    simplified the 'Stock' object to be a mere java.lang.String, so
    that
    lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case
    1)
    and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
    But the problem arises when I tried using the RMI server (via
    IIOP)
    with
    the
    CORBA client, when the client tries to narrow the object ref
    obtained
    from
    the naming service into the CORBA idl defined type (StockTrader)
    it
    ends
    up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending
    java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a
    PortableRemoteObject
    derived
    class, to make it IIOP compliant), and then the server to
    register
    the
    stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation
    class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming=NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ":"
    +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to
    register
    the
    RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref
    name
    (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the
    naming
    service, the operation StockTraderHelper.narrow() fails in thesegment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the
    type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registeredin a
    CORBA
    server (as opposed to an RMI server), but works correctly with
    no
    casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

  • I need code example for server act as client and vice versa

    Hi all,
    I want code example for performing both server and clients using RMI. I mean Server will act as client and client will act as server. So a single program will act as both client and server .
    Please give example, it will helpful to complete my project. I am struggling in this stage. Its like peer to peer action.
    Thanks & Regards
    R.Ragupathi

    1. The tutorial shows you how to do cleint/server.
    2. Search on the topic "callback" to see how cleint and server roles can be reversed.

  • EJB client connection [RMI/IIOP]

    1) Just to test the communication between EJB client and EJB using RMI/IIOP in WLS 9.2, I have created two InitialContexts and I have seen that here are only two InitialContext. But, I can see only a single connection displayed (Monitoring Channels tab for the default [IIOP] channel). Is this expected? Doesn’t is suppose to create two connections?
    2) If only one connection is established. What is the way this model will scale up?? I can have multiple calls..right?
    3) What is the connection time out works on this? If I have a stub cached. Does that mean my RMI/IIOP connection still be alive?

    MC Sreeram <> writes:
    1) Just to test the communication between EJB client and EJB using RMI/IIOP in WLS 9.2, I have created two InitialContexts and I have seen that here are only two InitialContext. But, I can see only a single connection displayed (Monitoring Channels tab for the default [IIOP] channel). Is this expected? Doesn???t is suppose to create two connections?Connections are share beween the same port and ip addresses.
    2) If only one connection is established. What is the way this model will scale up?? I can have multiple calls..right?Yes. It scales up nicely.
    3) What is the connection time out works on this? If I have a stub cached. Does that mean my RMI/IIOP connection still be alive?The stub should transparently re-establish the connection if it is timed out
    andy

  • Using Applets and RMI on WL6 - Error marshaling transport header; nested exception is:  - java.io.EOFException

    I have a project that I am porting from WL5.1 to WL6. It was working fine
    in WL5.1
    but cannot get it working in WL6. So, I went back to the HelloWorld
    example to
    see if I could get it working. The problem I am having is basically getting
    applet to
    talk to a server via RMI. The applet works fine alone and RMI works fine
    alone.
    I can't get the applet to talk to the server via RMI.
    I am trying to get the "HelloWorld" applet example in WL6 working with RMI.
    I previously had the same app working in WL5.1 with SP9 but cannot get it
    working in WL6.
    I am running WebLogic Server 6.0 with SP2.
    I have registered a startup class in the WebLogic console
    named "HelloServer". When starting up the server, it states
    that the HelloImpl class has been registered as "HelloServer".
    When starting up the client applet I get the following error:
    java.rmi.MarshalException: Error marshaling transport header; nested
    exception is:
    java.io.EOFException
    These are two different methods of looking up the same object.
    The exception occurs at the "lookup" method call in both cases.
    "myserver" is the name of my machine that WL is running on.
    7001 is the port that WL is using.
    Registry reg = LocateRegistry.getRegistry("myserver", 7001);
    obj = (Hello)reg.lookup("HelloServer");
    or...
    obj = (Hello)weblogic.rmi.Naming.lookup("rmi://" +
    getCodeBase().getHost() + ':' + port + "/HelloServer");
    I previously ran this same program under WL5.1 SP9 and everything works
    fine.
    I defined the startupClass in the weblogic.properties file in WL5.1
    Can anyone tell my what is causing this exception and how to correct the
    problem?
    Thanks
    Terry Antle

    "Terry Antle" <[email protected]> writes:
    These are two different methods of looking up the same object.
    The exception occurs at the "lookup" method call in both cases.
    "myserver" is the name of my machine that WL is running on.
    7001 is the port that WL is using.
    Registry reg = LocateRegistry.getRegistry("myserver", 7001);
    obj = (Hello)reg.lookup("HelloServer");
    or...
    obj = (Hello)weblogic.rmi.Naming.lookup("rmi://" +
    getCodeBase().getHost() + ':' + port + "/HelloServer");
    I previously ran this same program under WL5.1 SP9 and everything works
    fine.
    I defined the startupClass in the weblogic.properties file in WL5.1
    Can anyone tell my what is causing this exception and how to correct the
    problem?I don't know what the problem is but you shouldn't be using either of
    these methods for looking up RMI objects - you should use JNDI instead.
    Thanks
    andy

  • Jini and Rmi utilisation for a particulary case..

    I have to write a application which is going to connect our server to different hospitals infromatque system.
    The application would provide a user interface in hospital side wich is going to make them able to send us a inventory file(fromated differently for each hospital with their own informatiqe system).
    The application have also to change the the file format befor stored in our data-base(each information have to go to different table)
    My supervisor ask me to look Jini and Rmi technologie for this application..
    So far i read some information about both technologie..but still i'm wondering my self is Jini or Rmi have a real use in this case.
    If your are masterd in those technologie and java networking device woud you help me up ?
    Could you tell me if those technologie have to be realy use in this case or there is other solution with java programming.
    Thank's
    Astiage Ghassemian

    Jini is a high level framework that a computer to easily locate a service provider in a network and get the service. So your case does not need such a framework because in your case, just like most of todays application, the service is provided only by your server and you know where it is and what it does. You just need something a one level lower than Jini that actually does the communication - RMI. Jini runs only top of any other lower level protocol including RMI. Detailed description of Jini:
    Jini technology is an architecture for the construction of systems from objects and networks. The Jini architecture lets programs use services in a network without knowing anything about the wire protocol that the service uses. One implementation of a service might be XML-based, and another RMI-based, and a third CORBA-based. The client is, in effect, taught by each service how to talk to it. A service is defined by its programming API, declared as a Java programming language interface.
    When a service is plugged into a network of Jini technology-enabled services and/or devices, it advertises itself by publishing a Java programming language object that implements the service API. This object's implementation can work in any way the service chooses. The client finds services by looking for an object that supports the API. When it gets the service's published object, it will download any code it needs in order to talk to the service, thereby learning how to talk to the particular service implementation via the API. The programmer who implements the service chooses how to translate an API request into bits on the wire using UPnP, RMI, CORBA, or a private protocol.
    In other words, the Jini architecture uses objects that move around the network to make each service, as well as the entire network of services, adaptable to new strategies over time.

  • JPA, EntityManager and RMI

    Hello,
    in my client server application, I want to get a DAO from the server to add or update a business object.
    My problem is that the DAO must have a property with the EntityManager so he can do his job, this EntityManager
    is not serializable, so RMI throw a NotSerializableException, but when I set the property tansient, the EntityManager
    will be null after serialize the DAO to the client.
    How can I solve that problem?
    Thanks.

    teramor1 wrote:
    Thank you! I undestand, the domain objects are not attached and therefor not JPA managed, when some changes are made to the objects.
    When I take a Service Interface and take the implementation from the Rmi Server, so I can call update(...) the ServiceImplementation must have a property to a DAO and the DAO to an EntityManager, but the EntityManager is not serializable.
    How can I detach the ServicImplementation from the DAO and/or the EntityManager so the Client gets the ServiceImplementation and can call the update(...) method and this method can do his job on the dao and the dao can do his job on the EntityManager?Assuming i understand your usage of the word "Service" (and i'm not sure i do), the client will never get an instance of the Service implementation. the Service implementation never leaves the server. a client gets a handle to the Service interface through some sort of jndi lookup. it then invokes remote methods on this Service which may return entity objects. then only things that travel between the client and server are the entity objects themselves.

  • CORBA and RMI are "dead"?

    Hi,
    I'm a Comp. Sci. student taking a course in CORBA and RMI and was wondering how relevant these technologies are out in the real world? I have a friend in industry who tells me that these technologies are "dead". He says XML has taken over as a communications standard.
    Also, I am in the design phase of developing a 3D online game and I want to know if CORBA or RMI is fast enough to be used in a realtime application such as this (let's say I want to make 10 remote method calls per second to each of 50 clients). Can someone aim me at some benchmarks or performance figures?
    Thanks all.

    1. Your friend doesn't know as much as he thinks.
    His statement is like saying "Conversation is dead because everybody uses English."
    I can't speak about CORBA, but
    o We have some very robust applictions written using RMI.
    o We wonder if SUN is walking away from RMI totards JAX: an XML-based communications scheme.
    2. Your problem is kind of under-specified, but
    o the way you phrased it sounds like lots of callback from server to clients - an area RMI handles, but only very well on LANs.
    o I suspect your performance will be more limited by network characteristics than by RMI. Unerneath, it's just TCPIP.

  • Adobe Creative Cloud - How To Share Files With Clients and Colleagues | Creative Suite Podcast: Designers | Adobe TV

    In this episode of the Adobe Creative Suite Podcast, Terry White shows how to share Photoshop, Illustrator and InDesign Files with clients and colleagues and all they'll need is a browser to comment and see your Photoshop Layers.
    http://adobe.ly/10ZjpE4

    Terry,
    I guess I miss something. How can I share a folder of photos? When I return from a shoot, I select 20 of the pictures and need to share them with my client to pick up the favorites. Am I supposed to copy and past an URL for each image separately?
    Sometimes I also work with a colleague, I need to share my favorites with him. Same issue.
    We have tried Adobe Cloud, and then went for Dropbox. There we can share a folder and he can put even his pictures in it as well. That's what I call collaboration. And it is free (unlike Adobe Cloud). If you have some word in Adobe, please tell them to either drop it and make a deal with services like Dropbox, or make it properly.
    Thanks.
    Vaclav

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

Maybe you are looking for

  • "Export to Excel" does not work for query based on Master Data InfoSet

    We have many queries based on InfoSet consisting 2 or more PS Master Data. After we upgraded from BW 3.1 to 3.5, the "Export To Excel" function no longer works via BEx Browser. It returns all blanks where master data should be shown. Only the non-dat

  • Where are the photos in the organizer located?

    When I put photos in the organizer, does the organizer make copies of the originals? Where are they located on the hard drive?

  • Connecting 3 displays when video card has only 2 ports?

    I have a 2009 Mac Pro quadcore with only two display ports on my video card.  Is it possible to hook up a 3rd display using an external USB video cards?  I haven't been able to get my Mac Pro to recognize the one that works with my Macbook Pro.  FYI,

  • Where is Oracle Lite DB installed? In Soa Suite inst. dir? Service needed?

    As far as I know Soa Suite can use a separate "full" Oracle (Express) DB. However user can omit this separate DB and use the built-in "Oracle lite" Database. Is this Oracle lite DB installed in the installation directory of Soa Suite or somewhere els

  • Green Screen with lines.:(

    My ipod touch 4G screen is green with tannish stippled lines.  Won't respond to any button pushing patterns that I've tried, won't respond when plugged into computer, won't connect to iTunes on computer?  Any solutions ?