RMI Applet error

I'm programming a RMI based messenger system. I tested the server and a java console client... all worked very well!
After that, I programmed a very simple test applet (source below).
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.rmi.*;
import java.rmi.server.*;
public class MessageApplet extends Applet {
     private MessageDaemon messaged;
     public MessageApplet() {}
     public void init() {
          try {
               // connect RMI Server
               messaged = (MessageDaemon)Naming.lookup("rmi://myhost.net/messaged");
// RMI test
               System.out.println(messaged.whois("username").getName());
          catch (Exception e) {
               e.printStackTrace();
I start the applet under Windows 98 (JDK 1.3.1) with the following command:
appletviewer MessageApplet.html
and all I get is the following exception:
java.security.AccessControlException: access denied (java.net.SocketPermission myhost.net resolve)
at java.security.AccessControlContext.checkPermission(Compiled Code)
at java.security.AccessController.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1004)
at java.net.InetAddress.getAllByName0(Compiled Code)
at java.net.InetAddress.getAllByName0(InetAddress.java:544)
at java.net.InetAddress.getByName(Compiled Code)
at java.net.Socket.<init>(Socket.java:98)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect SocketFactory.java:29)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Compiled Code)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:462)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:194)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:89)
at MessageApplet.init(MessageApplet.java:27)
at sun.applet.AppletPanel.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
If I run the same applet unter MRJ (Mac OS Runtime for Java, JDK 1.1.8, Apple Applet Runner) on my Mac, I get another exception:
java.rmi.UnmarshalException: Return value class not found; nested exception is: java.lang.ClassNotFoundException: MessageDaemonImpl_Stub
at sun.rmi.registry.RegistryImpl_Stub.lookup(RegistryImpl_Stub.java)
at java.rmi.Naming.lookup(Naming.java)
at MessageApplet.init(MessageApplet.java:27)
at com.apple.mrj.JManager.JMAppletViewer_OLD.doAppletInit(JMAppletViewerOld.java)
at com.apple.mrj.JManager.JMAppletViewer_OLD.setState(JMAppletViewerOld.java)
at com.apple.mrj.JManager.JMViewerEvent.post(JMAppletViewerOld.java)
at com.apple.mrj.JManager.AVDispatcherThread.run(JMAppletViewerOld.java)
What could be the problem? Do I have to add some permissions? The client could load the MessageDaemonImpl_Stub class without any problems, so there is surely no problem with the server/rmiregistry.
Thank you very much.
Best Regards,
Adrian R.

some additional information:
I started the applet with appletviewer (1.3.1) under Windows...
appletviewer http://192.168.0.1/msg/MessageApplet.html
(no problems)
appletviewer http://myhost.net/msg/MessageApplet.html
(security exception allthough myhost.net is the same host as 192.168.0.1!)
The server ist running on a linux system with 2 network interfaces: LAN: 192.168.0.1 and WAN: (DHCP, dynamically linked to a DNS). I'm testing the applet from a host in the LAN and only the url http://192.168.0.1/msg/MessageApplet.html did work.
I also tested the applet with MS IE 6 and all I got is the following exception:
java.lang.ClassNotFoundException: java.rmi.Naming
on my Mac I tested the applet in MS IE 5 and it worked with the URL: http://192.168.0.1/msg/MessageApplet.html but http://myhost.net/msg/MessageApplet.html didn't work.
What about IE 6? Is it possible that IE doesn't support RMI?!?! But what to do? And how can I solve the problem regarding "IP vs. DNS"?
Best Regards
Adrian R.

