RMI IO Exception

hi,
i am getting this error with my simple hello world program on the RMI tutorial:
java.io.IOException: Test IO Exception
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at HelloImp_Stub.sayHello(Unknown Source)
at HelloClient.main(HelloClient.java:20)
Any thoughts what this error points to. Its not a security problem since I have the policy file granting all permissions.
All feedback appreciated.
My hello world imp:
public class HelloImp extends UnicastRemoteObject implements Hello {
     public HelloImp() throws RemoteException {
          super();
     public String sayHello() throws IOException, RemoteException {
          if (true) {
               throw new IOException("Test IO Exception");
          return "Hello";
     public static void main(String[] args) {
          // Create and install a security manager
          if (System.getSecurityManager() == null) {
               System.setSecurityManager(new RMISecurityManager());
          try {
               HelloImp obj = new HelloImp();
               // Bind this object instance to the name "HelloServer"
               Naming.rebind("//localhost/HelloServer", obj);
               System.out.println("HelloServer bound in registry");
          } catch (Exception e) {
               System.out.println("HelloImpl err: " + e.getMessage());
               e.printStackTrace();
My client:
public class HelloClient {
     public static void main(String[] args) {
          String message = "blank";
          Hello obj = null;
          try {
               obj = (Hello)Naming.lookup("//localhost/HelloServer");
               message = obj.sayHello();
               System.out.println(message);
          } catch (IOException e) {
               e.printStackTrace();
          } catch (Exception e) {
               System.out.println("HelloApplet exception: " + e.getMessage());
               e.printStackTrace();

Your simple hello world program is throwing the exception, just the way you coded it.

Similar Messages

  • Java.rmi.RemoteException: Exception in ejbLoad

    I use findByPrimaryKey() to find the object first.And I also can get PrimaryKey by method getPrimaryKey().
    But when I invoke method getName()(the method I defined to get name) ,it throws out exception:
    java.rmi.RemoteException: Exception in ejbLoad:; nested exception is:
    java.lang.NullPointerException
    what's wrong?

    Hi Susan ,
    By looking at your question , the first thing that comes to my mind is the "Null pointer Exception" migt only come when you have the null reference to your primary key . I mean , your metod call findByPrimaryKey shoudl return you a NOT NULL reference . But I guess there is a probablility that it might be returning NULL. And after that when u try to use that reference to invoke getName() method , it must be throwing NULL pointer exception. Just try priting the reference returned by your findByPrimaryKey() method.
    If it does not work out , write me more about what exactly is happening at your end.
    -amit

  • How RMI handle exception in RMI kernel ?

    hi everyone.
    How RMI handle exception in RMI kernel ?
    That is , when RMI catch an exception ,
    what RMI should do to handle the exception?
    best regards.

    it throws an exception (some derived class of RemoteException) which is transmitted to, rethrown at, and must be caught at, the client.

  • Java.rmi.MarshalException: Exception

    hi,
    i am getting the below error while displaying the data from a servlet. Here in servlet i had written the code to store values. And then i had written a function "getDetails()" which will give result set object. At that time i am getting this error. This method code is in bena class.
    In servlet this is the code i had wriiten
    InitialContext initContext=new InitialContext();
                        home=(InsuranceHome)initContext.lookup(ejbJndiName);
                        remote=home.create();
                        int n=remote.insertDetails(cname,frm_date,to_date,type,ppaid,rmks);
                        ResultSet rs=remote.getResults();
                        while(rs.next())
                             System.out.print(rs.getString(1));
                             System.out.print(rs.getString(2));
                             System.out.print(rs.getString(3));
                             System.out.println(rs.getString(4));
                        System.out.println(n);
    [10/Apr/2008:11:34:06] INFO ( 3108): CORE3282: stdout:      java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
    [10/Apr/2008:11:34:06] INFO ( 3108): CORE3282: stdout:      java.io.NotSerializableException

    the NEVER used here, is it an EJB specification issue or design issue. If EJB specification issue then you should be right of which i am not sure. Please quote reference.
    If design issue then NEVER is wrong. Its depends on task to be addressed. Data Transfer Pattern allows the use of Rowset to exchange data between clients and servers.These options are either DTOs, containers, RowSets all are serializabel.How will you managed bandwidth and memory issues in a critical application where by clients needs to get a copy of data store in their memory(delete,update, insert) and after finished with their task they simply click synchronized.
    this copy(rowset) in client is simply sent to sever for updates rather than doing update, insert, delete request to server for every operation.
    This is a pattern design issue and the choice of Data Transfer Object depends on the task and type of communication between clients and server.
    A RowSet in the situation whereby 1. number of request to server has to be reduced, 2. connection to server has to be minimal. 3. each client gets a copy of his data as a snapshot of server contents processed it an then do synchronization when needed(bulk).Also this is issued when memory of client is a big issue like mobiles so installing a DB on the mobile is not possible. The rowset sent to client must not hold a connection to DB.
    Ivo Sumelong

  • RMI Nervous Exception

    I am new to rmi
    I got the following exception:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.lang.ClassNotFoundException: extst.Test_Stub
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at clnttst.ClientMainFrame.testRMI(ClientMainFrame.java:177)
         at clnttst.ClientMainFrame$1.actionPerformed(ClientMainFrame.java:120)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at javax.swing.plaf.basic.BasicInternalFrameUI$Handler.retargetMouseEvent(Unknown Source)
         at javax.swing.plaf.basic.BasicInternalFrameUI$Handler.forwardMouseEvent(Unknown Source)
         at javax.swing.plaf.basic.BasicInternalFrameUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: extst.Test_Stub
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
         at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
         at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
         at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
         at java.io.ObjectInputStream.readClassDesc(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         ... 38 moreI set the classpath enviroment variable in the windows to the server pakage that contain the server classes and the stub class.
    I also try to set the code base as :
    java -Djava.rmi.server.codebase = "file:/c:/ExTest/ServerTest" extst.Driver
    but all that does not work

    "If the code base specifies a directory (as opposed to a JAR file), you must include the trailing slash in the code base URL"
    http://java.sun.com/docs/books/tutorial/rmi/running.html
    Genady
    Message was edited by:
    genady

  • RMI -NullPointer Exception

    I am using java on RedHat Linux 8.0, (J2sdk1.4)
    I am trying to do an RMI program on Linux. I need it as per academic syllabus. I tried a calculator problem. Created interface, server etc. After compiling them when i try to create stub and skeleton by rmic i got stucked by errors, like Null PointerException as follows, So I cant move forward. Could you please help me to solve a simple problem using RMI.
    Classpath is correct. I had configured and done Servlet , JSP , JDBC etc on Linux. But here i got stucked. Please provide help to me.........
    $ rmic CalculatorImpl
    // following are the error messages i got
    java.lang.NullPointerException
    at 0x4027812c: java.lang.Throwable.Throwable() (/usr/lib/libgcj.so.3)
    at 0x4026b0af: java.lang.Exception.Exception() (/usr/lib/libgcj.so.3)
    at 0x4026e9b3: java.lang.RuntimeException.RuntimeException() (/usr/lib/libgcj.so.3)
    at 0x4026e0a7: java.lang.NullPointerException.NullPointerException() (/usr/lib/libgcj.so.3)
    at 0x4022a547: JvThrowNullPointerException (/usr/lib/libgcj.so.3)
    at 0x4033099f: ?? (??:0)
    at 0x4032ce5d: gnu.java.rmi.rmic.RMIC.generateStub() (/usr/lib/libgcj.so.3)
    at 0x4032bd25: gnu.java.rmi.rmic.RMIC.processClass(java.lang.String) (/usr/lib/libgcj.so.3)
    at 0x4032bc7c: gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.3)
    at 0x4032bb3b: gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.3)
    at 0x40252308: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/libgcj.so.3) at 0x402bd0b1: gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.3)
    at 0x4025efdc: JvThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.3)
    at 0x4022b78c: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.3)
    at 0x4022b8ad: JvRunMain (/usr/lib/libgcj.so.3)
    at 0x080485a0: ?? (??:0)
    at 0x420158d4: ?? (??:0)
    at 0x080484ed: ?? (??:0)
    thanks
    rajesh

    The alternative is to use the Sun rmic, which you'll find (probably) lives somewhere near javac, javap, javah et cetera.
    You are not using the sun rmic, as the stacktrace shows.
    Dont just tell us that your 'paths are all correct' - post the invocation of the compiler that causes the stacktrace, along with some environment, then you might get some more detailed help

  • RMI Security Exception

    Hi I have followed the sun java RMI trail (tutorial).
    However my server side application is giving me a security exception. I think it s because of the grant code sections:
    grant {
        permission java.net.SocketPermission "*:1024-65535",
            "connect,accept";
        permission java.net.SocketPermission "*:80", "connect";
    };My problem is that I can't understand were to put this code segment, and I read the same page over and over again, and could not find were is says were to put it!!
    As I said I think it is from this, but maybe it is from other parts! not sure! ... Maybe you need to run the server side from a web server??
    The links of the tutorial I am following is the following (from sun java website itself):
    http://java.sun.com/docs/books/tutorial/rmi/
    and the following link is were there is the grant permission code:
    http://java.sun.com/docs/books/tutorial/rmi/running.html
    Thanks for any sugestions!

    I still have the exception:
    ComputeEngine exception: access denied (java.net.SocketPermission host resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission host resolve)I followed the tutorial step by step, reading and writing the provided code so far. So this is what I have now at the moment:
    I create a permision file and I called it java.policy. In this file I have the following code:
    grant {
        permission java.net.SocketPermission "*:1024-65535",
            "connect,accept";
        permission java.net.SocketPermission "*:80", "connect";
    };Then I have the following code sugested by WirajR in the engine class, which is the server side application:
    static{
        System.setProperty("security.policy", "java.policy");
    }I compiled everything, and no errors are given. But when i run just the server side, I still recieve the above error. When I debuged the application it stops on the following line:
    Naming.rebind(name, engine);Were name is a string containing the following text :
    "//host/Compute"and engine is the class to be exposed over RMI.
    I am betting my problem is with name!! ... maybe
    or else my permission file has invalid data.
    Also wanted to add that security seems to have been taken care of in that tutorial by the following lines of code:
    if (System.getSecurityManager() == null) {
       System.setSecurityManager(new RMISecurityManager());
    }Aren't these to set the security policy?

  • Rmi Server Exception

    Hello Everyone,
    I encountered the following errors during deployment using J2ee's Deployment Tool.
    I have an Entity EJB called Books using Cloudscape as the database. When I clicked on 'Generate SQL Now' in Deployment Tool, I received the following errors. "java.rmi.ServerException, - nested exception - connecting to database - no suitable driver".
    Prior to deployment I have j2ee server, cloudscape database up and running. Cloudscape has the following Driver Class - COM.core.RmiJdbcDriver, COM.cloudscape.core.RmiJdbcDriver 1.7.2. The Database JNDI name is jdbc/BooksInCloudscape. I tried to re-register the driver in j2ee and cloudscape, then brought both servers down and up with no luck. I have put c:\Books\classes in my CLASSPATH.
    Could anyone please shed lights on this issue? Thanks in advance.

    I am having the EXACT SAME ISSUE. I've been to countless message boards and support sites to no avail (I'm assuming you are also working from EJB 2.1 Kick Start by Peter Thaggard.)
    If you've resolved this issue from another source please update this posting any help would be greatly appreciated. I can't express how much time has been wasted on this simple connectivity issue.

  • Rmi iiop exception (orb)

    Hi,
    When i run my program i receive an exception. The orbd tool is running on port 900. Stubs are created for iiop. The class extends the PortableRemoteObject. This exception arises when creating the initialContext with:
    Properties p = new Properties ();
    p.put (Context.INITIAL_CONTEXT_FACTORY,
       "com.sun.jndi.cosnaming.CNCtxFactory");
    p.put (Context.PROVIDER_URL,"iiop://localhost:900");
    InitialContext ctx = new InitialContext (p);The exception is:
    javax.naming.CommunicationException: Cannot connect to ORB.  Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
         at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:173)
         at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
         at com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
         at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:638)
         at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:580)
         at com.sun.corba.se.internal.corba.InitialNamingClient.resolve(InitialNamingClient.java:1004)
         at com.sun.corba.se.internal.corba.InitialNamingClient.resolveUsingBootstrapProtocol(InitialNamingClient.java:687)
         at com.sun.corba.se.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1085)
         at com.sun.corba.se.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:978)
         at com.sun.corba.se.internal.corba.ORB.resolve_initial_references(ORB.java:2422)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:340)
         at com.sun.jndi.cosnaming.CNCtx.initUsingIiopUrl(CNCtx.java:289)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:245)
         at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:209)
         at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
         at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at nl.infoprofs.components.monitor.MonitorSender.registerObject(MonitorSender.java:97)
         at nl.infoprofs.components.monitor.MonitorSender.getInstance(MonitorSender.java:122)
         at nl.infoprofs.components.monitor.MonitorTest.main(MonitorTest.java:25)Thanks in advance,
    Rico

    I am trying to run a simple rmi over iiop server.
    I started the tnameserv with
    tnameserv -ORBInitialPort 2222
    I am trying to run the server
    static final String CONTEXT_NAME = "java.naming.factory.initial";
    static final String IIOP_STRING = "com.sun.jndi.cosnaming.CNCtxFactory";
    static final String URL_NAME = "java.naming.provider.url";
    static final String IIOP_URL_STRING = "iiop://localhost:2222";
    And in the main method
    // Create and install a security manager
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    // Create the IIOP Initial Context
    Properties iiopProperties = new Properties();
    iiopProperties.put( LFChallenger_SimImpl.CONTEXT_NAME,
    LFChallenger_SimImpl.IIOP_STRING );
    iiopProperties.put( LFChallenger_SimImpl.URL_NAME,
    LFChallenger_SimImpl.IIOP_URL_STRING );
    // create and initialize the ORB
    ORB orb = ORB.init(args, null);
    // initialize naming context
    iiopProperties.put("java.naming.corba.orb", orb);
    Context initialNamingContext = new InitialContext( iiopProperties );
    LFChallenger_SimImpl obj = LFChallenger_SimImpl.getInstance();
    // Bind the object to the IIOP registry
    initialNamingContext.rebind("LFChallengerServer",obj);
    System.out.println("LFChallengerServer bound in registry");
    } catch (Exception e) {
    System.out.println("LFChallenger_SimImpl err: " + getMessage ());
    e.printStackTrace();
    Running the server using
    java -Djava.rmi.server.codebase=C:/CEMS/Corvis/home/TMF/cems_sim/src/java/classes/ -Djava.security.policy=policy -Djava.naming.provider.url=iiop://localhost:2222 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory -classpath c:\Borland\AppServer\lib\vbjorb.jar; com.corvis.cems_sim.LFChallenger_SimImpl
    And I am getting these annoying exceptions when I run the above command
    LFChallenger_SimImpl err: COS Name Service not registered with ORB under the name 'NameService'
    javax.naming.ConfigurationException: COS Name Service not registered with ORB under the name 'NameService'. Root exception is org.omg.CORBA.ORBPackage.InvalidName
    at com.inprise.vbroker.orb.ORB.resolve_initial_references(ORB.java:712)
    at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:254)
    at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:184)
    at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:71)
    at com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:35)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at com.corvis.cems_sim.LFChallenger_SimImpl.main(LFChallenger_SimImpl.java:72)
    Please help me with this problem
    thanks
    kishore

  • RMI - Unmarshell Exception - Nested Exception is java.io.EOFException

    Hi,
    I get the following error while executing my RMI client.
    The fact is that i dont get this everytime. When i make nearly 4000 RMI method calls then for the further method calls i get the exception as given below..
    *java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:*
    *     java.io.EOFException*My RMI Client Implementation is like this.
    - Create a static object of RMI Client
    m_objRmiServiceProxy = (IExposedInterface) Naming.lookup(ConnectionURL);And use the same object for all my further rmi server calls....
    can anyone tell me when we will get the above exception?
    What can be the possible cause for it ?
    Thanks...

    If you find an answer elsewhere please let me know, your problem seems to be very much akin to what my program is experiencing. Just one question, is your program affected by the error if you call the one remoteserver method consecutive times or if you call multiple methods in parallel?
    Edited by: Inusevs on Sep 10, 2008 6:24 AM
    Edited by: Inusevs on Sep 10, 2008 6:24 AM

  • RMI Connect Exception

    I have a client server application,
    1) Server is running on a Linux Suse machine
    2) Client is running on a Windows 2000 machine
    I had been running this application for some time now, but now i started getting this weird problem.
    When i try to run the client i get this exception below:
    java.rmi.ConnectException: Connection refused to host: 127.0.0.2;
    and im unable to bring up the client.

    I'm inclined to doubt that a security policy error, especially on the client side, would given you such a general error. You't get an exception from the security manager instead.
    The "connection refused" is pretty much always down to not having a listener running on the port you're trying to connect to.
    Pinging uses a lower level of connection than TCP/IP so it doesn't tell you anything about ports being open. All it establishes is that the server's operating system is up and reachable.
    On unix you can use netstat to check what ports are being listened to by what tasks, don't know if you can do that on Windows. There's a netstat but I haven't explored the options.
    Agreed, it's probably not a problem with the code, it's more likely to be a problem with the scripts that start the server, or nameserver.

  • RMI _stub exception

    I'm trying to run the hello world rmi example and I get these exceptions:
    HelloImpl err: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: examples.hello.HelloImpl_Stub
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: examples.hello.HelloImpl_Stub
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: examples.hello.HelloImpl_Stub
    java.lang.ClassNotFoundException: examples.hello.HelloImpl_Stub
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
    RemoteCall.java:245)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
    220)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:354)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at examples.hello.HelloImpl.main(HelloImpl.java:29)
    the HelloImpl_stub.class is in the server codebase and in the HelloImpl dir, should it be anywhere else?

    Follow
    Set the Codebase while running the server.
    eg:
    java -Djava.rmi.server.codebase=file:/E:\rmiserver/
    -Djava.security.policy=file:/E:\rmiserver\mypolicy <RMISERVER>
    where my Stub classes and Server classes reside in E:\rmiserver
    Make a note here: If u r running under Windows:
    file:/E:\rmiserver/ points to the code base and stub classess can be found my rmiserver
    Also make sure u have a policy file if using JDK 2
    Create a Ascci file like this. for now grant all:
    Pony java.security.policy to this file.
    Policy File:
    grant {
    // Grant All permissions
    permission java.security.AllPermission;
    Hope this solves.

  • RMI/Unmarshaling exception

    Hi,
    I tried to run numerous RMI examples off the web, but i still get the same exceptions thrown each time.
    I tried running it on WinXP and a 98 m/c but of no avail.
    Any help would be appreciated.
    Thanks.
    For testing purposes I kept all the .java files and java.policy files in the same directory.
    After compiling all the .java files [included at the end of this post], i ran
    rmic myRMIImpl
    rmiregistryand then i tried to run the server but then i get the exception shown below
    =========================================
    C:\rmi3>java -Djava.rmi.server.codebase=c:\rmi3\ -Djava.rmi.server.hostname=127.
    0.0.1 -Djava.security.policy=c:\rmi2\java.policy myRMIServer
    Exception occurred: java.rmi.ServerException: RemoteException occurred in server
    thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.net.MalformedURLException: unknown protocol: c
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.net.MalformedURLException: unknown protocol: c
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.net.MalformedURLException: unknown protocol: c
    java.net.MalformedURLException: unknown protocol: c
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at java.rmi.Naming.bind(Unknown Source)
    at myRMIImpl.<init>(myRMIImpl.java:11)
    at myRMIServer.main(myRMIServer.java:11)
    =========================================
    rmic myRMIImpl
    rmiregistry
    =========================================
    public interface myRMIInterface extends java.rmi.Remote
    public java.util.Date getDate() throws java.rmi.RemoteException;
    =========================================
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class myRMIImpl extends UnicastRemoteObject implements myRMIInterface
    public myRMIImpl(String name) throws RemoteException
    super();
    try
    Naming.bind(name, this);
    catch(Exception e)
    System.out.println("Exception occurred: " + e);
    public java.util.Date getDate()
    return new java.util.Date();
    =======================================
    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("myRMIImpl instance");
    catch (Exception e)
    System.out.println("Exception occurred: " + e);
    =======================================
    import java.rmi.*;
    import java.rmi.registry.*;
    import java.rmi.server.*;
    import java.util.Date;
    public class myRMIClient
    public static void main(String[] argv)
    System.setSecurityManager(new RMISecurityManager());
    if (argv.length != 1)
    System.out.println("usage: java myRMIClient <IP address of host running RMI server>");
    System.exit(0);
    String serverName = argv[0];
    try
    //bind server object to object in client
    myRMIInterface myServerObject = (myRMIInterface) Naming.lookup("rmi://"+serverName+"/myRMIImpl instance");
    //invoke method on server object
    Date d = myServerObject.getDate();
    System.out.println("Date on server is " + d);
    catch(Exception e)
    System.out.println("Exception occured: " + e);
    System.exit(0);
    System.out.println("RMI connection successful");

    Looks like if is trying to understand you URL given as the codebase and failing to do so. You specify the protocol to be used to retrieve the URL in the beginning of the URL string. For a http protocol is is http://URL, for rmi it is rmi://URL and in this case im not sure how a file URL should be written but it should be something like file://URL. Check this site for correct syntax or somewhere on the net. Anyway after you get if right, you should try it with something like
    "-Djava.rmi.server.codebase=file://c:\rmi3\"
    or something in those lines. That is what the exception is about anyways.
    -teka

  • RMI and Exception

    Hi all,
    I pass all information to server side through
    I am trying to do some validation checking on server side. If there is some invalid input, I want to pass the errors (string) to client side indicating that there some inputs are invalid. How can I do that?
    Thanks all
    Tony Ton

    Throw an exception.

  • Rmi ClassDefNotFound Exception

    When the Applet client call the server, I got this error "classdefnotfound", but if I put the whole application to system classpath, this error go away, any clue?

    You need the Special JavaVM from WebSphere. It is bundled under some name like:
    "IBM WebSphere J2EE Application Client".
    You also need to create the Client EAR with the WebSphere Application Tool.
    Johann Thomas

Maybe you are looking for

  • Do I need an upgrade ProApps QuicRime codecs?

    I do not have Final Cut Pro X, I am using FCP 6.  The upgrade says that its for the FCP X. Do I upgrade anyway or I will brake what I am already have been using for years? Thanks,

  • ITunes show Airport Express Speakers but will not allow me to choose them

    Hi, I just installed and updated my 802.11g airport express. When I open iTunes (version 9- just updated today), I am able to see the speaker selector option on the bottom right of the screen. When I open it, the choice for my laptop speakers and air

  • Internal table and work area

    Hi,        can anybody explain the concepts of Internal table and work area.Thanks in advance.

  • Networking a LaserJet CP1510

    Hi there, I really need some help on this one so if anyone has any ideas I would be grateful. We have the above printer installed on a home network which is setup as follows: Main Modem router: DHCP enabled range 2 - 100 Wired connection to router us

  • Is AirPlay mirroring available only on OS 10.8 and above?

    No matter what I try, I can't see the mirroring icon in the nav bar.  I am running 10.7.5 on a mid-2011 Mac.  My Apple TV 2 is running the most recent upgrade, but I am not willing to upgrade to Maverick (too many negative comments). Thanks