Exporting two remote objects on the same port

Hi,
I would like to export two remote objects on the same host, same port and bind them with different service names.
There is no problem when I do that from the same Java program.
But when I export and bind an object from a Java program 1, I cannot do the same with the second (and similar) Java program 2. This is the stack trace of my Exception:
java.rmi.server.ExportException: Port already in use: 50040; nested exception is:
     java.net.BindException: Address already in use: JVM_Bind
     at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
     at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
     at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
     at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
     at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
     at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
     at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
     at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
     at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)Can some one help please

It should work in any version of Java as long as the server socket factories are null or equal according to Object.equals() or its override in the SSF.equals() method if any. Which needs to be present and needs to take the form:
public boolean equals(Object object)
  return object != null && object.getClass() == this.getClass();
}with further tests if the server socket factories have additional state.

Similar Messages

  • Call to a remote object in the same JVM

    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

    Try:
    initialNamingContext.rebind("single",
    weblogic.rmi.server.UnicastRemoteObjcet.exportObject(obj)
    "M. Manohar" wrote:
    Hi Eduardo,
    thx for ur reply.
    I wud like to know how to make this "binding a stub".
    wat i'm using is binding an object only.
    Instantiating an object which implements the remote interface and binding
    it to the JNDI tree by,
    initialNamingContext.rebind("single", obj);
    and ofcourse defining it as a start up class in the weblogic.properties
    file.
    Can u pls explain how to do "binding a stub"
    thx,
    Manohar
    Eduardo Ceballos wrote in message <[email protected]>...
    Presuming that the start up class binds itself into the jndi tree, then itonly depends on what you bind: binding a stub results in the RMI runtime
    overhead; binding the object itself, results in the simpler function call
    overhead.
    "M. Manohar" wrote:
    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi
    calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

  • Two computers connected in the same port dot1x in 3750 in different time.

    I have the following consultation.
    I have a "computer A" connected to a port of switch 3750, configured with: dot1x port-control auto
    dot1x timeout quiet-period 5
    The "computer A" is authorized.
    When I disconnect the "computer A" and I connect a "Computer B", this is not connected, but when I connect the "computer A" again if is connected.
    How many time I should expect to be able to connect the "computer B" in the same port of the 3750?

    When the switch cannot authenticate the client, the switch remains idle for a set period of time and then tries again. The dot1x timeout quiet-period interface configuration command controls the idle period. A failed authentication of the client might occur because the client provided an invalid password. You can provide a faster response time to the user by entering a number smaller than the default.
    The value after the quiet-period is in seconds, so in your case, the switch will wait five seconds before it re-tries for another authentication for the new device connected.
    Please rate helpful posts.

  • How to drag the end of two text objects at the same time

    I have two seperate bits of text in a particular section of video. If I select the two text objects and drag the end left or right it only moves one. I I want to be able to drag the end of multiple things at the same time.
    I may be being dumb but cant find how to do it. Any solutions gratefully received.
    Best
    Tom B.

    Two stacked separate title clips or two text text boxes in a single clip?
    Russ

  • Two universe objects on the same graph axis

    I am trying to create a bar-stacked graph in the Web Intelligence document. I add \[Period\] universe object to X axis, \[Total\] object to Y axis. Then I want to add two objects to Z axis:
    \[Sector\] (has values: Europe, Asia, America) and \[Status\] (has values: Active, Validating)
    The problem that it makes a cartezian product between all value, so the output is:
    Europe/Active
    Europe/Validating
    Asia/Active
    Asia/Validating
    America/Active
    America/Validating
    But, what I want is:
    Europe
    Asia
    America
    Active
    Validaing
    Is there any way to do this? Maybe with the help of some universe parameters, or REBean SDK...

    this is cross topic

  • Two remote objects calls on the same php class

    Hi to all,
           I've encountered a strange issue while developing with remote objects.
    I've a mxml component with an init() method inside which is called by a menu.
    When the init() method is called it makes 7 remote object calls which are bound to some components' dataprovider.
    Among this calls I've got 2 remote object which refer to the same remote class. This because I have to call the class twice and the bind the result to two different combobox. Below you find the code:
    <mx:RemoteObject id="myFile" source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    <mx:RemoteObject id="myXls"  source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    in the init function I make this calls:
    myFile.listDir("dir_1")
    myXls.listDir("dir_2")
    then in the mxml code I bound the result of myFile to combobox1 and the result of myXls on combobox2.
    The problem arise when I call the myXls' listDir method. When I call it I receive the following error:
    code:
    Client.Error.DeliveryInDoubt
    Message:
    Channel disconnected
    Detail:
    Channel disconnected before an acknowledgement was received
    The strange thing is that not only the myXls object returns this error, but also all the other 6 remote object return the same error above.
    I'm not sure, but I guess that the error could be caused by the two remote object which call the same php remote class. If I comment one of the two calls everything works fine.
    Do you have any suggestion about?
    Thanks!!
    Bye
    Luke

    Hi Jan.
    1) We have the 2 VO, each with 3 rows to fill in data. What I mean is that when i just fill in all the fields for the first row of the first VO, and the value of one of these fields is bigger than 50, then after the exception is thrown and the message is displayed, the fields for the first VO are duplicated and shown in the second VO as if the user had inserted them.
    2) We tried yesterday the validateEntity and a Method and Atributte Validator approaches after reading that white paper with the same results.
    The validation is correctly done using any of the those methods.
    I will try to reproduce this issue with the HR schema.
    Thanks in advance once again.

  • HELP!!: Two server application instances could work in the same port?

    Hi everybody!!!
    i have two server application instances over the same JVM and both of them need to get requests from the same port, how can i get this??
    I`m not interested on using RMI, and i wouldn`t like to use sockets, because i have already using XML-RPC, so if you can tell me how can i get this without using sockets nor RMI, please help me...
    I don�t if there any way using threads??
    thanks a lot,
    JCPARRAM

    Two sockets can't be bound to the same port on the same machine at the same time. This means that one application can't have two sockets listening on the same port and that two applications can't each have a socket listening on the same port (no matter what language they are written in, and, if they are in Java, no matter whether they are on the same JVM or not).
    Your only solution is to make one of the server applications listen on a different port.

  • Two applications wants to read on the same port using Socket

    I have an application running on one machine using TCP/IP socket. The data transfer with the other application on other machine is in ASCII.
    Now I want a new application that can have a copy of data received and sent on the given port, where the previous application is running.
    Is it possible in Java using socket and TCP/IP to have two application reading data from the same port and both can read all the data.

    Even when you don't state the type of app which need to read the data stream (is it a server or a client app???), it's impossible to share a single TCP/IP socket among multiple apps.
    Perhaps the best thing to do is to develop something like a proxy server who listens on the nominated port and provides to contact (if your apps are server ones) or to be contacted (if your apps are client ones) by the desired apps.
    This way, the only job for the proxy is to duplicate the contents of the data stream and make them available to all the apps engaged.
    Hope this helps.

  • Can't connect two external drives via USB hub to the same port.

    I have two external hard drives connected to my MacBook Air, along with other USB devices, using a powered USB hub. When I connect both external drives to the same port via the USB hub, one of them disconnects with an error message saying it was improperly disconnected. The same thing happens when I connect one of the hard drives and an external DVD drive via the USB hub. The two drives work fine when connected to separate ports. Other USB devices coexist with one of the drives quite happily. Can anyone explain why this is?

    External drives may well require more power than a port can supply. Also, many USB hubs cannot be used for external drives. It's always best to connect an external drive directly to the USB port. If the drive enclosure has a second USB port on it, then you can daisy-chain a second drive to the first, sometimes.

  • Can two java program write to the same port by fetching data from different

    can two java program write to the same port by fetching data from different ports, if yes is thing possible for a 3rd program to get all data (is there any data loss or collision)
    how is this possible

    can two java program write to the same port by fetching data from different portsTwo java clients can connect to the same server port and they can both write to it. However the server will see the connections as two separate accepted sockets.

  • Can two different local ips use the same port at the same time?

    Can two PS3s use the same ports at the same time. So let's say you have two PS3s and they need to open the exact same set of ports at the same time to be able to play the same game online. Is that possible on a regular consumer router such as the wrt310n? If so, then how would someone go about that. I am just asking out of curiosity.
    I don't work for Cisco. I'm just here to help.

    Use port range Triggering instead of Port forwarding. When you use port triggering then those ports will be opened for the entire local network.

  • Strange behaviour: two servers on the same port

    Hi!
    I hope this is the right section for this post. I need help about a strange behaviour involving a ServerSocket.
    For my thesis I need to write a program that receives data from a pre-existing DSMS client, filters them and then sends them to a pre-existing DSMS server. And here is my problem: if I try to create a ServerSocket on the same port of the DSMS server, my program throws no exception, and the servers seem running on the same port. This is a behaviour that I'd like to avoid, but I cannot understand what the problem is. Can you help me?
    The source code of the DSMS server can be found here (it's written in C++): http://infolab.stanford.edu/stream/code/stream-0.6.0.tar.gz
    The source code of my server class, instead, is this one:
    import java.io.*;
    import java.net.*;
    public class ThreadGenerator {
         private ServerSocket server;
         public void connect(String servPort, String cHost, String cPort) {
              try {
                   server = new ServerSocket(servPort);
                   System.out.println("SERVER running on port "+servPort);
              } catch (BindException e) {
                   System.out.println("Address already in use!");
              } catch (Exception e) {
                   System.err.println(e);
              try {
                   while(true){
                        Socket client = server.accept();
                        StreamThread T = new StreamThread(client, cHost, cPort);
                        T.start();
              } catch (EOFException e) {
                   System.out.println("Server closed connection!");
              } catch (Exception e) {
                   System.err.println(e);
    }I'm programming on Mac OSX Tiger, with Java 1.5.0.
    Thanks in advance for your help.

    The problem is still happening to me, I tried in this very moment. The code I'm using is the one I posted, and the second server is the one that I linked. I don't think there's anything else to add.
    If you're sure that the problem is not in my code, then it means that it is in the linked server, which partially solves the problem. But I'd like to know, if it's possibile, if there is any other way to check if the port is already in use.

  • RE: multiple named objects with the same name andinterface

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • Object not exported for Remote object in WSAD

    Hi,
    I have a few classes that extend and implement java.rmi.remote object. The JAR is placed under WEB-INF/lib of a web application.
    I am using WSAD 5.1.1. When I start the server, it gives me the following error.
    Can somebody make out anything?? Please help
    Error Stack:
    [5/3/05 12:07:04:188 IST] 3d410866 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
    Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
    Context method: rebind
    Context name: localhost/nodes/localhost/servers/server1
    Root exception is java.rmi.NoSuchObjectException: object not exported
    I tried creating the stub and the skeleton classes manually and added them to the JAR file but still I get the same error. The JAR is in the CLASSPATH of the server.
    I also tried creating a simple remote object and tried binding it:
    Hashtable propertiesMap = new Hashtable();
    propertiesMap.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
    propertiesMap.put(Context.PROVIDER_URL, "iiop://localhost:2809" );
    Context context= new InitialContext(propertiesMap);
    myRemote instance = new myRemote();
    context.bind("TestString",instance);
    Even this gives :
    javax.naming.ConfigurationException: Problem with PortableRemoteObject.toStub(); object not exported or stub not found. Root exception is java.rmi.NoSuchObjectException: object not exported
    at sun.rmi.transport.ObjectTable.getStub(ObjectTable.java:115)
    at java.rmi.server.RemoteObject.toStub(RemoteObject.java:88)
    at com.ibm.rmi.util.JDKBridge.getJRMPStub(JDKBridge.java:129)
    at com.ibm.rmi.javax.rmi.PortableRemoteObject.toStub(PortableRemoteObject.java:138)
    at javax.rmi.PortableRemoteObject.toStub(PortableRemoteObject.java:105)
    at java.lang.reflect.Method.invoke(Native Method)
    -sam

    Hi,
    Not sure if this question is not clear ... Can somebody give me some hints please??
    -sam

  • How do I open the same ports on an Airport Extreme Base Station for multiple computers at the same time?

    As the title suggests...
    I have a mix of five Mac and PC's at home using an Airport Extreme Base Station as the router.   I need many ports opened on the AEBS for all of the computers- not just one computer.  (for example: three people want to play TF2 on Steam at the same time; each machine needs the correct ports open on the router).   Port forwarding  only allows me to forward a given port to a single IP, yet I need that port open for five differnt IP's, all at the same time. 
    How do I do that on an AEBS?
    In the same way, I have a small office of four iMacs using an old airport with the same exact issue.   I would like to be able to connect to all of them remotely with Apple Remote Desktop, but the port forwarding on the airport only allows a port to forward to a single IP.   I want to be able to tunnel into the office network and log onto any machine behind the Airport extreme... not just a single IP.    I currently have it set up where I can tunnel into the office from my house, I can find the one machine that the port forwarding has been assigned to, I can log on and everything is just fine... with one machine.    How do I open the firewall for the other machines? 
    TL,DR version:  How do you open ports on an Airport Extreme Base Station instead of forwarding ports?   Forwarding ports doesn't work for multiple IP's.  

    You can open a single or multiple ports to a single device or different ports to different devices, but you cannot open the same port to multiple devices via the AirPort Utility for the Apple routers.

Maybe you are looking for

  • Dúvida - Processo de validação de situação fiscal de clientes

    Pessoal boa tarde, Me passaram uma demanda para realizar um estudo sobre uma validação da situação fiscal dos clientes antes de realizar qualquer operação. Pelo que me disseram agora será uma exigência realizar essa validação antes de qualquer operaç

  • Anmeldung mit bestehender Adobe ID auf Digital Edition nicht möglich

    Hallo Leute, ich habe bereits Adobe Edition auf einem Computer. Nun hab ich mir einen weiteren PC gekauft und möchte dort auch Digital Edition installieren. Die Installation hat gut geklappt aber ich kann mich nicht mit meiner Adobe ID anmelden. Habt

  • To buy a Macbook? Help me decide, please.

    Hi Guys, My 12" PowerBook G4 is getting a little long in the tooth, so I'm in the market for an upgrade. My choices are either the 15" MBP or the high-end white Macbook. The deciding factor is the dedicated video card in the MBP. My question is about

  • Problem with Amazigh chars  in webkits

    Hi all, i post this question because i have see that all browser which use webkit dont does not correctly display the letters of the alphabet Amazigh (Tamazight Tifinagh gold == language of North African population), i want to ask you if you can add

  • Simple layout question, shrinking TextField and TextArea inside VBox

    Given:         VBox root = new VBox(10);         root.getChildren().addAll(new TextField(), new TextArea());         Scene scene = new Scene(root, 300, 250);When I shrink the application window vertically, the textfield starts to shrink first, while