UnmarshalException

Hello, i'm developing a chat service using rmi, and i'm having trouble when i have to rebind server. I get an java.rmi.UnmarshalException, and
ChatServidorImpl_Stub ClassNotFoundException.
Stubs are well formed, using rmic, no other error found.
I tried all possible classpath enviroment: .;<path of the classes>
Any answers please?
Thanks!

not exactlly.
need define codebase,
If you run RMI client and Server and the same machine, using file protocol in codebase
If on different machine, you need http protocol in codebase to download sever side jar -----------> a web server, otherwise you must copy the Stub class into client side jar
then you need define security.

Similar Messages

  • RMI Trouble - UnmarshalException

    I had several classes thata had been working great under RMI until I made a smalla change
    I change the package path of my classes adding a parent package and adding a level in the
    directory path (from D:\Des\MicroApl to D:\Des\MicroAplsrc), so my directory tree change from:
    D:\Des\MicroApl
    transmision
    modelo
    controlador
    vista
    to:
    D:\Des\MicroApl
    jars
    make
    classes
    docs
    src
    rut
    transmision
    modelo
    controlador
    vista
    So I change the package statement in the classes adding the new level, for instance, from:
    package modelo;
    to:
    package rut.modelo;
    and i change my make files in order to compile the classes acordingly, from:
    javac modelo\ModeloMaestro.java
    to:
    javac rut\modelo\ModeloMaestro.java
    and from:
    rmic modelo.ModeloMaestro
    to:
    rmic rut.modelo.ModeloMaestro
    I also changed the path of my call from:
    java -cp .\mimjdbc-2_2.jar;. modelo.ModeloMaestro
    to:
    java -cp D:\Des\MicroApl\jars\mimjdbc-2_2.jar;. rut.modelo.ModeloMaestro
    Now, after compiling without any error, I get a big runtime error, as follows:
    Excepcion Remota de servidor: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rut.modelo.ModeloMaestro_Stub
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: rut.modelo.ModeloMaestro_Stub
         at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352)
    Does anyone knows whats going on?
    I had not made any other change,
    not at all
    Juan
    [email protected]

    I had a similar problem after connecting the internet using a modem
    Win 98 coudln't restore the local TCP/IP after that

  • Java.rmi.UnmarshalException: skeleton class not found but required for clie

    Hello everyone,
    I am new to RMI and getting a strange exception. I am using Java 1.5.0_07 both on client and server. They are running on the same machine, the rmi registry is started inside the server application.
    I am wondering why java complains about skeletons, I thought they are automatically created when using java 5.0?
    Please have a look at the stacktrace below.
    Thank you for your help.
    Best Regards
    Patric
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
         java.rmi.UnmarshalException: skeleton class not found but required for client version
         sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
         sun.rmi.transport.Transport$1.run(Transport.java:153)
         java.security.AccessController.doPrivileged(Native Method)
         sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
         sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
         java.lang.Thread.run(Thread.java:595)
         sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
         sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
         sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
         sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         java.rmi.Naming.lookup(Naming.java:84)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    The full class path information that I can gather is as follows (some of the library path locations could be suspect...):
    Class path: /edge/node3/hotfix::/edge/node3/current/lib/JMdsApi.jar:/edge/node3/current/lib/MemoryProfilingAgent.jar:/edge/node3/current/lib/T2common-2.6.0-SNAPSHOT.3200.jar:/edge/node3/current/lib/T2scripting-jython.jar:/edge/node3/current/lib/activation.jar:/edge/node3/current/lib/alib.jar:/edge/node3/current/lib/alibom.jar:/edge/node3/current/lib/ant.jar:/edge/node3/current/lib/authapi.jar:/edge/node3/current/lib/bbdlapi.jar:/edge/node3/current/lib/bcpg-jdk15-136.jar:/edge/node3/current/lib/bcprov-jdk15-136.jar:/edge/node3/current/lib/c3p0-0.9.1.2.jar:/edge/node3/current/lib/castor-1.1-codegen-anttask.jar:/edge/node3/current/lib/castor-1.1-codegen.jar:/edge/node3/current/lib/castor-1.1-xml.jar:/edge/node3/current/lib/castor-1.1.jar:/edge/node3/current/lib/colt-1.2.0.jar:/edge/node3/current/lib/common-annotations.jar:/edge/node3/current/lib/commons-beanutils.jar:/edge/node3/current/lib/commons-codec-1.3.jar:/edge/node3/current/lib/commons-collections-3.2.1.jar:/edge/node3/current/lib/commons-jexl-1.1.jar:/edge/node3/current/lib/commons-lang-2.3.jar:/edge/node3/current/lib/commons-logging-1.1.1.jar:/edge/node3/current/lib/commons-net-1.4.1.jar:/edge/node3/current/lib/dsn.jar:/edge/node3/current/lib/eagleapi.jar:/edge/node3/current/lib/ezmorph-1.0.3.jar:/edge/node3/current/lib/f2-loader-1.8.jar:/edge/node3/current/lib/fasttrade-boviewer-1.0.1.jar:/edge/node3/current/lib/hsqldb.jar:/edge/node3/current/lib/icu4j-3.4.4.jar:/edge/node3/current/lib/ivy.jar:/edge/node3/current/lib/janino.jar:/edge/node3/current/lib/janus-sdk-1.7.0.0.jar:/edge/node3/current/lib/jasypt-1.4.1.jar:/edge/node3/current/lib/javolution.jar:/edge/node3/current/lib/jcalendar-1.3.2.jar:/edge/node3/current/lib/jcl-over-slf4j-1.5.6.jar:/edge/node3/current/lib/jcommon-1.0.9.jar:/edge/node3/current/lib/jconn2.jar:/edge/node3/current/lib/jconn3-6.05-b26214.jar:/edge/node3/current/lib/jdom.jar:/edge/node3/current/lib/jfreechart-1.0.5.jar:/edge/node3/current/lib/jgroups-all.jar:/edge/node3/current/lib/jline.jar:/edge/node3/current/lib/jmkv123p1.jar:/edge/node3/current/lib/jna.jar:/edge/node3/current/lib/joda-time-1.5.2.jar:/edge/node3/current/lib/jscience.jar:/edge/node3/current/lib/json-lib-2.2.1-jdk15.jar:/edge/node3/current/lib/jul-to-slf4j-1.5.6.jar:/edge/node3/current/lib/junit.jar:/edge/node3/current/lib/jython.jar:/edge/node3/current/lib/log4j-1.2.15.jar:/edge/node3/current/lib/log4j-over-slf4j-1.5.6.jar:/edge/node3/current/lib/loggablePreparedStatement-1.6.jar:/edge/node3/current/lib/looks-2.1.4.jar:/edge/node3/current/lib/mailapi.jar:/edge/node3/current/lib/model-12021.jar:/edge/node3/current/lib/mysql-connector-java-5.1.7-bin.jar:/edge/node3/current/lib/opencsv-1.8.jar:/edge/node3/current/lib/rfa.jar:/edge/node3/current/lib/rspcore.jar:/edge/node3/current/lib/slf4j-api-1.5.6.jar:/edge/node3/current/lib/slf4j-log4j12-1.5.6.jar:/edge/node3/current/lib/smtp.jar:/edge/node3/current/lib/smtphandler-0.6.jar:/edge/node3/current/lib/spring-2.5.2.jar:/edge/node3/current/lib/statsvn.jar:/edge/node3/current/lib/swingx-0.9.3.jar:/edge/node3/current/lib/t2-12021.jar:/edge/node3/current/lib/testng-5.9-jdk15.jar:/edge/node3/current/lib/tibmsg.jar:/edge/node3/current/lib/tibrvj.jar:/edge/node3/current/lib/trove.jar:/edge/node3/current/lib/velocity-tools.jar:/edge/node3/current/lib/velocity.jar:/edge/node3/current/lib/xalan.jar:/edge/node3/current/lib/xerces.jar:/edge/node3/current/lib/patng/activeio-core-3.0.0-incubator.jar:/edge/node3/current/lib/patng/activemq-core-4.1.1.jar:/edge/node3/current/lib/patng/avalon-framework-4.1.3.jar:/edge/node3/current/lib/patng/backport-util-concurrent-2.2.jar:/edge/node3/current/lib/patng/binding-1.4.0.jar:/edge/node3/current/lib/patng/cglib-nodep-2.1_3.jar:/edge/node3/current/lib/patng/common-1.30.jar:/edge/node3/current/lib/patng/commons-cli-1.0.jar:/edge/node3/current/lib/patng/commons-configuration-1.2.jar:/edge/node3/current/lib/patng/commons-discovery-0.2.jar:/edge/node3/current/lib/patng/commons-math-1.1.jar:/edge/node3/current/lib/patng/concurrent-1.3.4.jar:/edge/node3/current/lib/patng/geronimo-j2ee-management_1.0_spec-1.0.jar:/edge/node3/current/lib/patng/geronimo-jms_1.1_spec-1.0.jar:/edge/node3/current/lib/patng/logkit-1.0.1.jar:/edge/node3/current/lib/patng/mina-core-1.0.1.jar:/edge/node3/current/lib/patng/mina-filter-ssl-1.0.1.jar:/edge/node3/current/lib/patng/mina-java5-1.0.1.jar:/edge/node3/current/lib/patng/mx4j-remote-3.0.1.jar:/edge/node3/current/lib/patng/mx4j-tools-3.0.1.jar:/edge/node3/current/lib/patng/org.apache.felix.framework-1.0.0.jar:/edge/node3/current/lib/patng/org.osgi.core-1.0.0.jar:/edge/node3/current/lib/patng/pat-dt-common-1.18.jar:/edge/node3/current/lib/patng/pat-sdt-1.18.jar:/edge/node3/current/lib/patng/patNg-api-1.27.1.jar:/edge/node3/current/lib/patng/patNg-server-aoc-1.21.jar:/edge/node3/current/lib/patng/patNg-server-common-1.21.jar:/edge/node3/current/lib/patng/patNg-server-session-manager-1.21.jar:/edge/node3/current/lib/patng/patNg-utils-1.27.1.jar:/edge/node3/current/lib/patng/qpid-broker-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-client-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-common-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-mina-core-2.2.2.0.jar:/edge/node3/current/lib/patng/rsee-2.11.jar:/edge/node3/current/lib/patng/servlet-api-2.3.jar:/edge/node3/current/lib/patng/silk-1.3.jar:/edge/node3/current/lib/patng/slf4j-api-1.4.0.jar:/edge/node3/current/lib/patng/slf4j-log4j12-1.4.0.jar:/edge/node3/current/lib/patng/validation-1.2.0.jar
    Boot class path: /apps/jdk/1.6.0_13/linux/jre/lib/resources.jar:/apps/jdk/1.6.0_13/linux/jre/lib/rt.jar:/apps/jdk/1.6.0_13/linux/jre/lib/sunrsasign.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jsse.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jce.jar:/apps/jdk/1.6.0_13/linux/jre/lib/charsets.jar:/apps/jdk/1.6.0_13/linux/jre/classes:/tmp/yjp200811122006.jar
    Library path: /apps/jdk/1.6.0_13/linux/jre/lib/i386/server:/apps/jdk/1.6.0_13/linux/jre/lib/i386:/apps/jdk/1.6.0_13/linux/jre/../lib/i386::/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/usr/java/packages/lib/i386:/lib:/usr/lib

  • UnmarshalException Why?

    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: rbot.controller.Controller
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    I did generate stub for the class I registered and I did start rmiregistry, so whats this exceptions about?
    R. Hollenstein

    Is " rbot.controller.Controller" your remote interface? Or is it a class that you're passing as a parameter?
    Either way, are you sure it is in the Classpath of your client? (I assume the exception occured on your server?)
    If it's not in the client's classpath, is it in a jar that you have a URL available to in your java command line, such as:
    java -Djava.rmi.server.codebase="file:${PWD}/jars/shared.jar"
    Where you set that parameter on your server so that rmiregistry can inform the client where to find the code?

  • UnmarshalException with nested EOFException on Naming.lookup()

    I have an RMI server object that creates its own RMI registry and binds, like this:
         Registry registry = LocateRegistry.createRegistry(1099);
         registry.bind("JournalReceiver", this);I run this from the command line to get it started. Everything looks good.
    My client is running as a webapp in Tomcat (on the same machine), and it executes this call:
            receiver = (RmiJournalReceiverInterface) Naming.lookup("JournalReceiver");and gets this error
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.io.EOFException
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)It is clear that I'm reaching the registry, and if I modify the code to intentionally lookup the wrong name I get a "not bound error", so I'm pretty confident that my server object is indeed bound to that name. Beyond that, I'm lost.
    Any thoughts?
    jb

    OK - the problem was an incorrect codebase.
    My server object creates its own registry with
           Registry registry = LocateRegistry.createRegistry(1099);
         registry.bind("JournalReceiver", this);and I get the UnmarshalException with nested EOFException, as shown above.
    However, if I set up an outside registry with 'rmiregistry', and use
            Naming.rebind("JournalReceiver", this)then I get the UnmarshalException with nested ClassNotFoundException, which has shown up in several threads.
    So, following the advice given in those threads, I fix the codebase like this:
    java -Djava.rmi.server.codebase=file:/var/local/jb/RmiReceiver.jar \
       org.nsdl.RmiJournalReceiverand it works as advertised, even when I go back to my original lines of binding code.
    Thanks again for the help.
    jb

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

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

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

  • UnmarshalException, client and rmi

    Hello,
    I'm developing client/server application using RMI. The problem occurs when I want to run it all and test. I do as follows:
    (first of all, I compile each project (server and client) from Eclipse.
    then with server:
    rmic engine/ServerImplementation.class
    start rmiregistry
    java SpikServerand with client:
    java -Djava.security.policy=c:\wideopen.policy SpikClient 127.0.0.1and then I receive such an errors:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: engine.ServerImplementation_Stub
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
            at java.rmi.Naming.lookup(Unknown Source)
            at engine.ClientImplementation.connect(ClientImplementation.java:44)
            at userInterface.Console.run(Console.java:19)
            at SpikClient.main(SpikClient.java:9)
    Caused by: java.lang.ClassNotFoundException: engine.ServerImplementation_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)
            ... 5 moreHow can I fix it? Any suggestions are welcome. If more information are required just let me know, I will deliver them.
    Kind regards,
    John.

    I read that part of a faq but still I don't know what should I do. I don't want to use http or ftp protocols to transfer needed data. On the other hand I can run an example from this page: http://www.javacamp.org/moreclasses/rmi/rmi6.html without any problem. I also read that before running rmiregistry the classpath should be unset. And I do so but after starting rmiregistry I have to set classpath to make work derby database (set CLASSPATH=C:\eclipse-java-europa-win32\eclipse\plugins\org.apache.derby.core_10.3.2\derby.jar;C:\eclipse-java-europa-win32\eclipse\plugins\org.apache.derby.core_10.3.2\derbytools.jar;.)
    so maybe that's the problem? What do you think about this?

  • RMI Problem --   java.rmi.UnmarshalException:

    I am having a client and a server.... when i am trying to bring the client into server. but when i am doing it... i am getting an exception as below as...
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.io.EOFException
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         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 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.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         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.AWTEventMulticaster.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.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(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.io.EOFException
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 60 more
    can any one help me out to solve this problem.......

    Thanks for ur reply...Now i' m getting the access denied problem..
    I am able to create the rmi registry successfully on the server, Then Binding is also done successfully. but when i try to connect the client to the server the exception is thrown Please help me..
    TEST - client PC name.
    java.security.AccessControlException: access denied (java.net.SocketPermission TEST 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.getAllByName(Unknown Source)
         at java.net.InetAddress.getByName(Unknown Source)
         at java.net.InetSocketAddress.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
         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.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         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 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.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         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.AWTEventMulticaster.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.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(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)

  • RMI UnmarshalException Occurs after some time

    Hi,
    I have a client server application that talks via rmi. My client saves data to a server or gets data by passing in parameters that include string, boolean and a Hashtable. The data is saved and retrieved many times. However, after some time, the RMI can't even find the method. That is, the client calls a method and I get a unmarshalling exception from the client, basically stating that it can't find the method.
    Here is the method in my interface, the method in question is the override method, the getLast works fine all the time:
    public interface Admin extends Remote
         Hashtable getLast(Hashtable setLashtHash) throws RemoteException;
    //override method can query or set a new data in the form of a hashtable. It return a Hashtable or null
         Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException;
    Here's the implementation of override:
         synchronized public Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException
              try{
              if(setNew)
                   if(newOverride!=null)
                   System.out.println("Saving override hash, entries=" + newOverride.size());
                   overrideHash=newOverride;
              else if(getOverrideHash)
                   if(overrideHash!=null)
                   System.out.println("Getting override hash entries=" + overrideHash.size());
                   return overrideHash;
              else
                   if(getLast)
                        if(overrideHash==null)
                             System.out.println("override hash is null");
                             return null;
                        OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
                        if(os.last!=null)
                             System.out.println("Last price for ticker " + ticker + " is=" +os.last);
                             Float last=os.last;
                             return last;
                        return null;
                   else if(getPrevious)
                        if(overrideHash==null)
                             return null;
                        OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
                        if(os.previous!=null)
                             Float previous=os.previous;
                             return previous;
                        return null;
         }catch(Exception e)
              System.out.println("Unknown Exception caught in override function");
              e.printStackTrace();
              return null;
    Here is the exception, please help.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: invalid method hash
    java.rmi.UnmarshalException: invalid method hash
    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 AdminImpl_Stub.override(Unknown Source)
    at StocksTable$12.run(stockstable.java:481)
    Please help,
    Thanks Steve

    By the way, this is how my server calls the client:
    Hashtable otable=(Hashtable)a1.override(false,new String(""),true,false,false,new Hashtable());

  • RMI: UnmarshalException, can't find method after some time.

    Hi,
    I have a client server application that talks via rmi. My client saves data to a server or gets data by passing in parameters that include string, boolean and a Hashtable. The data is saved and retrieved many times. However, after some time, the RMI can't even find the method. That is, the client calls a method and I get a unmarshalling exception from the client, basically stating that it can't find the method.
    Here is the method in my interface, the method in question is the override method, the getLast works fine all the time:
    public interface Admin extends Remote
    Hashtable getLast(Hashtable setLashtHash) throws RemoteException;
    //override method can query or set a new data in the form of a hashtable. It return a Hashtable or null
    Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException;
    Here's the implementation of override:
    synchronized public Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException
    try{
    if(setNew)
    if(newOverride!=null)
    System.out.println("Saving override hash, entries=" + newOverride.size());
    overrideHash=newOverride;
    else if(getOverrideHash)
    if(overrideHash!=null)
    System.out.println("Getting override hash entries=" + overrideHash.size());
    return overrideHash;
    else
    if(getLast)
    if(overrideHash==null)
    System.out.println("override hash is null");
    return null;
    OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
    if(os.last!=null)
    System.out.println("Last price for ticker " + ticker + " is=" +os.last);
    Float last=os.last;
    return last;
    return null;
    else if(getPrevious)
    if(overrideHash==null)
    return null;
    OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
    if(os.previous!=null)
    Float previous=os.previous;
    return previous;
    return null;
    }catch(Exception e)
    System.out.println("Unknown Exception caught in override function");
    e.printStackTrace();
    return null;
    Here is the exception, please help. Does anyone know why the exception is "invalid method hash"? I don't understand why it's saying that, I am calling method override(....).
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: invalid method hash
    java.rmi.UnmarshalException: invalid method hash
    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 AdminImpl_Stub.override(Unknown Source)
    at StocksTable$12.run(stockstable.java:481)
    Please help,
    Thanks Steve

    By the way, this is how my server calls the client:
    Hashtable otable=(Hashtable)a1.override(false,new String(""),true,false,false,new Hashtable());

  • RMI UnmarshalException

    Hi Guys,
    I currently have an application using RMI and every now and then receive the following error:
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.net.SocketException: Connection reset
    My RMI connection between the client and server is then disconnected. At the moment I have implemented
    a heart beat type arrangement to know when the connection has died, and to reconnect it. This solution is just temporary until I am able to fix the real problem.
    I have been doing alot of searching to try and find the problem but have been unsuccesful in finding the problem / solution. Seems many people get this kind of problem.
    Can anyone help me out ?
    Cheers ... Gregg.

    Hi ,
    Le' me give u some hints ................
    @ Check the java.policy file for the permissions and make the changes.........where u need to add permissions....
    permission java.net.SocketPermission "<hostname>:<portno>-", "listen, connect, accept, resolve";
    and few more things.
    @ An UnmarshalException can be thrown while unmarshalling the parameters or results of a remote method call if any of the following conditions occur: if an exception occurs while unmarshalling the call header if the protocol for the return value is invalid if a java.io.IOException occurs unmarshalling parameters (on the server side) or the return value (on the client side).
    Did this solve ur problem.
    Rave.

  • RMI "UnmarshalException" issue

    Hi,
    I am doing a sample RMI application in the following step by step process but in the *8th* step I am getting exception so please kindly resolve my issue.
    Step-1: creating “Service interface”
              AddServiceInterface.java
              ====================
    import java.rmi.*;
    public interface AddServiceInterface extends Remote
         public int add(int a, int b) throws RemoteException;
    Step-2: Compiling “Service interface”
    D:\BAJI\Programs\JAVA\rmi\rmi_server>javac AddServiceInterface.java
    D:\BAJI\Programs\JAVA\rmi\rmi_server>
    Step-3: creating the Service interface implementation class
                   AddService.java
                   ============
    import java.rmi.*;
    import java.rmi.server.*;
    public class AddService extends UnicastRemoteObject implements AddServiceInterface
         public AddService() throws Exception
         public int add(int a, int b) throws RemoteException
              return (a+b);
    Step-4: Compiling the “Service interface” implementation class
    D:\BAJI\Programs\JAVA\rmi\rmi_server>javac AddService.java
    D:\BAJI\Programs\JAVA\rmi\rmi_server>
    Step-5: Start the RMI service
    1)openned a new command prompt and typed the following command
    2)d:\> rmiregistry
    Step-6: Create stub and skeleton classes
    D:\BAJI\Programs\JAVA\rmi\rmi_server>rmic AddService
    D:\BAJI\Programs\JAVA\rmi\rmi_server>
    Step-7: Create RMI Server Application which export the Server object into Naming service
    RMIServerApp.java
    ===============
    import java.rmi.*;
    public class RMIServerApp
         public static void main(String[] args) throws Exception
              AddServiceInterface asi = new AddService();
              Naming.bind("rmi://localhost/as",asi);
              System.out.println("\n\n***************** Registored into Naming Service ****************\n\n");
    Step-8: Compiling & execute
    D:\BAJI\Programs\JAVA\rmi\rmi_server>javac RMIServerApp.java
    D:\BAJI\Programs\JAVA\rmi\rmi_server>java RMIServerApp
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
    server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: AddServiceInterface
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    66)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:707)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
    RemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
    223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at java.rmi.Naming.bind(Naming.java:111)
    at RMIServerApp.main(RMIServerApp.java:8)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
    ception is:
    java.lang.ClassNotFoundException: AddServiceInterface
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    66)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:707)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassNotFoundException: AddServiceInterface
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
    07)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
    28)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
    m.java:238)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    699)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
    ... 9 more
    Step-9: Create the “client object” file
                   RMIClient.java
                   ===========
    import java.rmi.*;
    public class RMIClient
         public static void main(String[] args) throws Exception
              AddServiceInterface asi = (AddServiceInterface)Naming.lookup("rmi://localhost/as");
              System.out.println(asi.add(10,20));
    Thanks & Regards,
    BSK

    The registry cannot find the class named in the exception.

  • Please help! HelloWorld RMI getting UnmarshalException

    I am just trying to run the HelloWorld RMI example from SUN:
    http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html
    And I want to dynamic download the stub class to the client.
    I have read the other threads here but no suggestions solved the problem. Of course if I copy the stub class to the client PC, it will work.
    I am running server and client on two NTs. The policy file grants all permissions. And I don't have the stub class available thru the server's classpath (it won't work if I do either). Actually I didn't add anything to the classpath.
    The codebase looks like:
    -Djava.rmi.server.codebase=http://ip address of the server/classes/
    or -Djava.rmi.server.codebase="file:/C:\Netscape\Server4\docs\classes/"
    or -Djava.rmi.server.codebase="file://C:/Netscape/Server4/docs/classes/"
    I use IPlanet as the webserver so C:/Netscape/Server4/docs/ is the public html dir. And the stub, skel, and server classes are under classes dir.
    The error is:
    java.io.IOException: Malformed URL: file:/C:/AT/ file:/C:/Netscape/Server4/docs
    /javax.jar file:/C:/iPlanet/iAS6/ias/lib/java/kfcjdk11.jar file:/C:/iPlanet/iAS
    Series Client/java/lib/com.ibm.mq.jar file:/C:/Program Files/MQSeries Client/ja
    :/C:/AT/scripts/ file:/C:/AT/xml/xerces.jar
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.ja
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.jav
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:89)
    at examples.hello.HelloClient.main(HelloClient.java:15)
    It looks like it takes the classpath on my server PC as the URL instead of taking the codebase.
    At last I want to point out that the example SUN provided was using an Applet on the client side, which works fine when I tried it. But I want to test an application running on the client, so I just wrote this HelloClient.java, which caused all the problem:
    package examples.hello;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    public class HelloClient {
    static public void main(String args[]) {
         try {
    Hello obj = (Hello)Naming.lookup("//" + args[0] + "/HelloServer");
         String message = obj.sayHello();
         System.out.println("HelloClient: " + message);
         } catch (Exception e) {
         System.out.println("HelloClient exception: " +
                        e.getMessage());
         e.printStackTrace();
    To run the client: java examples.hello.HelloClient 111.11.11.111 (IP address of the server)
    I know there are a lot RMI gurus here, please suggest if you tried running RMI on two PCs with stub downloading to an Java application. Thanks a lot,

    the UnmarshalException can also be thrown bcause of not implementing Serializable interface to ur RMIServer class...
    just try out this,
    cause i was also getting the same pb. and got solved ....
    Regards,
    Ritesh

  • RMI Client UnmarshalException with UNC paths

    I have a 'none' Java application, that has an embedded JVM which is being used as an RMI server to allow communication to the application from a browser. The applet detects the presence of the RMI server and if not detected, will start the application, which in turns starts the RMI server. Once the RMI server is started the Client then invokes the method on the server, and hence into the application.
    If the executable for this application is pathed to either a local or mapped drive then everything works as expected, if I then try to use a UNC path, once the RMI server is started, the client returns an UnmarshalException:
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
    java.io.EOFException
    java.io.EOFException
    at java.io.DataInputStream.readByte(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Unknown Source)
    I guess that the problem is that the serialization process has been started, and as the client starts reading from the datastream the UNC paths cause the EOF Exception. any help on how to get round this problem would be gratefully received. Unfortunately using a mapped drive is not a solution to this problem due to the way the application is being served.

    Hi all,
    It turns out that when the java.policy file is being read, it ignores the servername on the UNC path and therefore looks for a directory of the remaining data of the UNC path for the file. I guess it is now a task of figuring out why this is...

  • RMI Exceptions:UnmarshalException and AccessControlException

    Hi,
    While running my RMI Application, the client throws the exception:
    java.rmi.UnmarshalException:Error unmarshalling return header; nested exception is:
    java.io.EOFException
    while the server throws the following exception:
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1325 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1327 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    0.10.2.0:1326 accept,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:267)
    at java.security.AccessController.checkPermission(AccessController.java:
    394)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
    at java.lang.SecurityManager.checkAccept(SecurityManager.java:1157)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.checkAcceptPermi
    ssion(TCPTransport.java:562)
    at sun.rmi.transport.tcp.TCPTransport.checkAcceptPermission(TCPTransport
    .java:201)
    at sun.rmi.transport.Transport$1.run(Transport.java:146)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
    60)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
    .java:701)
    at java.lang.Thread.run(Thread.java:479)
    I would be glad to receive assistance from anyone, please.
    Best regards

    I looks like you forgot to specify the security policy:
    see http://java.sun.com/docs/books/tutorial/rmi/running.html
    Genady

Maybe you are looking for