Propertie java.rmi.server.hostname during 1 minute

Hello from Spain,
I �m developing an application using Rmi over http (tunneling)
I execute the example of "rmiservlethandler" and it 's works fine in localnetwork mode.
Nevertheless, when i try to execute the application accross internet i must put the propertie
-Djava.rmi.server.hostname=<public ip of server>
I run this server but only works during 1 minute aprox.
Later this minute, the server is automatically shutdown and it doesn't report any errors
What can i do?
Please, help me and thanks in advance

I forget say that during this minute, the examples works fine

Similar Messages

  • Rebind Method and java.rmi.server.hostname

    Hello,
    We are trying to execute a server on the internet which is installed in a machine whose private IP address is 10.X.X.XX.
    To access the server by internet, the IP address is 196.XXX.XXX.XX and is converted by NAT to the IP address 10.X.X.XX.
    I start the server with the command:
    java -Djava.rmi.server.hostname=196.XXX.XXX.XXX myServer
    Also, and according some recommendation in this forum, we don't use the "rmiregistry" and instead we use the method:
    Registry r = LocateRegistry.getRegistry(MYPORT);
    r.rebind("MyServer", obj);
    However,
    And it takes about over 4 minutes for this app to execute the rebind method. Does anyone know why ?
    If I start without java.rmi.server.hostname propert. it executes immediatelly, but then I can't access the server from outside firewall.
    Am I missing something?
    Any advice or idea?
    Thanks
    Gerardo
    PS. I am using Java 1.4.1 under Linux Red Hat 9.0.

    I start the server with the command:
    java -Djava.rmi.server.hostname=196.XXX.XXX.XXX myServerThe wait is probably due to your DNS setup. Is a client inside the firewall able to reverse-resolve a 196.xxx.xxx.xxx address?
    EJP

  • Dynamically changing java.rmi.server.hostname

    Hi all,
    I am trying to change the java.rmi.server.hostname value dynamically to force my rmi stubs to be exposed on a particular ip
    The java app is started with a default value of 172.30.30.200 for the java.rmi.server.hostname attribute using the -D parameter. Before the binding is done, I set the value of the java.rmi.server.hostname in the system properties to localhost and then call the rebind (code snippet below).
    After this, if I use a jndi browser, I do not see the entries for the localhost. However, I see the entries for 172.30.30.200.
    The release notes for 1.4.2 and 1.5.0 indicate that this attribute can be changed dynamically; does not say how though.
    http://java.sun.com/j2se/1.4/docs/guide/rmi/relnotes.html
    Can anyone give me an idea as to what is happenning.
    Thanks a lot for your help
    Properties currentProperties = System.
    String ipAddr = "localhost";
    currentProperties.put("java.rmi.server.hostname", ipAddr);
    System.setProperties(currentProperties);
    UnicastRemoteObject.exportObject(this);
    InitialContext ctx=new InitialContext();
    ctx.rebind(getObjectName().toString(), this);

    java.rmi.server.hostname should be set to whatever hostname or IP address the client should use when trying to connect to the server. It only needs to be set in JVMs which export remote objects, i.e. in server JVMs.

  • Reading java.rmi.server.hostname property

    When try to read java.rmi.server.hostname property within my server I got following exception:
    Exception in thread "main" java.security.AccessControlException: access denied (
    java.util.PropertyPermission java.rmi.server.hostname read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at engine.ComputeEngine.main(ComputeEngine.java:22)
    Any idea how to read this property from program.
    Syed

    Looks as if you need to create a security manager or add a security policy file.
    To create a security manager, add:
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    to the server's 'main' method.
    Then, at program startup, pass in a security policy file:
    java ... -Djava.security.policy=[<pathname>]security.policy [<classpath>]/<RMI server name>
    Where the file security.policy might contain:
    grant {
    // Allow everything for now
    permission java.security.AllPermission;
    Amoong other privileges.

  • Java.rmi.server.hostname

    Hi,
    i am trying to figure out where this property comes into play. The docs say:
    "The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. In 1.1.7 and later, the default value of this property is the IP address of the local host, in "dotted-quad" format."
    So i reverse engineered the stub to see if the value is inside the stub, but it isnt. I am asking because i want to run my RMI server program as a service and i dont want to define a static hostname property, because the server can be installed on several machines. Perhaps i can leave out this property completey and rely on defaults.
    So two questions remain to me:
    - Can i leave out this without getting into trouble?
    - Where is this propery used, obviously not in the stub.
    Thanks.
    marc

    Hi Marc,
    - Can i leave out this without getting into trouble?
    Possibly, see answer to your second question.
    - Where is this propery used, obviously not in the stub?
    The property is used primarily for one of two reasons, otherwise it is generally not necessary.
    1. If you have more than one network interface on a given machine, this property will specify which one to use.
    2. If you are behind a NAT router, this property will specify the actual address to use, outside the NAT subnet.
    Unspecified it will use the default network adapter address specified by your OS.
    Hope that was interesting :-)
    -John

  • RemoteException: java.rmi.ConnectIOException: error during JRMP connection

    We have a Java application implementing a RMI server.
    The server uses with the jacob api in order to generate Word files in a windows system.
    My clients work in linux.
    The RMI method is synchronized in order not to have problems executing Word from multiple threads.
    The application and the RMI server work all right for some time, but after some hours (sometimes days) the client throws the following error:
    RemoteException: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
    java.net.SocketException: Connection reset

    Hi Varun,
    This is definitely required even if you are on WAS6.40.
    After copying this , you have to also follow the register dll using this command
    rgsvr32 "c:\Winnt\system32\librfc32.dll"
    check the OS your using wether it is windowsXP/2003 or 2000.
    there are seperate commands for them to register the dll.
    This is available in the installation guide.
    we also had the same problem and then we did this and it worked for us.
    f you have done this, then there are other possibilities also
    1. Install SOAP toolkit on the CRM server as this is required to establish the connectivity
    2. See whether the MAPBOX services are deployed on the SAP J2EE engine
    3. Create RFC through SM59 only for mapbox and register them.
    4. See if there are any old versions of Java on your machine then uninstall them and install the required java components.
    Let us know if it resolved the problem
    Thanks
    Yash
    reward points if it helps.

  • Option '-Djava.rmi.server.hostname' unnecessary?

    In this tutorial:
    http://java.sun.com/docs/books/tutorial/rmi/running.html
    you start the rmi server with:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
    -Djava.rmi.server.hostname=zaphod.east.sun.com
    -Djava.security.policy=java.policy
    engine.ComputeEngine
    but in this tutorial:
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html#5321
    you start it without the Djava.rmi.server.hostname option:
    java -Djava.rmi.server.codebase=http://myhost/~myusrname/myclasses/ -Djava.security.policy=$HOME/mysrc/policy examples.hello.HelloImpl
    I have also tried to omit the hostname option from the first tutorial and it works fine..
    Why is it not necessary to specify the Djava.rmi.server.hostname option to make the examples work?
    What is the function of this option?

    It's only necessary if you have a fouled-up DNS which doesn't give the right hostname by default.
    And if Sun had understood the TCP weak-end model better than they did in 1996 it wouldn't be necessary at all.

  • UnmarshalException while using prop  java.rmi.server.ignoreStubClasses=true

    I have created a test program to check the behaviour of setting the java.rmi.server.ignoreStubClasses property to true on the server side and not setting this flag on the client side.
    This requirement is due to updation of an already running system, with stubs to a new version without stubs, without shutting down the system.
    The files used by me are given below.
    File Hello.java
    package example.hello;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Hello extends Remote {
    String sayHello() throws RemoteException;
    File Server.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import java.rmi.server.UnicastRemoteObject;
    public class Server implements Hello {
    public Server() {}
    public String sayHello() {
    return "Hello, world!";
    public static void main(String args[]) {
    try {
    LocateRegistry.createRegistry(1099);
    Server obj = new Server();
    Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
    // Bind the remote object's stub in the registry
    Registry registry = LocateRegistry.getRegistry();
    registry.bind("Hello", stub);
    System.err.println("Server ready");
    catch (Exception e)
    System.err.println("Server exception: " + e.toString());
    e.printStackTrace();
    File Client.java
    package example.hello;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    public class Client {
    private Client() {}
    public static void main(String[] args) {
    String host = (args.length < 1) ? null : args[0];
    try {
    Registry registry = LocateRegistry.getRegistry(host);
    Hello stub = (Hello) registry.lookup("Hello");
    String response = stub.sayHello();
    System.out.println("response: " + response);
    } catch (Exception e) {
    System.err.println("Client exception: " + e.toString());
    e.printStackTrace();
    First I run file Server.java using the following script (server.bat)
    java -Djava.rmi.server.ignoreStubClasses=true -classpath .; example.hello.Server
    pause
    Then the client is run using the following script (client.bat)
    java -classpath .; example.hello.Client 132.186.96.210
    pause
    While running the client, the following exception is obtained.
    Client exception: java.rmi.ServerException: RemoteException occurred in server thread; nested except
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at example.hello.Client.main(Client.java:52)
    Caused by: java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
    java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.rmi.UnmarshalException: skeleton class not found but required for client version
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:243)
    ... 6 more
    I am not able to figure out why this thing is happening, If i also set the property java.rmi.server.ignoreStubClasses=true on the client side everything goes fine. But this I can't do. I can't set the property on the client side as the system is up and already running.
    I am using JDK version 1.5.0_06. Same exception comes under JDK 6.0
    Any help will be highly appreciated.

    I think this is a bug. When you exported the Registry from your server JVM it was also exported with java.rmi.server.ignoreStubClasses=true, but the Registry bootstrap at the client requires the 1.1 stub protocol for compatiblity reasons so you got this error. I would report this on the Bug Parade.
    You could get around it by setting java.rmi.server.ignoreStubClasses after exporting the Registry.
    BTW java.rmi.server.ignoreStubClasses isn't supposed to do anything at the client whether true or false so you can cut your testing space in half.

  • Java.rmi.server.SkeletonMismatchException: interface hash mismatch

    I am trying to get a MBORemoteSet from the session, which actually gives me the list from the database table. when i click on a combo box returning me the list using the MBOSetRemote object it throws me the exception.
    could not load the labor codes from Maximo
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.server.SkeletonMismatchException: interface hash mismatch
    java.rmi.server.SkeletonMismatchException: interface hash mismatch      
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:240)      
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)      
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:349)      
    at worktech.app.labor.WTLaborSet_Stub.setWhere(Unknown Source)

    Well this error occurs if the RMI files are different on the server and client side.
    It basically tells you that the stub and skeleton don't match with each other. Get the latest version of the RMI jar file or whatever file you are using on the server side to replace the file you are using oon the client side. This would make stub and skeletons to communicate with each other effectively . enjoy :)

  • How to Start Java RMI Server Application as Windows NT Service

    Hi!!,
    I have problem regarding the Installation of Java Application as NT Service this Java app in turn will start RMI Registry using LocateRegistry.createRegistry() at some specific port number. The Service is created successfully but i have problem regarding the Accessing of this Remote Object using Lookup() .(ie) I am able to get the RMI Registry Obj Refererce of the Java Rmi Application but couldn't able to Lookup for the Object registered to this Rmi Registry.I am not able to proceed after getting the Rmi Registry reference.
    So any help Regarding this is appreciated.
    Thanks in Advance.
    with regards,
    Ramakrishna M
    Mail: [email protected]

    Hello,
    I have started a Java RMI Server Application as NT Service using JNT (download it from www.eworksmart.com/JNT/ ).
    It is working fine.
    S. Navaneethakrishnan
    [email protected]

  • Java.rmi.server.ExportException: while stopping weblogic Managed server

    Hello,
    I am getting the below error while I try to stop the weblogic managed server from the stop script in the server. I am able to do it thru the console.
    the weblogic version is 9.23.
    -server -Xms1536m -Xmx1536m
    Stopping Weblogic Server...
    Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 9990; nested exception is:
         java.net.BindException: Address already in use
    I am a newbie , so anyone could help me figure out the things I need to check so that I can troubleshoot the issue?
    thanks in advance.

    Are you using a custom script or <domain>/bin/stopManagedWebLogic.sh ?
    The msg you've informed seems to be an error that happens when you try to start a managed server that is trying to use a port that is already in use.

  • Java.rmi.server.ExportException: Listen failed on port: 1099;

    Hi All,
    I am trying to run RMI tutorial from sun's java tutorial. It has 8 parts. The last two parts are "Compiling the Example Programs" and "Running the Example Programs".
    Until "Compiling the Example Programs", I am okay.
    But I am stuck in the last part, "Running the Example Programs". When I use the command "rmiregistry", it gives me a list of exceptions as follows.
    c:\home\ann\src>rmiregistry
    java.rmi.server.ExportException: Listen failed on port: 1099; nested exception is:
    java.net.SocketException: Permission denied: listen failed
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:312)
    at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:218)
    at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:393)
    at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:129)
    at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:190)
    at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:92)
    at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:78)
    at sun.rmi.registry.RegistryImpl.main(RegistryImpl.java:322)
    Caused by: java.net.SocketException: Permission denied: listen failed
    at java.net.PlainSocketImpl.socketListen(Native Method)
    at java.net.PlainSocketImpl.listen(PlainSocketImpl.java:380)
    at java.net.ServerSocket.bind(ServerSocket.java:320)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at java.net.ServerSocket.<init>(ServerSocket.java:97)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(RMIDirectSocketFactory.java:27)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(RMIMasterSocketFactory.java:333)
    at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:649)
    at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:299)
    ... 7 more
    c:\home\ann\src>
    Then, I try to use "start rmiregistry" command. At that time, a command window stating the above exception popup just for a while and closed automatically.
    Now, I use jdk1.6.0_16 on Windows Vista.
    Previously, I used j2sdk1.4.2_19. That time, I could run "start rmiregistry" properly and could try testing another RMI example application.
    But if I use j2sdk1.4.2_19, compiling some statements in the sun's RMI tutorial gives me error. So, I change to use jdk1.6.0_16 for this tutorial. "jdk1.6.0_16" compiles all programs in the tutorial with no error. But I can't run the statement "start rmiregistry".
    I use the command prompt from Vista's default Administrator account and already disable User Account Control too.
    Any help, please!
    Thanks a lot,
    atzm111

    Hi,
    This is the result of netstat -an
    c:\home\ann\src>netstat -an
    Active Connections
    Proto Local Address Foreign Address State
    TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:2868 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:3999 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:49152 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:49153 0.0.0.0:0 LISTENING
    TCP 0.0.0.0:49154 0.0.0.0:0 LISTENING
    TCP 192.168.1.102:139 0.0.0.0:0 LISTENING
    TCP 192.168.1.102:49475 64.233.189.17:80 ESTABLISHED
    TCP 192.168.1.102:49620 64.233.189.83:80 ESTABLISHED
    TCP 192.168.1.102:49625 72.5.124.102:80 ESTABLISHED
    TCP 192.168.1.102:49626 72.5.124.102:80 ESTABLISHED
    TCP 192.168.1.102:49627 72.5.124.102:80 ESTABLISHED
    TCP 192.168.1.102:49628 72.5.124.102:80 ESTABLISHED
    TCP 192.168.1.102:49629 72.5.124.102:80 ESTABLISHED
    TCP 192.168.1.102:49631 72.5.124.61:80 TIME_WAIT
    TCP 192.168.1.102:49634 124.155.222.16:80 ESTABLISHED
    TCP [::]:135 [::]:0 LISTENING
    TCP [::]:49152 [::]:0 LISTENING
    TCP [::]:49153 [::]:0 LISTENING
    TCP [::]:49154 [::]:0 LISTENING
    UDP 0.0.0.0:123 *:*
    UDP 0.0.0.0:500 *:*
    UDP 0.0.0.0:4500 *:*
    UDP 0.0.0.0:5355 *:*
    UDP 127.0.0.1:1900 *:*
    UDP 127.0.0.1:51196 *:*
    UDP 127.0.0.1:64757 *:*
    UDP 192.168.1.102:137 *:*
    UDP 192.168.1.102:138 *:*
    UDP 192.168.1.102:1900 *:*
    UDP 192.168.1.102:51195 *:*
    UDP [::]:123 *:*
    UDP [::]:500 *:*
    UDP [::]:5355 *:*
    UDP [::1]:1900 *:*
    UDP [::1]:51193 *:*
    UDP [fe80::100:7f:fffe%16]:1900 *:*
    UDP [fe80::100:7f:fffe%16]:51194 *:*
    UDP [fe80::18c1:1fa4:382b:261%12]:1900 *:*
    UDP [fe80::18c1:1fa4:382b:261%12]:51191 *:*
    UDP [fe80::69bc:321e:5e99:dc7c%11]:1900 *:*
    UDP [fe80::69bc:321e:5e99:dc7c%11]:51192 *:*
    UDP [fe80::a0a0:89c2:b2fd:e4b9%13]:1900 *:*
    UDP [fe80::a0a0:89c2:b2fd:e4b9%13]:51190 *:*
    c:\home\ann\src>
    So, port 1099 is not in use. I don't know how to check your second fact. I'll find it out coz I can't ask you. :D
    Thanks!

  • About java.rmi.server.UnicastRemoteObject

    Hi friends
    Just now I started studying about RMI. In Implementing Remote Interface class we extends java.rmi.server.UnicastRemoteObject class we also have java.server.RemoteObject also why we specifically extends UnicastRemoteObject what is the significance of it
    can anyone help me plz
    thank u

    UnicastRemoteObject is a base class that can make your object a remote object. (If you create an object that DOESN'T extend UnicastRemoteObject, then it's methods cannot be accessed remotely.

  • Java.rmi.server.codebase in JSP

    Hi,
    i have a system made from an RMI client and an RMI server. The users access the system through a JSP page, which creates an instance of the RMI client. In order for the system to work, i need to specify the java.rmi.server.codebase property.
    For testing purposes the client has a main(..) method. If i run just the client the server and specify java.rmi.server.codebase, everything works.
    If i don't specify it i get a java.rmi.UnmarshalException, with the nested exception of ClassNotFound. The same exception i get trying to access the jsp page. So, i guess, it's due to the lack of the property.
    I tried setting the property in the jsp page, but it doesn't work.
    Thank you.
    P.S. : maybe this is relevant: my jsp server is tomcat 6.0.

    it refers to where are your stubs and skeletons
    you can set it to point to the jar files or to the directory that contains them
    hope htis helps
    regards
    marco

  • Java.rmi.server.ExportException...

    I am making a bridge code.
    the server is in a package called bridgeserver.
    The client in a package called bridgeclient.
    I have compiled all files in the packages.
    I do rmic bridgeserver.BridgeServer(name of server program) from jdk1.3
    I do c:\jdk1.3 >rmic bridgeclient\BridgeClient(name of client).
    then start rmiregistry
    then when I do java bridgeserver.BridgeServer(runnign thr server) I get the follwowing exceptions:
    java.rmi.server.ExportException : Unable to access remote reference,
    nested exception is
    java.rmi.server.SkeletonNotFoundException:
    Skeleton class not found :bridgeserver.BridgeServer_Skel;nested exception is ;
    java.lang.ClassNotFoundException :bridgeserver.BridgeServer-Skel
    Is there sometyhign wrong with the classpath?

    on your rmic line include the option
    -v1.2
    This should get rid of skeleton junk. (But of course may uncover other problems.)

Maybe you are looking for