Choosing the port of an RMI server

I need a server working on a port wich is differet from the default 1099, e.g. 2500.
I create my server object which extends UnicastRemoteObject with code like this
public MyServer(int port)
super(port);
Befor starting the server I run rmiregistry 2500 and the I pass the port number to the server by command line.
It seems all right to me but I get the same an error message.
What's wrong?
Thanks in advance for answers

I' m sorry. I'm new to RMI and I wrote a Chess Playing RMI software for university. I have managed to make it work on the default port but I don't know how to "escape" from 1099.
I surfed the Internet for tutorials or code samples but they simply say: "To create an RMI server on the default port 1099 write code like this..." and I can't find the way of changing the port anywhere.
I didn't write the exact error messaage, and I apologize for that, but it's because I did many trials and often the message changed. It's enough that someone tells me how I have to look to learn the exact way of programming an RMI server on a chosen port.
Thanks

Similar Messages

  • How to get the IP address of RMI server???

    Hi:
    Is there a way to know the IP address of RMI server before client and server connect?
    I am assuming that client didn't know the IP address of the server.
    Because I know that client must hold a server reference so that client can connect to server.
    But I want my client program to find out server IP address before they connect and use this finding to connect to server.
    Is it possible?
    Thanks!

    So you KNOW that the client MUST know where the server is yet you want the client to find out where the server is?
    Simple answer: forget it.
    If you don't know where to connect to how are you ever going to connect to it?
    And if you do know you don't have to go looking it up...
    You can probably do something with JNDI, but then you're only putting off the inevitable as now you need to both know how to contact the JNDI server AND the JNDI server needs to know where the the RMI registry for the service you want to connect to is.

  • How to set the granted permission in RMI SERVER site

    Hi everyone,
    I have developin some simple RMi program but the error message is keep on prompting out and I cant really test out what is the result. I understand I got to GRANT the permission for the RMI but I I dun really know where should I start first. I know there are code that can be implement in the sErver site, just hope some one can guide me out.
    Thank lot...
    here is the code for server:
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class myRMIServer
    public static void main(String[] argv)
    System.setSecurityManager(new RMISecurityManager());
    try
    myRMIImpl implementation = new myRMIImpl("myRMIImplInstance");
    catch (Exception e)
    System.out.println("Exception occurred: " + e);
    Where should i code the getProperties and setProperties code...

    so, what u mean is the problem occur doesnt related to coding part ?? do you think it is because I did not start the rmiRegistry, but somehow when i started the rmiRegistry, the console window is blank an it is nothing in the window. pls pls help me to solve this problem... sound easy initially but end up it is not...
    by the way, here is the code
    Interface
    public interface myRMIInterface extends java.rmi.Remote
    public java.util.Date getDate() throws java.rmi.RemoteException;
    Interface Implementation
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class myRMIImpl extends UnicastRemoteObject implements myRMIInterface
    public myRMIImpl(String name) throws RemoteException
    super();
    try
    Naming.rebind(name, this);
    catch(Exception e)
    System.out.println("Exception occurred: " + e);
    public java.util.Date getDate()
    return new java.util.Date();
    server
    import java.rmi.*;
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.LocateRegistry;
    import java.util.Properties;
    public class myRMIServer
    public static void main(String[] argv)
    //System.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");           
    //System.getProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
         //myRMIServer m = System.getProperties();
         //m.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
         //System.setSecurityManager(new RMISecurityManager());
    //Properties p = System.getProperties();
    //p.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy");
    try
    myRMIImpl implementation = new myRMIImpl("myRMIImplInstance");
    Properties p = System.getProperties();
         System.setProperty("java.security.policy","C:\\workspace\\MyRMI\\java.policy.txt");
         System.setProperty("java.rmi.server.codebase","file:///P:\\Projects\\RMIServer\\bin");
         if (System.getSecurityManager() == null) {
         System.setSecurityManager(new RMISecurityManager());
         System.out.println("Security manager registered");
         //System.out.println("Service registered");
    catch (Exception e)
    System.out.println("Exception occurred: " + e);
    here is the code, to run, I got a client one as well, but is just for displat purpose..
    thank you, guys....really appreciate ur help

  • Unable to conclude on the Port on which SQL Server is Listening

    Hello,
    I have two instances of SQL Server installed on a Server.
    The First Instance is in stopped state and Second Instance Port Status can be seen in the attached screenshot.
    Dynamic Ports:55005
    TCP Port:1433
    I was not able come to conclusion on the port that SQL server is listening on because when I try netstat I see both the Ports listening.
    sadankumar

    Just simple query in SSMS
    SELECT  CONNECTIONPROPERTY('local_tcp_port') AS local_tcp_port
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • The port number of PI server

    Hi Gurus,
    I have a B2B scenario including our ECC system @ intranet and the target system @Internet, but unfortunately our PI server is not permitted to connect to the internet so it can not reach the target system, now I have to ask our network support to enable the PI server to communicate with internet via some specific port ,so the problem is:
    which port number should i provide to the network support ?, the adapter type we use for this scenario is JDBC
    i know there are many port definition in the ExchangeProfile settings,
    for example:
    com.sap.aii.connect.directory.mshttpport --> 8101
    but i am not sure which port i should use.
    pls advise
    thanks in advance

    Hi,
    Request your basis team to enable your PI Server to Internet connection mode,and provided your PI Server applictaion server IP adress,they will enable it.,
    Regards,
    Raj

  • RMI SERVER behind the router....!!!!!!!!!!!!

    Hi I am new here...And Have a problem regarding to java RMI...
    I have a uni assignment which asks us to write an online tic tac toe game using RMI..well assigment only request if it can be run on the same machine and I finished..
    But now I am trying to config it to real life with internet instead of LAN.
    Basically I have one static IP assigned by my ISP... and I have local IP addresses on my machines. The addresses will be translated by my router to the public one...
    My server is running on port 8081 of my server computer with an local IP addresses... and I did port forwarding in my router to forward all the 8081 request to this server...
    And the the client use the public IP to locate my server they can acctually connect to my server and get the stub or ref to it...But when they acctually trying to call a method on
    the server side, I realised they actually using the local IP addresses of my server machine instead of the public one..so i think the stub acctually bind the machine IP and ask client to use this IP to communicate.
    This obviously not going to work...And In the API it seems like I can not acctually do anything about IP address when create the Registry..
    Any clue on this Thank you.......

    No, the stub consists of a single Java object which contains the IP address and port number of the host from which the remote object was exported. The client knows the initial lookup address for the Registry but it performs all subsequent communications via the information embedded in the stub.
    @OP: you need to export your remote object on a fixed port, have the router forward that port, and set the system property java.rmi.server.hostname in the server JVM to the external IP address of the router.

  • How to know the port number to which the server process is listening

    I have created oracle 10g Release 1 database(orcl) in Windows Xp Professional edition through DBCA . I also created one more database(sample) manually .
    The ORCL server process listens to port no 1521 and
    SAMPLE server process listens to port no 1522
    Once I start the OracleServiceORCL (Service for orcl) from services.msc and check the listener status it displays
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    But when I start OracleServiceSAMPLE (Service for sample) from services.exe and check the listener status there is no change . Only when i start the instance the dynamic registration takes place with port no 1521 .
    There is no entry for listener parameter in init.ora file . My question is how is the service ORCL able to get itself registered with the listener even before the instance is up ?
    And how can i know which port no is linked with which server process?
    Also if we provide a different port number(other than 1521 say 1522) in tnsnames.ora for a service and consider the listener is listening to both 1521 and 1522 . Now consider that port number 1521 is free . In this case to which port number will the service be listening to ?
    The listener file looks like this
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = D:\oracle\product\10.1.0\Db_2)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = irobo)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = irobo)(PORT = 1522))
    The tnsnames file has the following entry
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = irobo)(PORT = 1522))
    (CONNECT_DATA =
    (SERVICE_NAME = ORCL)
    SAMPLE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = irobo)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = ORCL)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )

    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...[coe]
    The status tells you the instance is up. Starting the service often means the instance gets started also, but whatever "often" means, "READY" means "The instance is up, running and taking callers".
    Your statement that "ORCL [is] able to get itself registered with the listener even before the instance is up" is therefore factually incorrect: you started the service, that started the instance. The instance is up and running. Instances that aren't running don't exist. Things which don't exist don't register themselves. Things which HAVE registered themselves therefore do exist.. and if they say they are "ready", it means they are completely, 100% up and running and behaving quite normally.
    I have not set LOCAL_LISTENER initialization parameter.How is this happening ?
    You only need to set LOCAL_LISTENER if (a) you're not using TCP/IP, (b) you're not using port 1521. Otherwise, PMON is hard-coded to register itself with listeners running on port 1521 and using TCP/IP and you don't need to set LOCAL_LISTENER to achieve that.
    Server Processes do not listen. Listeners do (there's a clue in their name). Listeners receive a call to connect to an instance, they spawn a server process to handle your call, and then they connect you to that server process (or send a message back to you telling you how to contact the server process). Each server process of course receives communications from its dedicated client on a specific port (usually in the 50000+ range), and that port is chosen randomly by the listener when it's spawning it. It's a bit blurry and vague to call that server process port a port on which server processes "listen", however.
    If you're talking dedicated server, each client causes one new server process to be spawned, and there is a one-to-one correspondence between server processes and the port that server process happens to accept client communications on.
    If you're going to ask a listener to do listening duty on multiple ports, I'd first question your need to do that and I'd then point out that unless your client tnsnames.ora knows to talk on the second or subsequent port numbers, the listener is never actually going to make use of that second port.
    In either case, the port the listener listens on has nothing whatsoever to do with the port your client-to-server-process communication ends up taking place on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to keep track of client in rmi server

    how can I keep track of a disconnected client in a rmi server ?
    And what logic do I use to disconnect a client fro mthe server ?

    When a RMI client receives a stub to the remote object, RMI client runtime sends a dirty() call to the RMI server runtime which in turn helps the RMI server runtime in updating the client references to the remote object. Client reference is nothing but a unique identification generated by client RMI runtime for that instance of JVM. RMI uses a reference counting algorithm for destroying unreferenced remote objects. Once all references (all clients who are holding the stub to this remote object) to a remote object drops to zero, local garbage collector takes care of freeing this remote object.
    RMI client runtime initiates a TCP connection with the remote object only when a method is invoked on the stub. RMI transport layer uses a simple connection pooling mechanism to use already established TCP connections with server objects in further remote method invocations. Let's say the client is invoking a remote method on the remote object's stub fetched from the registry service. Now RMI transport layer initiates a TCP connection with the remote object (exported at ("host1", 4567)). After completion of the remote method, RMI client's transport layer keeps the connection open for some time (some configurable value) to take the advantage of the already established TCP connection in future remote method invocations on remote objects exported on the same host and port ("Host1", 4567"). RMI transport layer also takes care of closing these connections if the connections are idle more than configured value of connection open time.
    From the RMI server's perspective, once the RMI server runtime receives a remote method invocation request from the RMI client, it creates a new thread and try to dispatch the method on the designated remote object. After returning the results of the remote method to the client, RMI client's transport layer may not end this conservation with this remote object to take the advantage of this TCP connection in future remote method invocations. So the same thread may be used for dispatching another remote method in future. This is actually the side effect of re-using the established TCP connections on the client side.
    RMI server maintains client's reference in the client's reference set of the remote object as long as the client holds a normal reference to remote object's stub in its JVM. Once the client relinquishes the reference to the stub (goes out of the scope or setting it to the null), RMI client automatically sends clean() call to the RMI server runtime to update client reference set of the remote object. There is no public API to lookup or manipulate the client references for a given remote object, but you can always unexport the remote object even some clients are holding stubs to the remote object. Next time when the client invokes the remote method using this stub, client will receive a "connection refused exception" from the server because the remote object is already unexported. Let's say if the RMI server is started again (remote object is exported and registered with registry service), the client once again obtains the stub to the remote object from the registry service instead of using earlier stale stub. (This time remote object may have been exported on different port, so the port details in the old stub may not be valid any more).
    At any point of time there can be more than one established TCP connection with the RMI client. This may be the temporary condition; RMI client's transport layer automatically closes these connections if it does not receive any remote method invocation requests with in a pre-determined interval of time (default: 2 min). You can always find out RMI client's host in a given remote invocation by using getClientHost(), but how can you semantically define a "disconnected client in a rmi server" in your application context ? You can always force all the clients to fetch the stub again in future remote method invocations by unexporting the remote object in RMI server. I hope this information helps ...
    -- Srinath Mandalapu

  • Connecting to MYSQL from RMI Server results SQL Communication fail

    Hi ,
    I have an RMI Server which exports a remote method, which in-turn needs to access content
    from the MYSQL Database.
    PROBLEM: The code snip for RMI Server is given below. In this getChief() is the remote method called
    by the RMI Client running on my same Windows XP machine (ie., localhost).
    I get a slew of exceptions when the DriverManager.getConnection() API call occurs in getChief()
    via the remote method call from the RMI Client. Two exceptions are the SQL Communications failure and Access Denied Socket Exceptions.
    I checked my policy file is OK and MySQL Server is running and my username/password is right in code?
    Can you please let me know what am I missing in the RMI Server code?
    I also found my code works if the Database Connection API is used within main() rather than inside a Remote
    Method...
    The Source and Binary are available in my local Windows XP Machine
    RMI Server: c:/workspace/DirectoryJava/src/server for and c:/workspace/DirectoryJava/bin/server
    RMI Client: c:/workspace/DirectoryJava/src/client for and c:/workspace/DirectoryJava/bin/client
    My security policy file is:
    grant codeBase "file:/workspace/DirectoryJava/bin" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/bin/client" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/bin/server" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/bin/directory" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/src/client" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/src/server" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    grant codeBase "file:/workspace/DirectoryJava/src/directory" {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*:1024-65535", "listen,connect,accept,resolve";
    permission java.net.SocketPermission "*","listen,connect,accept,resolve";
    };I checked that mysqld.exe is running at port 3306 and am able to connect to and use it via
    MySQL Command Client successfully.
    Thanks in advance.
    The Exception list is pasted below.
    c:\workspace\DirectoryJava\bin>java -cp "c:/workspace/Directory
    Java/bin/Directory.jar;c:/workspace/DirectoryJava/bin/server;c:/workspac
    e/DirectoryJava/bin;C:/Program Files/MySQL/mysql-connector-java-5.1.6/my
    sql-connector-java-5.1.6-bin.jar" -Djava.rmi.server.codebase=file:/c:/workspace/
    DirectoryJava/bin/Directory.jar -Djava.security.policy=wideopen.policy
    server.DirectoryEngine
    DirectoryEngine bound
    getChief() Called
    SQLException: Communications link failure
    Last packet sent to the server was 0 ms ago.
    SQLState: 08S01
    VendorError: 0
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link fai
    lure
    Last packet sent to the server was 0 ms ago.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1
    074)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :282)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at server.DirectoryEngine.getChief(DirectoryEngine.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
    rce)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: java.security.AccessControlException: acces
    s denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve)
    at com.mysql.jdbc.StandardSocketFactory.unwrapExceptionToProperClassAndT
    hrowIt(StandardSocketFactory.java:404)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:265)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2026)
    ... 26 moreCODE SNIP:
    =========
    public class DirectoryEngine implements Directory {
    public DirectoryEngine() {
    super();
    public Employee getChief() throws RemoteException {
    Statement stmt = null;
    ResultSet rs = null;
    Employee emp = null;
    // TODO Auto-generated method stub
    try {
    System.out.println("getChief() Called");
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306",
    "<username>","<password>");
    // Username and Password were replaced with root username and password in my original code
    System.out.println("getConnection() Called");
    stmt = conn.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    System.out.println("createStatement() Called");
    rs = stmt.executeQuery("use mysql");
    } catch (SQLException ex) {
    // handle any errors
    System.out.println("SQLException: " + ex.getMessage());
    System.out.println("SQLState: " + ex.getSQLState());
    System.out.println("VendorError: " + ex.getErrorCode());
    ex.printStackTrace();
    } catch (Exception e) {
    e.printStackTrace();
    } finally {
    // it is a good idea to release
    // resources in a finally{} block
    // in reverse-order of their creation
    // if they are no-longer needed
    if (rs != null) {
    try {
    rs.close();
    } catch (SQLException sqlEx){
    // ignore
    rs = null;
    if (stmt != null) {
    try {
    stmt.close();
    } catch (SQLException sqlEx) {
    // ignore
    stmt = null;
    return emp;
    } /* getChief() ends */
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new SecurityManager());
    try {
    String name = "Directory";
    Directory engine = new DirectoryEngine();
    Directory stub =
    (Directory) UnicastRemoteObject.exportObject(engine, 0);
    Registry registry = LocateRegistry.getRegistry();
    registry.rebind(name, stub);
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    System.out.println("DirectoryEngine bound");
    } catch (Exception e) {
    System.err.println("DirectoryEngine exception:");
    e.printStackTrace();
    } /* end DirectoryEngine class */

    It looks there is some permission issue.
    Can you please try once with below policy and let me know the result.
    grant {
      permission java.security.AllPermission;
    };

  • RMI server object lookup in a session bean

    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

    Hi Pyung,
    How about trying this instead:
    InitialContext ctx = new InitialContext();
    MediatorInterface mediator = (MediatorInterface) ctx.lookup("TestMediator");
    This assumes your startup class binds the Mediator to the JNDI name "TestMediator".
    - Matt
    Pyung Yoon wrote:
    Hi all,
    I am getting MarshalException when I call java.rmi.Naming.lookup() in a session
    bean. Following is the code and exception. Please note that I am using java.rmi
    package instead of weblogic.rmi and that both the session bean and RMI server
    object (a startup class) is deployed on the same machine.
    Thanks for your help in advance.
    // a simple, replica-aware session bean method
    // some code here
    try {
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);
    catch (Exception e) {
    // log the exception
    The exception:
    java.rmi.MarshalException: Error marshaling transport header; nested exception
    i
    s:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(DataInputStream.java:224)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at test.mgmtop.CreateNetworkOpHandler.execute(CreateNetworkOpHandler.jav
    a:88)
    at test.mgmtop.CreateNetworkOpHandler.perform(CreateNetworkOpHandler.jav
    a:28)
    at test.ejb.MgmtServiceBean.create(MgmtServiceBean.java:57)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl.create(MgmtServiceSession_i
    di8yo_EOImpl.java:46)
    at test.ejb.MgmtServiceSession_idi8yo_EOImpl_WLSkel.invoke(Unknown Sourc
    e)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
    ef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:762)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
    a:295)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)

  • Is it possible to set a port number for a server as a value from env ?

    Hello,
    I'm using the version 6.1 - sp8 and I'd like to set the port number of a server as a value returned by an environment variable. Will this be achievable somehow through the admin console?
    In fact, I have an environment variable called '$WEB_SERV_PORT'. I'd need this value to be assigned as the port number for a server. The reason why I am trying to do this is coz I have multiple instances running as different batch accounts and each batch account would be having its own '$WEB_SERV_PORT' which would be the port on which iplanet would be running for that batch account.
    I'd appreciate if anyone could help.
    Thank you,
    Presley.

    Hello Sriram,
    Thanks for the info that you have provided. I do agree that what you said would be a better approach.
    However I've got a couple of questions on the approach that you have suggested (Sorry that its a bit off from the main topic). Just wanted to clarify if what I thought is in sync with the approach that you suggested.
    1. As you said, I could setup multiple virtual server within an instance (https-<hostname>) - Does this mean that I am creating "Virtual Server Classes" for each server and through the web-applications tab, assigning the corresponding war file to each Virtual Server Class?
    2. Another approach that came upto my mind is that I could create different instances like (https-virtual server1, https-virtual server2, https-virtual server3 etc..). I am assuming that if I follow this approach, I could have each server allocate memory indiviually to the virtual servers. for eg, I could allocate
    1024 MB to each virtual server where as in the first approach, I would have to make the 1024 MB to share between all the Virtual Server Classes. And also, in the case theres an issue with one server, I could handle the start/ stop etc individually, where as in the 1st approach, all the virtual classes would be affected by the start/stop. Am I assuming it correctly ?
    I'd appreciate if you could let me know.
    Thank you,
    Presley.
    Edited by: pressley on Mar 26, 2008 7:04 AM

  • 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.)

  • -Djava.rmi.server.codebase Question.

    When I study the meaning of codebase in
    http://java.sun.com/j2se/1.3/docs/guide/rmi/codebase.html
    , I am still confuse what is different between codebase
    settings in Remote Object side and RMI Client side.
    The command options -Djava.rmi.server.codebase=
    http://myHost/myDir and -Djava.rmi.server.codebase=
    http://wwwserver/mydirectory ( in Figure3 and Figure4 of
    http://java.sun.com/j2se/1.3/docs/guide/rmi/codebase.html
    ) are set in which side ??
    The option in Remote Object side seems no any work.
    Who can explain its meaning ??
    Thank you in advance... Alan.

    Hi,
    For the dynamic class loading to work, you should give
    -Djava.rmi.server.codebase=http://some-server/
    you can see that it supports http protocol.. So there should be one web server running on the server side so that client can call it by name or by IP address.. Then try running the program again. now it will work..
    actually you should give this option on client side as it is the client who needs this property.. so in order to download classes the server machine should be addresable to the client in any method. if it is a LAN, try giving '\\computer-name' in the value of the property.. I haven't tried this, but I think you dont need a http server this time.. I am not sure abt this,,. check it out..
    - Bibin.

  • RMI Server and Provider Services

    Hi Everyone,
    Can I know whats the role of Planning RMI server and Provider Services. On what specific situations do we need to restart those??
    Thanks in Advance

    Any help on this please!!

  • 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

Maybe you are looking for

  • Database Diff script creates redundant indexes and fails

    In Version 4.1.0.18, I create a table such that the primary key constraint and unique index have the same name:     CREATE TABLE "MY_TABLE"      ( "CORP_ID" CHAR(2 BYTE),        "COMPANY_ID" NUMBER(5,0),        CONSTRAINT "PK_MY_TABLE" PRIMARY KEY ("

  • Get the date and time from iframe.

    Hi, Am using jdeveloper 11.1.1.6.0., I have used the following iframe source which gets the date and time. <af:form> <iframe src="http://free.timeanddate.com/clock/i3xb4nm0/n1722/tt0/tw0/ts1" frameborder="0" width="244" height="19">       </iframe> <

  • F2 Key - Problem with F2 key.

    Can anyone help, F10 works fine, when I press F2 nothing happen. The key press is not even registered. I have attached the code public class MidgetSelect extends JDialog implements KeyListener {     private JFrame parent = null;     private JTextArea

  • Auto select for single row LOV

    Hi, I am using jdev 11.1.1.4. I need to automatically fetch the record from LOV ViewObject if the LOV ViewObject has only one row. I am new to adf , can anyone give an idea on this?

  • Import mov error.  "The file has no audio or video stream".

    Very interesting.   Would this also explain why i was previously able to import some high def files I downloaded and after the reformat of my computer and reload of cs5.5, I'm now not able to use those files?  It's very strange.  I did a project, use