Same machine RMI stuff

Hi.
I have a client and a server running on the same machine, communicating via rmi. They both work fine on one machine but when I tried to run them both on a different machine, I get a NotBoundException at sun.rmi.registry.RegistryImpl.lookup(REgistryImpl.java:106).
Now, this is bizarre. Since both the client and the server refer to "localhost", it's definitely not a problem with the machine adress. The server comes up fine, which would suggest no exceptions when registering with the rmiregistry (which I have tried restarting but that didn't work). However, the client fails to find the server.
*** Server Code ***
String rmiRegistryPort = JOptionPane.showInputDialog("Enter rmiregistry port");
if (rmiRegistryPort.equals("")){
rmiRegistryPort = "1099";
AREngine engine = new AREngine();
String serverObjectName = "//localhost:" + rmiRegistryPort + "/AREngine";
Naming.rebind(serverObjectName, engine);
engine.run();
*** Client code ***
String serverObjectName = "//localhost/AREngine";
engine = (AREngineInterface) Naming.lookup(serverObjectName);
at which point I think I get the exception.
Any help is greatly appreciated.
Thanks.

String serverObjectName = "//localhost:" + rmiRegistryPort + "/AREngine";
String serverObjectName = "//localhost/AREngine";
localhost should be the server's IP and on the client side also the port. something like this:
server-side:
String serverObjectName = "//200.192.164.1:" + rmiRegistryPort + "/AREngine";
client-side
String serverObjectName = "//200.192.164.1:1099/AREngine"; (if our server-port is 1099)

Similar Messages

  • What can't client connect to RMI server on same machine?

    I'm trying to get a client to connect to an RMI server that resides on the same machine, but it's not working. When run, I get the following exception:
    java.rmi.ConnectException: Connection refused to host: 121.0.0.55; nested exception is:
    java.net.ConnectException: Connection refused
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
    at java.net.Socket.<init>(Socket.java:273)
    at java.net.Socket.<init>(Socket.java:100)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
    The machine in question is a Solaris 8 system running Java 1.3. I've checked all the networking permissions, and they seem to be ok. Any ideas as to what might be causing this?

    Thanks for the reply! Dumb question: How do I start the registry? I see debugging code that indicates that the server is [probably] being started.
    Usually this means that the registry isn't running or
    the server isn't running.

  • How to start 2 RMI servers on same machine ??

    Hello friends,
    I am developing databackup project USING RMI
    i want to start servers on same machine and client may be on different machine.
    we tried it used as on different port . but it stil not working.
    so can u provide me solution for that ,
    how to start that two server on the same machine. ?
    reply me soon
    thanks

    Ghanshyam,
    It is possible to run multiple RMI servers as long as the port is different. For instance if you run the RMI daemon using port 2700:
    rmid -port 2700and RMI daemon using port 2800:
    rmid -port 2800You will see these ports open if you do an nmap or netstat -aMake sure you bind your separate RMI instances on separate ports when calling Naming.bind()Anthony
    Message was edited by:
    abargnesi
    Message was edited by:
    abargnesi

  • Can i share music and photos between two users on the same machine?

    How can I share my music and photos between two users on the same machine?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • Multiple instances of OC4J on the same machine

    Is there a way to cofigure OC4J to have a few processes on the same machine, all listening to the same ports?
    My purpose is to develope and deploy a few applications on the same machine, and each application should has its own process, so if onw fails or restarts, it will not effect the other applications and the other programmers.
    I don't want to make each application to be bounded to differnt port.
    is it possible ?

    Two instances of oc4j cannot listen to the same port...you will
    get an error.
    To do this, you will need to cluster oc4j. This is fairly easy,
    but you app needs to be "clusterable". All classes need to be
    serializable which are used by your servlets. The
    <distributable /> tag needs to be in your web.xml file. No
    stateful session beans can be used. (sorry, but oc4j doens't yet
    support clustering with sfsb's).
    The second step is that your default-web-site.xml or *-web-
    site.xml file should be set up for clustering. Do this by
    creating a cluster-island attribute in your web-site tag. Also
    change the port from 8000 to something like 8080 or 8090 or
    something else. It should look like this:
    <web-site host="192.168.1.101" port="8080" display-name="some-
    name" cluster-island="1">
    <default-web-app application="someapp" name="someappname" />
    <frontend host="192.168.1.101" port="8000" />
    <access-log path="../log/some-web-access.log" />
    </web-site>
    Your server.xml and application.xml will be the same as when you
    don't cluster.
    Make sure you have 3 different copies of your j2ee/home
    directories...of course with different names....like home1 and
    cluster.
    Edit the rmi.xml and jms.xml files to change the port number
    that the home1 oc4j will listen to. The jms port is usually 9127
    by default, so use 9128. The rmi port is 23791, so change it to
    21792. This will keep the rmi and jms servers from conflicting.
    Make sure that the home1 config/default-web-site.xml uses a
    different port than 8080, say 8090, but the cluster-island name
    is still 1.
    Open terminal windows for each instance of oc4j, and start them
    in the normal way.... java -jar orion.jar
    Open a terminal window for the j2ee/cluster, and issue this
    command:
    java -jar loadbalancer.jar -host 192.168.1.101 -port 8000
    You should see that each of your oc4j instances are recognized.
    There...that wasn't so bad, was it?
    regards,
    the elephantwalker
    www.elephantwalker.com

  • Problem with JMX Remote Port - JBoss & Apache on same machine

    Hi,
    I have a server which hosts Apache that uses mod_jk to pass requests to three Tomcat instances. Apache listens to port 80.
    I want to install a different application on the same machine that runs on JBoss. Foreseeing the problem with port numbers, I got a different IP address (Let's say IP2, and original IP for Apache is IP1) on the same machine to run JBoss application. I changed HTTP Connector configuration in server.xml to add "address=IP1:8080" for Tomcat, "address=IP2:8080" for JBoss. I also modified Apache Listen directive in httpd.conf from "Listen 80" to "Listen IP1:80".
    Now when I try to start JBoss server by running run.bat, I get below error.
    Can any one please suggest how can I resolve this port conflict? Is there even a way to resolve it? As JAVA_HOME can point to a single location and both JBoss & Apache use it?
    Thanks.
    ===============================================================================
      JBoss Bootstrap Environment
      JBOSS_HOME: C:\jboss
      JAVA: C:\Java\jdk1.6.0_01\bin\java
      JAVA_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=
    9004 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.aut
    henticate=false  -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.
    client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
      CLASSPATH: C:\Java\jdk1.6.0_01\lib\tools.jar;E:\jboss\bin\run.jar
    ===============================================================================
    Error: Exception thrown by the agent : java.rmi.server.ExportException: Port alr
    eady in use: 9004; nested exception is:
            java.net.BindException: Address already in use: JVM_Bind
    Press any key to continue . . .

    What's running on JMX port without the Jboss running ?
    Seems that u have something it.
    Btw, try to discover how to bind JMX of portal to IP2, not to IP1 or to global Ip.

  • Running multiple instances of OIM on same machine

    I have two instances running on same machine. I made the following changes in JBoss to achieve it:
    * deploy/jboss-web.deployer/server.xml
    o change 8080 to 18080
    o change 8443 to 18443
    o change 8009 to 18009
    * deploy/http-invoker.sar/META-INF/jboss-service.xml
    o change 8080 to 18080
    * deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml
    o change 8080 to 18080
    o change 8443 to 18443
    * deploy/ejb3.deployer/META-INF/jboss-service.xml
    o change 3873 to 13873
    * deploy/jms/uil2-service.xml
    o change 8093 to 18093
    * conf/jboss-service.xml
    o change 8083 to 18083
    * conf/jboss-minimal.xml
    o change 1099 to 11099
    o change 1098 to 11098
    * conf/jboss-service.xml
    o change 1099 to 11099
    o change 1098 to 11098
    o change 4444 to 14444
    o change 4445 to 14445
    o change 4446 to 14446
    Both servers startup properly but after startup I get following exception:
    Server 1
    22:45:01,120 ERROR [ACCOUNTMANAGEMENT] Class/Method: tcDefaultSignatureImpl/verifySignature encounter some problems: CN=Custome
    OU=Customer, O=Customer, L=City, ST=NY, C=US
    22:45:01,121 ERROR [ACCOUNTMANAGEMENT] Class/Method: Authenticate/connectSignature encounter some problems: CN=Customer, OU=Cus
    er, O=Customer, L=City, ST=NY, C=US
    22:45:01,122 ERROR [ACCOUNTMANAGEMENT] Class/Method: Authenticate/connect encounter some problems:
    com.thortech.xl.security.tcLoginException:
    at com.thortech.xl.security.tcLoginExceptionUtil.createException(Unknown Source)
    at com.thortech.xl.security.tcLoginExceptionUtil.createException(Unknown Source)
    at com.thortech.xl.security.Authenticate.connectSignature(Unknown Source)
    at com.thortech.xl.security.Authenticate.connect(Unknown Source)
    at com.thortech.xl.security.Authenticate.connect(Unknown Source)
    at com.thortech.xl.security.jboss.UsernamePasswordLoginModule.login(Unknown Source)
    Server 2
    22:45:01,214 ERROR [DATABASE] Class/Method: tcDataBaseClient/bindToInstance encounter some problems: SecurityException; nested exc
    eption is:
    com.thortech.xl.security.tcLoginException:
    java.rmi.AccessException: SecurityException; nested exception is:
    com.thortech.xl.security.tcLoginException:
    at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:388)
    at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:136)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
    at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:637)
    at org.jboss.ejb.Container.invoke(Container.java:981)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    Can any one help me to resolve this?

    I also change the ports in internal-settings.xml for IIOP, rarely used but sometimes necessary.
    --olaf                                                                                                                                                                                                                               

  • ODP 10.2.0.1.0 and ODP Beta on same machine

    Here is what I need to do: I need to keep the 'production' version of ODP.NET (10.2.0.1.0) installed for my Visual Studio 2003, yet also install the beta ODP.NET for Visual Studio 2005. In other words, I have the Oracle 10g client 10.2.0.1.0 installed, and want VS 2003 to use ODP 10.2.0.1.0, and VS 2005 (on the same machine) to use the new ODP.NET beta.
    Questions:
    1. Is this possible? I believe it is, cause I think I have tried this before, but I remember I ran into some issues. Which leads to the next question...
    2. What exactly is the 'install' sequence to do this? I.E. I already have ODP 10.2.0.1.0 on the machine, and now what to install JUST the ODP.NET beta (for VS 2005). If I remember correctly, what happened before was that it either (a) Installed the new beta of the ODP for VS 2003 (which is not what I want to happen) or (b) I didn't specify ODP for 2003 in the beta install and it removed it entirely.
    3. And finally, is there any way to JUST install the ODP 2005 beta without anything else? And can that be automated?
    Basically, I want to install the ODP Beta (possibly with the VS 2005 developer tools also) but NOT touch nor remove the ODP 10.2.0.1.0 production version so that VS 2003 keeps using it.
    Any advice/instructions appreciated. Thanks in advance.
    Tom

    Hi Tom,
    Can one run VS 2005 with the production 10.2.0.1.0 version of ODP?
    Yes, as long as you don't try to use any ".NET Framework 2.0 stuff" in your application this works fine.
    When I say "fiddle with stuff" I had to change my system path in order to avoid .dll mismatch type errors. So when I wanted to use the beta, I would change the system path so it was first, then I would change it so the production home was first if I wanted to use that version, etc. I also have non-public beta software installed, so my machine is not "typical".
    I do remember running the production 10.2 with Visual Studio for awhile before the beta came out... now I do think you need the beta to use the Oracle Developer Tools for VS2005. Most of my development efforts are ASP.NET based (I'm really a DBA by day), and since there is not much support for ASP.NET in ODT, this was not a big consideration for me.
    Hope that helps a bit,
    Mark

  • Can I install Photoshop stand alone upgrade and Creative Suite on same machine?

    I'd like to be able to install my Photoshop CS6 Upgrade on the same machine as I am running Creative Suite 5.5.
    I'm using Windows 7 64bit.
    I have one running on a laptop and one on my main machine.. is this possible without conflicts?

    Hi Ned
    Thanks for the reply.
    I have CS5 Photoshop stand alone but it's not installed on same machine as Creative Suite 5.5.. its on a laptop. I use Photoshop mainly but don't want to stuff up my Creative Suite by installing CS6 as well..

  • Same machine-different direcory

    Hi all,
    I am trying to run a simple client-server program on the same machine but on two diffrent direcories.
    1. I have started the 'rmiregistry' from the commnad line(no other arguments)- from c:\
    2. I have gone into the directory which contains the server side codes- and typed in the following command
    java -Djava.security.policy=java.policy -Djava.rmi.server.codebase=file:///c:\rmi\GreetingServer\ GreetingMain
    and I get the following exception
    Exception in thread "main" noClassDefFoundError: and
    I have created a security policy aready
    can some one please suggest me wheher am I wrong?
    do I need to do anything with my class path?
    cheers

    Thats a simple classpath issue, it's not finding your GreetingsMain class. Remember if it's in a package you need to include the fully qualified path name, ie: my.package.MyClass something like that. Do a quick search on classpath and you should find all the help you need.

  • Reading the same port on the same machine

    Hello,
    i'm working on DatagramSocket to broadcast DatagramPacket (IP 192.168.xxx.255) and a fixed num port. The problem is that I can't have 2 threads that read (datagramSocket.read) on the same port, on the same machine.
    How can I perform my tests ?
    java.net.BindException: Address already in use
    at java.net.PlainDatagramSocketImpl.bind(Native Method)
    at java.net.DatagramSocket.bind(DatagramSocket.java:368)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:210)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:261)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:234)

    Well, the short answer is that you can't.... at least I've never heard of a way how. Basically, when an application requests a port number, it basically owns that port number until it gives it up. You do this when you create the DatagramSocket. Each DatagramSocket is its own request, and therefore must have an unique identifying port. Otherwise, how would your operating system know who to give the data to when it receives a packet on your machine for port XXXX? Also, it would be a secuirity problem if other applications could listen on the same port as you use for other things like surfing the web, making online purchases, email.
    However, what you could do is have one owner of the DatagramSocket... and share it among the other threads. When that owner receives a packet, it can notify the other threads it received a packet and pass the data to each one. Set it up something like how listeners work. Also, if you want it to span processes, you could use RMI or pass the data through other deined network connections between the processes.
    Does that make sense? :)

  • Running JDK 1.2 and 1.3 at the same machine

    Can I run two versions of JDK at the same machine? IS there any drawback of doing this?
    thanks,
    Jun Xiao
    LDMI
    313-972-8088

    i have jdk's 1.1, 1.2, 1.3.1_04 and 1.4.0_01 and jre's 1.3.1_01, 1.3.1_04 and 1.4.0_01 installed on my machine without problems.
    but as the last post indicates it can get confusing some times.
    i use batch files for different builds to set the path as needed.
    the only issue I know of where I can't switch from one to another is in my browser where i have the (last installed) 1.4 runtime but i can use the different appletviewers for testing in this case.
    in case anyone is wondering why i have all these installed. i use
    1.1 for some applets because if you can get away with just this people generally don't need the plug-in.
    1.2 is old but sometimes i use it for some stuff for servers that don't have anything newer
    i.4 is what i use normally
    1.3 i need to use the ActiveX bridge and packager which was removed in 1.4 but is coming back for the next release.

  • Need help:server client in the same machine

    hello all,
    i want to install oracle client and server on the same machine(cause i only have got one)
    to do that,
    for server installation i did the following:
    # mkdir /u01
    ; /u01
    # cd /u01
    # mkdir -p app/oracle/oradata
    # groupadd dba
    # groupadd oinstall
    # groupadd oracle
    # useradd -g dba -G oinstall,oracle -m oracle -d /u01/app/oracle
    ; risumi des caractiristiques du compte Linux oracle
    ; user : oracle
    ; groupe principal: dba
    ; groupe secondaire: oinstall, oracle
    ; ripertoire par difaut: /u01/app/oracle
    # cd /u01
    # chown -R oracle.dba /u01
    ; virification des droits
    # ls -l /u01/app/oracle
    # ls -l /u01/oradata
    # passwd oracle
    # more /etc/passwd
    # more /etc/group
    ; sortie de votre session root
    # exit
    $ su - oracle
    in .bash_profile(file) i wrote the follwing parameters :
    export DISPLAY=localhost:0.0
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/8.1.6
    export PATH=$PATH:$ORACLE_HOME/bin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export ORACLE_SID=TEST
    export ORACLE_TERM=vt100
    export NLS_LANG=french_france.WE8DEC
    export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
    the oracle server works fine!
    So, the server installation directory is /u01/app/oracle/product/8.1.6
    what i have to do for client installation in the same machine:
    do i have to create a new groups(dba,oinstall...)?
    do i have a new directory to install oracle client?
    can somebody give me any information?
    Thank's a lot in advance
    null

    You can install your client parts in the same ORACLE_HOME as the server as long as they are of the same version. In fact, a lot of the client has already been installed, since it is part of the server installation.
    If your client is of a different version than your server you will have to install it in a different ORACLE_HOME. You can do this using the same oracle user.

  • Can CS3.3 & CS4 Master play nice installed on same machine at same time?

    First off here are the specs on my desktop and laptop:
    Desktop:
    Mac Pro running OSX 10.5.6 - 2 x 3 GHz Dual-Core - 6 GB RAM - CS3.3 Master Collection currently installed
    Laptop:
    MacBook Pro running OSX 10.5.6 - 2.4 GHZ Intel Core 2 Duo - 2 GB RAM - CS3.3 Master Collection currently installed
    I recently received all the install discs for CS4. Spent the last hour researching how CS3 and CS4 play together when installed on same machine at same time. I haven't found anything that addresses my questions, thus the post.
    At present, not enough of my work colleagues have CS4, so if I install CS4 and uninstall CS3 - and need to pass a file on to someone who doesn't have CS4, they can't open it in CS3.
    Also, I use AfterEffects with many 3rd party plugins. Until I can verify that CS4 plays nice with these plugins, I can't afford to uninstall AfterEffects CS3. Obviously, I need to keep CS3 up and running on my desktop and laptop.
    But now that I have CS4 ready to install, I of course want to start using it and learning the new features.
    Has anyone successfully been able to install CS4 Master apps on a machine similar to either my desktop or laptop specs and have CS3.3 Master apps continue to work properly?
    I trust Adobe takes these types of version overlaps seriously and plans for them since people want to try out or start using the newest version but ensure there is a sufficient overlap period before uninstalling the older versions.
    Thanks for your comments
    jslicer

    j,
    Your old apps will work. But the new versions will be the defaults. You can touch your files to the old application to launch it or launch the old application first, and then open files "normally".
    If you need to ensure compatibility with older versions on other machines, don't delete the old apps. Or be prepared to save back to the old version before handing off the files. Note that InDesign cannot save back more than one version and in general, any features used that are new to the new apps will not be recognized when those files are saved back.
    Neil

  • Runing BO 6.5 and Xi 3.0 on the same machine

    I have installed 6.5 and Xi 3.0 on the same workstation. Both versions run fine when I run them one at a time (open one, work on it, then exit before starting the other).
    However, when I run 6.5 and Xi 3.0 simultaneously, then the next time I try to run either of them, I receive a message asking me to install again.
    Has anyone run into this?
    Michael O

    Hello Constantino,
    Is there no way this will work? As I have several customers thinking about or planning an upgrade/migration to XI 3.0, running legacy and new software side-by-side on the same machine is a very important issue, especially as migrations are usually an incremental process, requiring both versions to co-exist for some time.
    I have never had any problems running 5.x / 6.x and XI r2 on the same machine, even simultaneous, that's why I'm so surprised at the sudden change.
    Any input would be welcome! Thank you!
    Kind regards,
    Kristof Speeckaert

Maybe you are looking for