Similar Messages

  • "java.rmi.UnmarshalException: error unmarshalling" at Applet with RMI comm.

    Hello,
    I am trying to make an Applet work with an RMI server, but i keep getting the same exception again and again whatever i do.
    More specifically, i get the following :
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.net.MalformedURLException: unknown protocol: c
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at server.ClientDemo.initGUI(ClientDemo.java:100)
         at server.ClientDemo.<init>(ClientDemo.java:85)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.MalformedURLException: unknown protocol: c
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at java.net.URL.<init>(Unknown Source)
         at sun.rmi.server.LoaderHandler.pathToURLs(Unknown Source)
         at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
         at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
         at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
         at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
         at java.io.ObjectInputStream.readProxyDesc(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)
         ... 13 more
    The exeption is thrown at the following line :
                   remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
    This is the code of the server which seems to be running ok:
    if(System.getSecurityManager()==null)
                   System.setSecurityManager(new SecurityManager());
              registry = LocateRegistry.createRegistry(1099);
              RMIServer sr=(RMIServer) UnicastRemoteObject.exportObject(new ServerDemo(),1099);
              registry.rebind(RMIServer.REGISTRY_NAME, sr);
    and the client:
    registry = LocateRegistry.getRegistry("localhost");
    remoteReference = (RMIServer) registry.lookup(RMIServer.REGISTRY_NAME);
    Thank you in advance
    Alex
    Forgot to mention that i am setting the security policy and codebase programmatically:
    System.setProperty("java.security.policy","C:\\Users\\Alex\\workspace\\Demo\\grantall.policy");
              System.setProperty("java.rmi.server.codebase","C:\\Users\\Alex\\workspace\\Demo\\bin");
    Edited by: Alkon on May 15, 2008 4:31 PM

    I edited the code that sets the security and i am now getting the following error, again at the lookup:
    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 server.ClientDemo.initGUI(ClientDemo.java:101)
         at server.ClientDemo.<init>(ClientDemo.java:91)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.EOFException
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 15 more

  • Please help me regarding RMI Applet Application?

    Hi Friends..
    Please help me describe the work-flow of RMI Applet Application..
    Currently, i use Java Card 2.2.1.. In the package Java Card 2.2.1 there's an example of RMI Applet Application..
    in that RMI Applet Application there are 3 Java files, namely :
    1. public interface Purse extends Remote
    2. public class PurseImpl extends CardRemoteObject implements Purse
    3. public class PurseApplet extends Applet
    There's also RMIDemo.opt file.. and in the contain of that RMIDemo.opt file, there's only PurseApplet class that would be converted to CAP file..
    so, what is the use of Purse Interface and PurseImp class?.. and how to use both of them?..
    Please help me regarding this..
    Thanks in advance..

    Hi Shane, thanks for clarifying that.. :).. Ok. i'm going to learn hard..
    Sorry, i've a doubt regarding this thread ..
    In that thread, that's mentioned purse.jar containing :
    - Purse.class
    - PurseApplet.class
    - PurseImpl_Stub.class
    - PurseImpl.class
    The only class that i'm wondering is PurseImpl_Stub.class..
    Why this class required, whereas i don't found it in the RMIDemo application that shipped with JCDK 2.2.1, and JCDK 2.2.2 as well..
    I've tried to create other Java Card RMI Application, but it requires the "Stub" class..
    Here's the error message :
    java.rmi.StubNotFoundException: com.latihan.rmi.DataMahasiswaImpl_Stub
         at com.sun.javacard.ocfrmiclientimpl.JCCardObjectFactory.getRemoteObject(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.getObject(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.JavaCardRMIConnect.getInitialReference(Unknown Source)
         at testRMIClient.DataMahasiswaClient.main(DataMahasiswaClient.java:43)How to create and what's the contain of that "Stub" class?..
    Can i know the source code of PurseImpl_Stub.java file?..
    Thanks in advance..
    Edited by: Leonardo_Carreira on Apr 13, 2010 8:27 PM

  • RemoteException: 111 java.rmi.ServerError: Error occurred in server thread

    Hi,
    I'm just new to the RMI field of JAVA. I'm trying to write a program that import the math.jar file in the server side. And the client end can invoke the methods of math.jar and get the value.
    I got the error messages as below:
    RemoteException: 111 java.rmi.ServerError: Error occurred in server thread; nested exception is:
         java.lang.NoClassDefFoundError: org/mathwhizz/Heron
    It can work well if I use source classes(*.class) directly instead of importing math.jar. The failure only happened when I try to make use of jar file. Thus I guess my setup and configuration should be ok. Is there anything I should be very careful if I try to run RMI and import a jar file in the program of server side ?
    Do I need to use JNLP and web start application in this issue?
    I'm appreciated for your responses...thanks...
    Sincerely,
    Brandon

    I've got a problem with rmi, when I launch my server, I have this error:
    Erreur du remote: java.rmi.ServerError: Error occurred in server thread; nested exception is:
    java.lang.NoClassDefFoundError: com/borland/dx/dataset/DataSetData
    Help me please
    Thank you

  • New @ RMI need help with  java.rmi.UnmarshalException: error unmarshalling

    Hi @ all out there,
    I'm new with Java RMI and have to write a EventSystem for an college project where clients can subscribe to a topic and get notified when someone publishes a message to the subscribed topic.
    At server-side I have a class called EventSystem that provides methods for subscribing and unsubscribing from topics, and also for posting messages (for publishers).
    To subscribe i thought that the client must specify the topic and also itself ( means that a client calls in this way: obj.subscribe("mytopic", this).
    The EventSystem handles a list of all clients, and whenever a new message is posted it goes trough all clients and invokes the handleMessage(String msg) method that all Clients have to provide.
    On my local machine without RMi this concept works just great.
    I now tried to get it working using RMI , but I get the following Exception when starting the client (the server starts fine) :
    Looking up for rmiregistry at 138.232.248.22:1099
    Subscriber exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
            at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
            at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
            at $Proxy0.subscribe(Unknown Source)
            at SubscriberImpl.main(SubscriberImpl.java:48)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:293)
            at sun.rmi.transport.Transport$1.run(Transport.java:159)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:713)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1733)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
            ... 9 more
    Caused by: java.io.InvalidClassException: SubscriberImpl; class invalid for deserialization
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:587)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
            ... 13 moreI googled now for 2 hours but can't resolve the problem alone. As far as I can understand I have to serialize Objects that I want to send to the server, right?
    So how can i do this? I've never used serialization till now.
    any ideas how to solve this problem?
    greets from italy and sorry for my very weak english
    bd_italy

    A class has been modified after deployment. Stop the Registry, clean, recompile, and redeploy.

  • JSP client in RMI system - java.rmi.UnmarshalException: error unmarshalling

    Hi,
    Im developing a login part for a distributed airline reservation system using JSP as the client but while executing the jsp, the error that is being catched is :
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
    Here are my codes:
    //Interface - Airline.java
    package Air;
    import java.rmi.*;
    public interface Airline extends Remote
         public int CheckUname(String username) throws RemoteException;
    }//implementation - AirlineImpl.java
    import java.net.*;
    import java.io.*;
    import java.sql.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class AirlineImpl extends UnicastRemoteObject implements Airline
         public AirlineImpl() throws RemoteException
              super();
         public int CheckUname(String username) throws RemoteException
              try
                   int UnameCount = 0;
                   String xxx = "eaglebeta";
                   if(username.equals(xxx)
                        UnameCount++;
                   return UnameCount;
              catch (Exception e3)
                   System.out.println("Error: " + e3);
                   return 0;
    }//Server - AirlineServer.java
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class AirlineServer
         public static void main(String arg[])
              try
                   Airline myAirline = new AirlineImpl();
                   Naming.rebind("Airline", myAirline);
                   System.out.println();
                   System.out.println("************************************");
                   System.out.println(" >>> Airline Reservation System <<< ");
                   System.out.println("    >>> Server is Listening! <<<    ");
                   System.out.println("************************************");
                   System.out.println();
              catch (RemoteException e)
                   //System.out.println("Error: " + e);
                   System.out.println("RMI Registry is not active!");
                   System.out.println("Activate RMI Registry and retry!");
                   System.out.println("Bye bye, exiting...");
              catch (java.net.MalformedURLException e)
                   //System.out.println("URL Error: "+ e);
                   System.out.println("URL Malformed!");
                   System.out.println("Bye bye, exiting...");
    }//JSP client - newuser.jsp
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page import="java.rmi.*, javax.servlet.*" %>
    <%@ page import="java.util.*, java.lang.*, java.io.*, Air.Airline" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#99CCFF">
    <%
    Object Airline = null;
    try
    Airline Air = (Airline)Naming.lookup("rmi://localhost/Airline");
    String Name = "eaglebeta";
    if(Air.CheckUname(Name)>0)
         %>
              Username already exists, choose another name
         <%
    else
         %>
         <%=Name%>
         <%
    catch (Exception e1)
    %>
    <%=e1%>
    <%
    %>
    </body>
    </html>The server, implementation, interface and stub are in a folder named "Airline Server" located on my desktop.
    The interface and stub again are in another folder named "Air" located in the "classes\Air" directory which is located in the tomcat 5.5 installation directory!
    The JSP client is located in the "Root" folder in the tomcat 5.5 installation derectory!
    1. I start the registry in the "Airline Server" folder by typing rmiregistry
    2. Load the Airline Server - java AirlineServer
    3. Call the jsp - http://localhost/newuser.jsp
    And i get the following error:
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
    Please help me to solve this problem!

    When I am including security manager in my JSP code, the browser just get blank without any display
    if(System.getSecurityManager() == null)
         System.setProperty("java.security.policy", "java.policy");
        System.setSecurityManager(new RMISecurityManager());
    }Please, someone solve my problem! Im realy stuck and I don't know how to proceed! Provide me with a solution or any tutorial that would help me...

  • Java.rmi.MarshalException: error marshalling arguments

    I've two class Client and Main. Eventnotify is implemented in class Client using RMI techniques. Here is sample
    public interface EventNotify extends Remote {
    void SendNotification (String str) throws RemoteException;
    public class Client implements EventNotify {
         //implementation of EventNotify
         public void SendNotification(String str) {
         System.out.println("from srver: ..." +str);
    class Main {
    public static void main(String[] args) {
    Client clnt = new Client();
    int val = stub.register_client(host, clnt); //THE ERROR IS HERE
    The idea is to pass remote objects from client to a server. I've a server program running continously, but the problem is on passing objects of type Client. I'm facing marshaling problem.
    AND THE ERROR IS
    Client exception: java.rmi.MarshalException: error marshalling arguments; nested exception is:
         java.io.NotSerializableException: Client
    java.rmi.MarshalException: error marshalling arguments; nested exception is:
         java.io.NotSerializableException: Client
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:156)
         at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:195)
         at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:149)
         at $Proxy0.register_client(Unknown Source)
         at Main.main(Client.java:74)
    Thanks for helping.
    Caused by: java.io.NotSerializableException: Client
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
         at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:292)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:151)

    Probably I have a similar problem while calling remote object's method with parameter looks like that :
    public class ParamClass extends AbstractParamClass implements Runnable,
            java.io.Serializable {
        private NodeList field1; // part of crimson's tree
        private NamedNodeMap field2 = null;// part of crimson's tree
    public class RmiRemote extends AbstractRemote  { // Remote Object Class
    @Override
    public  Object remoteMethod1() throws RemoteException{
    ParamClass param = new  ParamClass("build with crimson");
    CustomInterface stub = (CustomInterface) registry.lookup(name);
    stub.callRemoteMethod(param); // exception here
    java.rmi.MarshalException: error marshalling arguments; nested exception is:
            java.io.NotSerializableException: org.apache.crimson.tree.AttributeSet
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:138)
            at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)when I build param object with xerces - no exception occurs . Other methods of remote object doing well. Remote object extends AbstractRemote superclass derived from UnicastRemoteObject. How can I avoid this problem and call method with crimson's tree fields parameter?
    Thank you.

  • Java.rmi.UnmarshalException: Error unmarshaling return header

    Hi,
    We are running an RMI server instance to serve data ( from memory) to clients. It works fine if fewer number of inquiries goes in. But when the number of inquiries are larger, I am getting some exceptions at the client side. The server crashes without throwing any exceptions. Following are the exceptions received at client side:
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.net.SocketException: Connection reset
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
         at com.emf1.dataserver.KeyFrequencyKeeper_Stub.getDUNSCounts(Unknown Source)
         at com..match.KeyFrequencyKeeperProxy.getKeyKQSs(KeyFrequencyKeeperProxy.java:307)
         at com.emf1.match.KeyGenerator.generateKeys(KeyGenerator.java:453)
         at com.emf1.match.InquiryProcessor.run(InquiryProcessor.java:870)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:168)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
         at java.io.DataInputStream.readByte(DataInputStream.java:331)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
         ... 6 more
    The period of time, the server keeps on running (before it crashes) is also not the same. Sometimes it works fine without any problem. But most of the time the server crashes after processing some records.
    I don't know why this is happening.
    Please help...
    Thanks in advance..

    I have this error too when I running my rmi server site program.
    I am running it in Linux Environment.
    Anyone got any idea about this?

  • Java.rmi.UnmarshalException:error

    hi,
    A rmi program does not work on my pc but it worked on others pc there are three programs ie RMIServer.java which is the server application ,RMIClient.java which is the client application and RMIInterface.java which has two methods which are remote all these programs gets compiled but while running it from the dos prompt it gives these errors:
    RemoteException occured in serverthread;nested exception is:java.rmi.UnmarshalException:error unmarshalling arguments;nested exception is:java.lang.ClassNotFoundException:RMIServer_stub
    what is the problem how does it work on others pc and not on mine how should i handle these exception what are the reasons for its occurrance please help

    It might help to start the rmiregistry from the directory where your class files are stored.
    In this case the rmiregistry adds its working directory to its codebase.
    Just keep in mind that the rmiregistry works in a similar fashion to the javac compiler & needs to be able to find the _Stub & _Skel class files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Java.rmi.UnmarshalException: error unmarshalling arguments;

    Hi!
    I'm a newbe with rmi, and I try to use a test program, from Thinking in Java:
    ITiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    interface ITiempoPerfecto extends Remote {
         long obtenerTiempoPerfecto() throws RemoteException;
    TiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    import java.net.*;
    public class TiempoPerfecto extends UnicastRemoteObject implements ITiempoPerfecto {
         public long obtenerTiempoPerfecto () throws RemoteException {
              return System.currentTimeMillis();
         public TiempoPerfecto() throws RemoteException {
               super();
         public static void main(String[] args) throws Exception {
              System.setSecurityManager(new RMISecurityManager());
              TiempoPerfecto tp=new TiempoPerfecto();
              Naming.bind("//localhost/TiempoPerfecto",tp);
              System.out.println("Preparado para dar la hora");
    }and
    MostrarTiempoPerfecto.java
    package c15.rmi;
    import java.rmi.*;
    import java.rmi.registry.*;
    public class MostrarTiempoPerfecto {
         public static void main(String[] args) throws Exception {
              System.setSecurityManager( new RMISecurityManager());
              ITiempoPerfecto t=(ITiempoPerfecto)Naming.lookup("//localhost/TiempoPerfecto");
              for (int i=0;i<10;i++)
                   System.out.println("Tiempo perfecto: "+t.obtenerTiempoPerfecto());
    }I compile all the files normally.
    Later I do:
    rmiregistry &
    rmic c15.rmi.TiempoPerfecto(This only generate the file TiempoPerfecto_Stub.class, it's ok?)
    Without warnings or errors. But when I try to create a server object
    java c15/rmi/TiempoPerfectoI obtain this:
    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: c15.rmi.TiempoPerfecto_Stub
            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)
    .......What is the mistake? What may I do to run this programs?
    Thank you!

    You must change your current directory to your class path (EX: java c15/rmi/TiempoPerfecto) then execute command remiregistry.

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

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

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

  • Load Applet Error on Sun SPE Pages

    Hi,
    I have a scenario where I am displaying the IDMXExampleEndUser form on the home page when an SPE user logs in. This form has a field definition for listing resources as follows:
    <Field name='resources'>
    <Display class='MultiSelect'>
    <Property name='title' value='Resources'/>
    <Property name='availableTitle' value='Available'/>
    <Property name='selectedTitle' value='Available'/>
    <Property name='allowedValues'>
    <invoke name='getResources' class='com.sun.idm.idmx.ui.FormUtil'>
    <ref>context</ref>
    </invoke>
    </Property>
    <Property name='codeBase' value='../../applet/'/>
    <Property name='command' value='Recalculate'/>
    </Display>
    </Field>
    However, the resources do not get listed on the web page because of the following applet error.
    load: class com.waveset.ui.web.applet.multiselect.class not found.
    java.lang.ClassNotFoundException: com.waveset.ui.web.applet.multiselect.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Please note the lower case in "multiselect.class". This class is however available in idmclient.jar. Is this a known issue ? Please help out.
    The list does become available when I change the field's display class from "MultiSelect" to "Select". I would assume this is some problem specific to the MultiSelect implementation class.
    Thanks,
    Srinivas

    I suspect the culprit is the codebase setting. As you already know the multiselect class exists in the IDMCLIENT.JAR. The codebase setting is telling it to look in the specified path...where i suspect the jar file does not exist...remove the codebase setting or set it for the correct path.
    Hope this helps...
    -L

  • RMI server error under Linux

    Hi all,
    I'm not excatly sure, whether this is the right forum. Anyway, my problem is this:
    I've written a JApplet that calls several methods over RMI. The RMI server is up and running properly. Most of the functions work well. One that initializes a JTree, however, causes problems. I get the following error message and I am stumped:
    java.rmi.ServerError: Error occurred in server thread; nested exception is:
         java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:289)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:536)
         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:133)
         at de.uni_mannheim.wifo2.mlearning.portal.ServerFunctions_Stub.buildStructure(Unknown Source)
         at de.uni_mannheim.wifo2.mlearning.portal.CourseHandlerC.initialize(CourseHandlerC.java:68)
         at de.uni_mannheim.wifo2.mlearning.portal.MobilUM.actionPerformed(MobilUM.java:641)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Caused by: java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
         at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
         at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:125)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:140)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
         at java.awt.Font.initializeFont(Font.java:309)
         at java.awt.Font.<init>(Font.java:345)
         at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:195)
         at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)
         at javax.swing.plaf.metal.DefaultMetalTheme.getUserTextFont(DefaultMetalTheme.java:137)
         at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1405)
         at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)
         at javax.swing.UIDefaults.get(UIDefaults.java:126)
         at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
         at javax.swing.UIDefaults.getFont(UIDefaults.java:346)
         at javax.swing.UIManager.getFont(UIManager.java:491)
         at javax.swing.plaf.basic.BasicTreeUI.installDefaults(BasicTreeUI.java:596)
         at javax.swing.plaf.basic.BasicTreeUI.installUI(BasicTreeUI.java:530)
         at javax.swing.plaf.metal.MetalTreeUI.installUI(MetalTreeUI.java:86)
         at javax.swing.JComponent.setUI(JComponent.java:449)
         at javax.swing.JTree.setUI(JTree.java:551)
         at javax.swing.JTree.updateUI(JTree.java:567)
         at javax.swing.JTree.<init>(JTree.java:522)
         at javax.swing.JTree.<init>(JTree.java:498)
         at javax.swing.JTree.<init>(JTree.java:481)
         at de.uni_mannheim.wifo2.mlearning.portal.ServerFunctions.buildStructure(ServerFunctions.java:237)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:536)
    The entire system had been tested under a Windows XP environment and works without a glitch. Now I've installed the exact same system under unix and this happens!
    If anyone has an idea I would be very grateful!
    Kind regards,
    Falk

    Hi again,
    alternately I get another error doing the excat same thing:
    java.rmi.ServerError: Error occurred in server thread; nested exception is:
         java.lang.NoClassDefFoundError
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:289)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:536)
         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:133)
         at de.uni_mannheim.wifo2.mlearning.portal.ServerFunctions_Stub.buildStructure(Unknown Source)
         at de.uni_mannheim.wifo2.mlearning.portal.CourseHandlerC.initialize(CourseHandlerC.java:68)
         at de.uni_mannheim.wifo2.mlearning.portal.MobilUM.actionPerformed(MobilUM.java:641)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Caused by: java.lang.NoClassDefFoundError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:140)
         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
         at java.awt.Font.initializeFont(Font.java:309)
         at java.awt.Font.<init>(Font.java:345)
         at javax.swing.plaf.metal.DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:195)
         at javax.swing.plaf.metal.DefaultMetalTheme.getFont(DefaultMetalTheme.java:153)
         at javax.swing.plaf.metal.DefaultMetalTheme.getUserTextFont(DefaultMetalTheme.java:137)
         at javax.swing.plaf.metal.MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1405)
         at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:196)
         at javax.swing.UIDefaults.get(UIDefaults.java:126)
         at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
         at javax.swing.UIDefaults.getFont(UIDefaults.java:346)
         at javax.swing.UIManager.getFont(UIManager.java:491)
         at javax.swing.plaf.basic.BasicTreeUI.installDefaults(BasicTreeUI.java:596)
    at javax.swing.plaf.basic.BasicTreeUI.installUI(BasicTreeUI.java:530)
         at javax.swing.plaf.metal.MetalTreeUI.installUI(MetalTreeUI.java:86)
         at javax.swing.JComponent.setUI(JComponent.java:449)
         at javax.swing.JTree.setUI(JTree.java:551)
         at javax.swing.JTree.updateUI(JTree.java:567)
         at javax.swing.JTree.<init>(JTree.java:522)
         at javax.swing.JTree.<init>(JTree.java:498)
         at javax.swing.JTree.<init>(JTree.java:481)
         at de.uni_mannheim.wifo2.mlearning.portal.ServerFunctions.buildStructure(ServerFunctions.java:237)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
         at sun.rmi.transport.Transport$1.run(Transport.java:148)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
         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:536)
    Thanks again!

  • Rmi applet , browser

    hi~
    i have a rmi applet
    when i run the applet (use appletviewer) is ok
    but it's on bowser , can't work
    can anynoe tell me maybe what's problem
    how can i do
    thanks

    security restriction is probably the problem. Try signing the applet or write a policy file and send it with the other files in the client's package for rmi

  • RMI Stub Error

    solved it!
    wheeewwww i dont know why but im sure i've used the option of forward slash before.
    continuation of the problems below.....
    hi!
    i've been trying to debug this auto downloading of Stub or classes, but i cant see what's wrong with the code that it cant see the stub... here's the code
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    import classServer.ClassFileServer;
    import java.io.IOException;
    public class ProcessServer{
           private static ClassFileServer cfs = null;
           public static void main(String[] args){
                  setOptions();
                  //startHTTP();
                  if (System.getSecurityManager() == null) {
                      System.setSecurityManager(new RMISecurityManager());
                  try{
                      System.out.println("Starting server...");
                      Process p = new ProcessImpl("tuaman");
                      //String host = "rmi://localhost/TProcess";                 
                      //Naming.rebind(host, p);
                      String url = "TProcess";
                      Naming.rebind(url, p);
                      System.out.println("RMI binded...");
                  }catch(Exception e) {System.out.println("Error creating server..." + e);}
           private static void setOptions(){             
                   System.setProperty("java.rmi.server.codebase", "file:/C:\\Restua\\temp\\rmi\\/");
                     System.setProperty("java.security.policy", "java.policy");
           private static void startHTTP(){
                   String loc = "C:\\Restua\\temp\\rmi";
                     try {
                        cfs = new ClassFileServer(2001, loc);
                   }catch(IOException io){ System.out.println("err cfs : " + io);}
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.net.MalformedURLException;
    import java.rmi.NotBoundException;
    import java.rmi.RMISecurityManager;
    public class ProcessClient {
        public static void main(String[] args) {
            setOptions();
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new RMISecurityManager());
            try {
                //String url = "rmi://localhost/TProcess";
                String url = "TProcess";
                Process p = (Process)
                               Naming.lookup(url);
                System.out.println( p.getDescription() );
           catch(Exception e){
             System.out.println("Exception all.");
             public static void setOptions(){
              System.setProperty("java.rmi.server.codebase", "file:/C:\\Restua\\temp\\rmi\\/");
              System.setProperty("java.security.policy", "java.policy");
    } thanks again =)
    --my previous post.....
    hi!
    I'm tying to run an RMI, on the tutorial it says run the service, with the classpath, here's my setup
    C:\Restua\temp\rmi>dir
    Volume in drive C has no label.
    Volume Serial Number is D805-23B8
    Directory of C:\Restua\temp\rmi
    07/31/2006  11:38 AM    <DIR>          .
    07/31/2006  11:38 AM    <DIR>          ..
    07/31/2006  11:07 AM               219 Process.class
    07/31/2006  11:07 AM               162 Process.java
    07/31/2006  11:22 AM             1,099 ProcessClient.class
    07/31/2006  11:21 AM             1,344 ProcessClient.java
    07/31/2006  11:13 AM               608 ProcessImpl.class
    07/31/2006  11:12 AM               460 ProcessImpl.java
    07/31/2006  11:27 AM             1,649 ProcessImpl_Stub.class
    07/31/2006  11:37 AM               913 ProcessServer.class
    07/31/2006  11:37 AM               415 ProcessServer.java
                   9 File(s)          6,869 bytes
                   2 Dir(s)  16,828,911,616 bytes free
    C:\Restua\temp\rmi>here's the content of the class...
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface Process extends Remote{
           String getDescription() throws RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.RemoteException;
    public class ProcessImpl extends UnicastRemoteObject
                             implements Process{
           private String desc;
           public ProcessImpl(String d) throws RemoteException{
                  super();
                  desc = d;
           public String getDescription() throws RemoteException{
                  return "I am " + desc;
    import java.rmi.Naming;
    public class ProcessServer{
           public static void main(String[] args){
                  try{
                      System.out.println("Starting server...");
                      Process p = new ProcessImpl("tuaman");
                      Naming.rebind("rmi://localhost/1099/TProcess", p);
                  }catch(Exception e) {System.out.println("Error creating server..." + e);}
    }i opened a command windom ran rmiregistry on it, then on the other shell i ran this...
    C:\Restua\temp\rmi>java -classpath . ProcessServer
    Starting server...
    Error creating server...java.rmi.ServerException: RemoteException occurred in se
    rver thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
            java.lang.ClassNotFoundException: ProcessImpl_Stubeven with a java ProcessServer that error occurs, what could be wrong? Why cant it locate the Stub? Thank you so much again Sir/Mam =)
    updates....
    it works fine now =) made a security or policy file, then added a security manager =)
    import java.rmi.Naming;
    import java.rmi.RMISecurityManager;
    public class ProcessServer{
           public static void main(String[] args){
                  if (System.getSecurityManager() == null) {
                      System.setSecurityManager(new RMISecurityManager());
                  try{
                      System.out.println("Starting server...");
                      Process p = new ProcessImpl("tuaman");
                      String host = "rmi://localhost/TProcess";
                      Naming.rebind(host, p);
                      System.out.println("RMI binded...");
                  }catch(Exception e) {System.out.println("Error creating server..." + e);}
    }Message was edited by:
    tuaman
    Message was edited by:
    tuaman
    Message was edited by:
    tuaman
    Message was edited by:
    tuaman

    You have a mixture of GNU java and Sun Java installed. Get rid of the former.

Maybe you are looking for

  • ORA-00333

    Hi, when I started my database last week, it started correctly. But I am getting this error in the alert_log. why is this? how can I fix this? the last few lines of my alertlog ALTER DATABASE OPEN Wed Jun 16 11:33:13 2010 Beginning crash recovery of

  • Bitwise operator question...

    Hi,all. I have been using Java for around 1 year, but still not very comfortable with bitwise problems. I wish some one can give me a thorough explanation for these. Better yet, if you know how to use bitwise operator to solove the real programming p

  • ARD just quit on me....GRRR!

    Everything had been working like a champ since my Lion upgrade.....until yesterday.  I'm on an 20" iMac, 4GB RAM and plenty of HD.  For some reason yesterday, tried to launch ARD admin and it asks if I want to restore windows and just stays there unt

  • Business Package for Transport Management System & Travel Mangement System

    Hi, Is there any <b>Business package</b> available for <b>"Transport Management System" and "Travel Mangement System"</b>? Please provide some link, if it is available. Thanks in advance. Manish

  • Input data to variable type char

    Hello, i would like to know how to input data to Char import java.util.Scanner; Scanner sc = new Scanner(System.in); x = sc.nextInt(); but, its not working on Char