RMI Error codebase

Every thing works just fine as both the Client and server runs on the same system,, but as i run one of them on a remote m/c,well i am using vmware for that, Client is not able to locate server's stub and server is not able to locate clients classes for dynamic loading..
I am sure its an issue with the way i set the codebase url's but how should i change them.
presently, i set them as
file:/E:/surshikradmin/workspace/rmi-server/bin/ for server..
and kind of same way for client.. should i add the host name too,,but how??? Any help would be highly helpful since its been years i am dealing with issue and solving it will make ma project go rock..

User, I'm not sure what you are talking about.
This is the jdev and adf forum we normally don't use RMI so chance it that you are in the wrong forum.
Timo

Similar Messages

  • Lesson 8: RMI, Error in Run the RemoteServer Server Object

    Hello guys,
    Please Help!
    I try to test and run the samples in
    JavaTM Programming Language Basics, Part 1
    Lesson 8: Remote Method Invocation
    http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/rmi.html
    I already compiled the samples, but when I testing to run the RemoteServer Object it gives me error.
    Here's the following line command:
    java -Djava.rmi.server.codebase=file:
    g:\home\zelda\public_html\classes
    -djava.rmi.server.hostname=kq6py.eng.sun.com
    -Djava.security.policy=java.policy RemoteServer
    The ERROR:
    Exception in thread "main" java.security.AccessControlException: access denied (
    java.net.SocketPermission kq6py.eng.sun.com resolve)
    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.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at RemoteServer.main(remoteserver.java:38)
    PLEASE HELP!!!
    Thanks in advance,
    Rodel

    Oooppssss, I got it.
    uh huh!!!!

  • RMI Server Codebase Permission Denied

    I'm having a problem trying to get my application running in a test environment. I currently have this same application up and running in an almost identical location without any issues, and I'm at a loss to understand what the problem is.
    My application is an RMI server-client setup. At the moment, I'm having trouble with solely the server portion, as I'm unable to get it to access the codebase. I start the application with the following runServer.sh file (located in /usr/local/app/app, so the $ROOT_DIR=pwd is correct):
    Line: -----
    #!/bin/bash
    ROOT_DIR=`pwd`
    JAVA_HOME=/usr/java/latest
    CLASSPATH=''
    #:: Please edit the environmental variables below so that it refers
    #:: to the location where you have distribution URL.
    DISTRIBUTION_URL=file://$ROOT_DIR
    find /usr/local/app/app/server -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    find /usr/local/app/app/import -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    find /usr/local/app/app/common -name '*.jar' -type f -print | while read FILE
    do
    if [ $CLASSPATH ]
    then
         CLASSPATH=$CLASSPATH:$FILE
    else
         CLASSPATH=$FILE
    fi
    echo $CLASSPATH > classpath.env
    done
    read CLASSPATH < classpath.env
    echo ${CLASSPATH}
    cd server
    # start /min "RMI Registry"
    $JAVA_HOME/bin/rmiregistry &
    JAVA_SECURITY="-Djava.security.policy==config/admin.policy -Djava.security.auth.login.config==config/app_jaas.config"
    IMPORT_PROPERTIES="-Dapp.import.properties=file://$ROOT_DIR/import/config/import.properties -Dapp.import.logging.properties=file://$ROOT_DIR/import/config/importlog.properties -Dapp.client.properties=file://$ROOT_DIR/client/config/client.properties"
    app_PROPERTIES="-Dapp.root=$ROOT_DIR -Dconnection.pool.properties=file://$ROOT_DIR/server/config/database.properties -Dapp.common.properties=$DISTRIBUTION_URL/common/config/common.properties -Dapp.server.properties=file://$ROOT_DIR/server/config/server.properties -Dapp.server.logging.properties=file://$ROOT_DIR/server/config/log.properties"
    echo
    echo "-------------- app Server -------------------"
    echo
    $JAVA_HOME/bin/java -ms96m -mx256m -classpath $CLASSPATH -Djava.rmi.server.codebase=file:///usr/local/app/app/common/lib/common.jar $IMPORT_PROPERTIES $JAVA_SECURITY $app_PROPERTIES -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n app.serverimpl.ServerStarter
    cd $ROOT_DIR
    Line: -----
    After running this, it fails at that last line, $JAVA_HOME/bin/java etc. Near as I can see from the error is that it cannot access the -Djava.rmi.server.codebase.
    Line: -----
    app.serverimpl.service.ServiceException:java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at app.serverimpl.service.LoginManagerServiceImpl.start(LoginManagerServiceImpl.java:52)
    at app.serverimpl.service.ServiceAdapter.start(ServiceAdapter.java:96)
    at app.serverimpl.service.ServiceManager.startup(ServiceManager.java:78)
    at app.serverimpl.ServerStarter.main(ServerStarter.java:62)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:445)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:182)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:214)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1592)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
    ... 12 more
    Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /usr/local/app/app/common/lib/- read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
    at java.security.AccessController.checkPermission(AccessController.java:553)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at sun.rmi.server.LoaderHandler$Loader.checkPermissions(LoaderHandler.java:1173)
    at sun.rmi.server.LoaderHandler$Loader.access$000(LoaderHandler.java:1127)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:409)
    ... 21 more
    Line: -----
    Out of growing desperation (and since it's a test VM in virtual box so I'm not really protecting anything) I've already granted full permissions to everyone for these these files in the filesystem itself - chmod -R 775 - and I've made sure that common.jar is accessible. I also double-checked the Security Policy, Djava.security.policy, and that's just a straight all permission to everything (again, I'm not protecting anything on this test).
    Line: -----
    grant {
    permission java.security.AllPermission;
    Line: -----
    What's really driving me nuts is that this exact same code is already running and working on another machine. There are no environment variables that I'm missing, and I don't see how those would relate to this problem even if I did. The directories are identical, and I've verified the location that's listed as the cause (/usr/local/app/app/common/lib/) exists and is accessible. I keep coming back to the file permissions and the security policy and I'm sure I could be missing something obvious, but I am not seeing it at all. Can anyone give me some advice on this?
    I'm running a VM in VirtualBox 4.1.4, running CentOS 5.7 32-bit. Java is JDK 1.6.0, just the basic yum install package.

    This is a .policy file problem, not a filesystem permissions problem. Run it with -Djava.security.debug=access,failure to see exactly what is going on. Basically your .policy file either doesn't grant the required FilePermission or isn't being loaded.
    NB a codebase of a local JAR file isn't going to work unless all the clients are in the same host.

  • Simple RMI error

    Hello,
    I'm trying to compile and execute a simple RMI example. The compilation is OK.
    The rmiregistry is running.
    I'm using windows and java 1.5
    I have the files:
    Server <== the Server
    myStudentImpl <== remote object
    myStudent <== interface
    myStudentImpl_Stub <== the Stub of myStudentImpl (generated by rmic)
    When I'm trying to execute the command from the Server file
    Naming.rebind("john",student);
    I'm getting an error.
    Error:RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: myStudentImpl_Stub
    Then I executed
    C:\myrmi2>java -Djava.rmi.server.codebase=c:/myrmic2 Server
    .... and I got the below error
    Error:Error unmarshaling return; nested exception is:
    java.net.MalformedURLException: unknown protocol: c
    Probably, I have a mistake with the environment variables.
    Can anybody help me, please?
    Thanks

    Now I'm getting
    Error(2):error marshalling arguments; nested exception is:
         java.io.NotSerializableException: testprovider.DS.DS_TicketImpl
    This is my interface
    public interface DS_Ticket extends Remote
    public EncryptedTicket RequestTicket(RequestForTicket req) throws RemoteException;
    This is my return object
    public class EncryptedTicket implements java.io.Serializable
    public byte[] cipherToken2;
    public byte[] cipherSignToken2;
    public byte[] cipherSignature;
    public String Description;
    This is the parameter object
    public class RequestForTicket implements java.io.Serializable
    public PublicKey pubKey;
    public byte[] e_s_Token2;
    public byte[] e_Token2;
    public byte[] BeKey;
    public byte[] BeToken;
    public byte[] signature;
    Any idea what I'm doing wrong?
    Thank you very much

  • Encountering Java RMI error trying to install IDM 11.1.1.6

    Hi all,
    I'm completely stumped trying to install Oracle identity management 11.1.1.6 from the download here
    http://www.oracle.com/technetwork/middleware/id-mgmt/downloads/index.html
    I am on RHEL 5.5 x64, clean install into a Xen VM, all the latest updates applied.
    What I have done so far is as follows.
    Install GI and DB 11.2.0.3.0 for a single instance using ASM
    Set up some ASM disk groups using iSCSI attached storage
    Create a database using DBCA
    Install RCU 11.1.1.6 and create the necessary repository schema for IDM
    Install Sun JDK 1.6.0_38
    Install Weblogic server 10.3.6 - downloaded from eDelivery
    Carry out a software only installation of IDM
    Use $MW_HOME/Oracle_IDM1/common/bin/config.sh to create a Weblogic domain which supports IDM
    Run $MW_HOME/Oracle_IDM1/bin/config.sh to try and configure IDM
    Sadly at this last step I am encountering an RMI error from the weblogic admin server whien specifying which components I want to configure - the installer is connecting to the running server but I get an RMI exception in the logs, the installer reports INST-5194: Unable to connect to the Oracle WebLogic Middleware Administration Server and it won't go any further. Full error stack follows. Anyone got any suggestions? I'm really scratching my head here.
    ####<Jan 8, 2013 9:44:12 AM GMT> <Warning> <RMI> <perses> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <c973505a4484734b:-5669ab43:13c160fd34d:-8000-0000000000000019> <1357638252608> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnectionImpl.getAttribute(Ljavax.management.ObjectName;Ljava.lang.String;Ljavax.security.auth.Subject;)
    java.lang.NullPointerException.
    java.lang.NullPointerException
         at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
         at weblogic.management.mbeanservers.internal.JMXContextInterceptor.getMBeanContextLoader(JMXContextInterceptor.java:475)
         at weblogic.management.mbeanservers.internal.JMXContextInterceptor.getAttribute(JMXContextInterceptor.java:146)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$12.run(WLSMBeanServerInterceptorBase.java:326)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.getAttribute(WLSMBeanServerInterceptorBase.java:324)
         at weblogic.management.mbeanservers.internal.SecurityInterceptor.getAttribute(SecurityInterceptor.java:299)
         at weblogic.management.jmx.mbeanserver.WLSMBeanServer.getAttribute(WLSMBeanServer.java:279)
         at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder$5$1.run(JMXConnectorSubjectForwarder.java:326)
         at java.security.AccessController.doPrivileged(Native Method)
         at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder$5.run(JMXConnectorSubjectForwarder.java:324)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder.getAttribute(JMXConnectorSubjectForwarder.java:319)
         at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1431)
         at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:74)
         at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1295)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1394)
         at javax.management.remote.rmi.RMIConnectionImpl.getAttribute(RMIConnectionImpl.java:630)
         at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    >

    Did you manage to solve this issue?
    I'm running into the exact same error, but installing 11.1.1.7.0 on Windows 2003
    Haven't found anything on MOS yet :(
    Kind regards,
    Rob
    Edited by: rgouw on 10-apr-2013 1:10

  • RMI Error when trying to connect to remote server

    We are getting an RMI error (below) when trying to connect to a remote weblogic 9 server with mission control.
    We are running a portal application on the app server. If we connect using mission control before the app starts then mission control connects successfully.
    If we wait until the portal application is running then we get the following error when we try to connect:
    Could not open Management Console for UAT Live (1).
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.lang.ClassNotFoundException: com.vignette.monitor.framework.VgnMBeanInfo (no security manager: RMI class loader disabled)
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.lang.ClassNotFoundException: com.vignette.monitor.framework.VgnMBeanInfo (no security manager: RMI class loader disabled)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
         at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
         at javax.management.remote.rmi.RMIConnectionImpl_Stub.getMBeanInfo(Unknown Source)
         at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getMBeanInfo(RMIConnector.java:1031)
         at com.jrockit.console.rjmx.RJMXConnection.getMBeanInfos(RJMXConnection.java:262)
         at com.jrockit.console.rjmx.RJMXConnection.getMBeanInfos(RJMXConnection.java:297)
         at com.jrockit.console.rjmx.RJMXConnectorModel.initializeAttributeInfos(RJMXConnectorModel.java:294)
         at com.jrockit.console.rjmx.RJMXConnectorModel.<init>(RJMXConnectorModel.java:99)
         at com.jrockit.console.rjmx.RJMXConnectorModel.<init>(RJMXConnectorModel.java:113)
         at com.jrockit.mc.console.ui.actions.StartConsole$1.preConnect(StartConsole.java:36)
         at com.jrockit.mc.browser.utils.PreConnectJob.run(PreConnectJob.java:73)
         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: java.lang.ClassNotFoundException: com.vignette.monitor.framework.VgnMBeanInfo (no security manager: RMI class loader disabled)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
         at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
         at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
         at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
         at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
         at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:139)
         ... 11 more
    thanks

    As poorem suggested, I would check that the time is the same on both the identity and vcac appliances.  It has been a while since I posted this question but I believe that did get me past that specfic error.  I changed the timezone on each and made sure the times were correct and the same.

  • 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

  • Rmiregistry �J-Djava.rmi.server.codebase=URL

    Hi all,
    When starting the rmiregistry, I do the following:
    rmiregistry �J-Djava.rmi.server.codebase=URL
    Eager to understand what is going on, I read that this means the following:
    RMIClassLoader:
    For stubs and skeletons of remote objects created in the local virtual machine, the URL specified by the local java.rmi.server.codebase property is used.
    I thought "hey why not do the same for the server" and tried:
    java -Djava.rmi.server.codebase=URL Server
    getting me a StubNotFoundException. Can anybody tell me what I am doing wrong? The Server works when the Stub is in the local classpath but refuses to load it via the http Server. Am I at least theoretically right or is there a fundamental misconception in what I am trying?
    Thanks,
    Ralf

    RMI uses annotations to record codebase information. In addition to recording the class despriptions also records info about the location from which it loaded the classes bytecode. If you are trying to specify the codebase on the server and removing the stubs from the servers classpath the bytecode will never actually get loaded.

  • Java -Djava.rmi.server.codebase=file:///.....

    Cross posted in the hope that someone using it knows how....
    I am using the following command:
    java -Djava.rmi.server.codebase=file:///home/ben/fyp/build/ -Djava.security.policy=security.policy -cp ./lib/bcprov-jdk15-130.jar:./props:./build com.bensmyth.fyp.example.IssuerServer
    Can I specify -Djava.rmi.server.codebase=file:///home/ben/fyp/build/ without giving the whole path? Can I say ./build?

    I've come back to this issue again (since I am moving code around to different systems again). Using linux I can use -Djava.rmi.server.codebase=file://$PWD/build/
    Presumably there is a similar command in WIndows.

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

  • Java.rmi.server.codebase=file:(?????); at client side: classnotfounexceptio

    I'm trying to run an RMI application (under Windows XP, one machine for client and server) like this:
    at server side:
    java -Djava.rmi.server.codebase=file://\..\..\..\j\ -Djava.security.policy=file:.\polityka.txt sss
    - and it works fine, but at client side:
    java -Djava.security.policy=file:.\polityka.txt -Djava.rmi.server.codebase=file://\..\..\..\j\ kkk
    results in:
    Exception in thread "main" java.lang.NoClassDefFoundError: PrzykladowaKlasa
    at kkk.main(kkk.java:31)
    when I'm listing directory (at client side) got with System.getProperty("java.rmi.server.codebase") i get this
    file://\..\..\..\j\
    OdleglaKlasa_Stub.class
    PrzykladowaKlasa.class
    Folder Structure is:
    |------j\
    | |------(*_Stub.class, and ClassNeededByClient.class)
    |------2\
    | |------Server\
    | | |------(serwer files)
    | |------Klient\
    | | |------(klient files)
    I'm fresh in RMI and Codebase poperty, but with some exp with Java...
    (policy files are allright - grant {permission java.security.AllPermission;};)
    Any help will be appreciated.

    I've come back to this issue again (since I am moving code around to different systems again). Using linux I can use -Djava.rmi.server.codebase=file://$PWD/build/
    Presumably there is a similar command in WIndows.

  • Spaces in -Djava.rmi.server.codebase path

    hello,
    how must i format the string containing the codebase for a rmi server if the path to the codebase contains spaces?
    -Djava.rmi.server.codebase=file:c:/path/ and -Djava.rmi.server.codebase=file:/path/ works, but
    -Djava.rmi.server.codebase=file:c:/path with spaces/ doesnt work
    i have tried to put the string in quotes and to replace the spaces with %20 (url encoded)
    but nothing does work.
    how must i format the string?
    cu,
    elmar

    I guess you are using a batch file to start your RMI application.
    Spaces in URLs must be encoded with %20, that is correct.
    The problem is: the command line interpreter on Windows interprets % as a special character and will replace it.
    What worked for me (Windows Vista):
    java -Djava.rmi.server.codebase="file:/C:/Users/FirstName%%20LastName/RMI/" App
    So encode each white space with %%20.
    You can very easily check by inserting the following code at the start of your RMI application. These lets you see how the codebase is set.
    System.out.println(" Codebase: " + System.getProperty("java.rmi.server.codebase"));

  • RMI error - CAB file throwing SecurityExceptionEx

    Hi,
    I am upgrading my system from 4.51 to run on 5.1
    It uses an applet client. When I test it under appletviewer it works fine,
    but when I build it into a cab file for IE it gives the following security
    exception when running the folowing code :-
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL, serverDNS);
    prop.put(Context.SECURITY_PRINCIPAL, "admin");
    prop.put(Context.SECURITY_CREDENTIALS, "password");
    ic = new InitialContext(prop);
    The parameters for my applet look like :-
    <APPLET CODE="test.class" CODEBASE="\classes\"
    <PARAM NAME = cabbase VALUE = test.cab>
    <!-- Microsoft's package manager -->
    <PARAM NAME = useslibrary VALUE = "Sun RMI">
    <PARAM NAME = useslibrarycodebase VALUE = "sunrmi_v1001.cab">
    <PARAM NAME = useslibraryversion VALUE = "1,0,0,1">
    </APPLET>
    I've got the following errors occuring on Weblogic 5.1 (with IE 5)
    com.ms.security.SecurityExceptionEx[com/sun/naming/internal/VersionHelper11.
    getJndiProperty]: Unable to access system property:
    java.naming.factory.object
    at com/ms/security/permissions/PropertyPermission.check
    at com/ms/security/PolicyEngine.shallowCheck
    at com/ms/security/PolicyEngine.checkCallersPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkPropertyAccess
    at java/lang/System.getProperty
    at com/sun/naming/internal/VersionHelper11.getJndiProperty
    at com/sun/naming/internal/ResourceManager.getInitialEnvironment
    at javax/naming/InitialContext.init
    at javax/naming/InitialContext.<init>
    at visualejb/mvc/RMIDataExchange.getInitialContext
    at visualejb/mvc/RMIDataExchange.getInitialStatefulSessions
    at visualejb/mvc/RMIDataExchange.<init>
    at visualejb/mvc/DataManager.getDataExchange
    at visualejb/security/SecurityManager.logon
    at eqeprosoft/cobra/Cobra.userLoginRequest
    at visualejb/security/LoginPanel.okPressed
    at visualejb/security/LoginPanel.actionPerformed
    at java/awt/Button.processActionEvent
    at java/awt/Button.processEvent
    at java/awt/Component.dispatchEventImpl
    at java/awt/Component.dispatchEvent
    at java/awt/EventDispatchThread.run
    TAI
    Doug

    I dunno what the problem is, but I have asked the applet testing folks what the deal is...
    Douglas Allan wrote:
    Hi,
    I am upgrading my system from 4.51 to run on 5.1
    It uses an applet client. When I test it under appletviewer it works fine,
    but when I build it into a cab file for IE it gives the following security
    exception when running the folowing code :-
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL, serverDNS);
    prop.put(Context.SECURITY_PRINCIPAL, "admin");
    prop.put(Context.SECURITY_CREDENTIALS, "password");
    ic = new InitialContext(prop);
    The parameters for my applet look like :-
    <APPLET CODE="test.class" CODEBASE="\classes\"
    <PARAM NAME = cabbase VALUE = test.cab>
    <!-- Microsoft's package manager -->
    <PARAM NAME = useslibrary VALUE = "Sun RMI">
    <PARAM NAME = useslibrarycodebase VALUE = "sunrmi_v1001.cab">
    <PARAM NAME = useslibraryversion VALUE = "1,0,0,1">
    </APPLET>
    I've got the following errors occuring on Weblogic 5.1 (with IE 5)
    com.ms.security.SecurityExceptionEx[com/sun/naming/internal/VersionHelper11.
    getJndiProperty]: Unable to access system property:
    java.naming.factory.object
    at com/ms/security/permissions/PropertyPermission.check
    at com/ms/security/PolicyEngine.shallowCheck
    at com/ms/security/PolicyEngine.checkCallersPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkPropertyAccess
    at java/lang/System.getProperty
    at com/sun/naming/internal/VersionHelper11.getJndiProperty
    at com/sun/naming/internal/ResourceManager.getInitialEnvironment
    at javax/naming/InitialContext.init
    at javax/naming/InitialContext.<init>
    at visualejb/mvc/RMIDataExchange.getInitialContext
    at visualejb/mvc/RMIDataExchange.getInitialStatefulSessions
    at visualejb/mvc/RMIDataExchange.<init>
    at visualejb/mvc/DataManager.getDataExchange
    at visualejb/security/SecurityManager.logon
    at eqeprosoft/cobra/Cobra.userLoginRequest
    at visualejb/security/LoginPanel.okPressed
    at visualejb/security/LoginPanel.actionPerformed
    at java/awt/Button.processActionEvent
    at java/awt/Button.processEvent
    at java/awt/Component.dispatchEventImpl
    at java/awt/Component.dispatchEvent
    at java/awt/EventDispatchThread.run
    TAI
    Doug

  • RMI : error on JRE 1.6 but not on JRE 1.5 ???

    Hello,
    I've got a problem with my application since i use JRE 1.6
    My application run perfectly with JRE 1.5 !!!
    My code is first :
    LocateRegistry.createRegistry(port);
    NamingManager.setInitialContextFactoryBuilder(new InitialServerContextFactory());
    NamingManager.getInitialContext(environment);(with environment is an hastable containing HOST et PORT)
    An next, i have a Java Class witch impl�ments Context :
    public class InitialServerContext implements Context
        public void bind(String name, Object obj) throws NamingException
              getRMIContext().bind("rmi://" + mServer + ':' + mPort + '/' + name, obj);
        static Context getRMIContext() throws NamingException
              return NamingManager.getURLContext("rmi", null);
    The error on JRE 1.6 is on the line :
    getRMIContext().bind("rmi://" + mServer + ':' + mPort + '/' + name, obj);
    _Exception is
    :_java.lang.NullPointerException
    at com.sun.jndi.rmi.registry.RegistryContext.<init>(Unknown Source)
    at com.sun.jndi.url.rmi.rmiURLContext.getRootURLContext(Unknown Source)
    at com.sun.jndi.toolkit.url.GenericURLContext.bind(Unknown Source)
    at com.xxx.aes.naming.InitialServerContext.bind(InitialServerContext.java:231)
    at com.xxx.aes.naming.InitialServerContextFactory.getInitialContext(InitialServerContextFactory.java:104)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at com.xxx.aes.server.NamingServer.start(NamingServer.java:65)
    What is the difference between JRE 1.5 and 1.6 ?
    Why my application in 1.6 is not correct ?
    If necessary, i can give you my Java Class InitialServerContextFactory.java
    Thanks a lot for your responses.

    Hello,
    I tired this approach you mentioned, and interestingly if i just make ejb calls without any event handling, meaning if i call them separately they all just work fine and i see the results coming back from server. But when i relate them to any click events the whole IE freezes.
    One more thing i noted is that, seems like the way JRE 1.6 render my applet is somewhat different than JRE 1.5.* familiy,because initially when my aplet is loaded, i see everything which should be displayed from the first screen, but any further operations i cannot perform, even opening a file chooser from tool bar. I admit my applet is real heavy and it contains a lot of data in it on the first screen, may be its the heap size causing the problem in 1.6 but fine with jre 1.5.
    Day by day am coming to conlusion that jre 1.6 is my concern now ..:(
    Thanks,

  • The Rmi error in client!

    I'm try to write a RMI application in linux
    I used the java sample code for beginning !
    But It can't run normally.The error is as following :
    exception:java.rmi.ConnectException:Connection refused to host:0.0.0.0;nested exception is :java.net.ConnectException: Connection refuse.
    Can anyone help me slove the problem.
    there are the code .
    //Server side
    //Lookup.java
    import java.rmi.*;
    public interface Lookup extends Remote {
    public String findInfo(String info)
    throws RemoteException;}
    //LookupServer.java
    //LookupServer.java
    import java.io.*;
    import java.util.*;
    import java.rmi.*;
    import java.rmi.server.*;
    public class LookupServer extends UnicastRemoteObject implements Lookup{
    private Vector save=new Vector();
    public LookupServer(String db) throws RemoteException
    try {
    FileReader fr=new FileReader(db);
    BufferedReader br= new BufferedReader(fr);
    String s=null;
    while((s=br.readLine()) !=null)
    save.addElement(s);
    fr.close();
    catch (Throwable e)
    System.err.println("exception\n");
    System.exit(1);
    public String findInfo(String info)
    if(info==null)
    return null;
    info=info.toLowerCase();
    int n=save.size();
    for(int i=0;i<n;i++)
    String dbs=(String)save.elementAt(i);
    if(dbs.toLowerCase().indexOf(info)!=-1)
    return dbs;
    return null;
    public static void main(String args[])
    try {
    RMISecurityManager security =new RMISecurityManager();
    System.setSecurityManager(security);
    String db=args[0];
    LookupServer server =new LookupServer(db);
    Naming.rebind("LookupServer",server);
    System.err.println("LookupServer ready ....");
    catch(Throwable e)
    System.err.println("exception: "+e);
    System.exit(1);
    //Client Side
    //LookupClient.java
    import java.rmi.*;
    import java.rmi.server.*;
    public class LookupClient {
    public static void main(String args[])
    try{
    RMISecurityManager security=new RMISecurityManager();
    System.setSecurityManager(security);
    String host="localhost";
    String server="LookupServer";
    String name="rmi://"+host+"/"+server;
    Lookup look_obj=(Lookup)Naming.lookup(name);
    String results=look_obj.findInfo(args[0]);
    if(results==null)
    System.err.println("** not found **");
    else
    System.out.println(results);
    catch (Throwable e)
    System.err.println("exception: "+e);
    System.exit(1);

    I am not sure if this will work but try it anyway.
    String host="localhost";
    instead use...
    String host = "127.0.0.1";
    in both server and client.
    I say this because localhost is resolving to "0.0.0.0" which is not correct. Generally under Unix, you have a file called "hosts" under /etc. This is where you map a server name to the IP. So if you insist on using "localhost" as your server name, make sure you have an entry in this "hosts" file under /etc which is something like...
    127.0.0.1 localhost
    Then you can refer to the System as "localhost".
    Just to making sure - You started your server right - Before starting your client?
    Hope to help you solve this problem. Do re-post if the problem continues.
    Best Regards,
    Manish

Maybe you are looking for

  • I have tried downloading firefox but the icon now has a 'no entry' sign over the firefox icon and it won't open. whats wrong!!!

    I have been using firefox and was recently prompted to upgrade to a new firefox. I followed the instructions and dragged the icon into my apps folder. It had a 'no entry' sign on top of it which I didn't really understand. Now it won't start up and g

  • Notes.app will not restart after selecting "on my mac" account.

    I've been using notes.app since I started using the map.  The default account was set to my work's Excange server.  As I could see no way to view these notes in Outlook, I saw no reason to have that as my default account, and could back-up and use re

  • Easy question, but I'm a newbie

    What is the best way to burn a DVD from a sequence. I used to just export to video and put it on Mini DV. But now I just want to burn the final product to DVD. ( I'm not experienced with iMovie or compressor). THANKS!!

  • Duplex printing using Acrobat SDK 7.05

    Hi , I am developing an acobat plugin which will help me in getting silent prints. My requirement is for DUPLEX printing, I have a strict requirement of using Acobat API 7.05. I know its possible with Acrobat 8.0 and 8.1 API. Is it possible to do it

  • Installation and best practices

    I saw this link being discussed in a thread about "Live Type," but I think it needs a thread of its own, so I'm going to begin it here. http://support.apple.com/kb/HT4722?viewlocale=en_US I have Motion 4 (and everything else with FCS 2, of course), a