RMI Activation

Ok I'm getting the classnotfound error.
Here is my situation. I have a custom policy file with
some permisions in it. I used to have the permision
java.security.AllPermission, of course that is not the best permision, so I put in java.net.SocketPermission for the
standard things untill I could get the everyting running on the server. Now the client applet connects and has to send an object that holds the users username and password. Every time it gives me a ClassNotFound exception. If I put the java.security.AllPermission back it it works. So does anybody know the correct permisions I need in oder for it to run.

this is the error I get
Data Transmitter AdHocQuery exception: RemoteException occurred in server thread; nested exception is:
     java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
     java.lang.ClassNotFoundException: com.tasc.gunston.users.UserNameTransfer
here are the permisions I have
permission java.net.SocketPermission "147.81.52.41:1521", "connect,resolve";
permission java.net.SocketPermission "*:80", "connect,resolve,accept";
permission java.net.SocketPermission "147.81.52.41:1098", "connect,resolve,accept";
permission java.net.SocketPermission "147.81.52.41:1099", "connect,resolve,accept";
permission java.io.FilePermission "/software/netscape/jcd_new/docs/AdHoc/-", "read,write";
Any Ideas

Similar Messages

  • RMI activation problem under LINUX

    When I try to run the activation example from the RMI tutorial, I get the following exception:
    Exception in thread "main" java.rmi.activation.ActivationException: ActivationSystem not running; nested exception is:
    java.rmi.NotBoundException: java.rmi.activation.ActivationSystem
    at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:453)
    at examples.activation.Setup.main(Setup.java:68)
    Caused by: java.rmi.NotBoundException: java.rmi.activation.ActivationSystem
    at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:106)
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:342)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
    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:350)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:449)
    ... 1 more
    This is with J2SE 1.4.1 on RedHat 7.3 running a vanilla 2.4.18 kernel. I'm running everything out of shell scripts to keep from getting bitten by typos.
    Here's the punchline: The identical code works just fine on RedHat 6.2 (kernel 2.2.14 or so) - same 1.4.1.
    Netstat tells me there is something listening on the appropriate ports, and output from strace suggests that there is some traffic back and forth to the server. There is no firewall running - I unloaded ipchains in the interest of paranoia. (There is firewalling running on the working system, go figure...)
    Help? I can post more details if that would help resolve the problem.

    I wrote
    When I try to run the activation example from the RMI
    tutorial, I get the following exception:<snip>
    The key was this:
    The identical code works just
    fine on RedHat 6.2 (kernel 2.2.14 or so) - same 1.4.1."Identical" really was - I'd used a tar archive to make a complete copy of the code running on the RH 6.2 system. The copy included the file log/Logfile.1, written by rmid (or rmiregistry). This contains lots of IP addresses; I suspect it's more than a log. Since the original machine and the clone are separated by a firewall, attempts by the clone to contact the original failed.
    Deleting the "log" directory made the problem go away.

  • Writing a custom RMI Activator process

    Hello Group,
    I am in the process of implementing a custom RMI activation scheme, in which remote Activatable objects will be hosted in a custom EXE process, instead of the standard Java.exe/Javaw.exe. I intend to use JNI to create the JVM in this custom EXE process and then load Java classes. I have used JNI to create JVMs in native processes before, but have no experience writing custom RMI activation systems.
    Has anyone attempted this before, and knows if there are any gotchas that I should know early on?
    Thanks,
    Ranjit

    I have a breakthrough. I am able to host a simple RMI server inside a custom EXE. All I do is inside the main of a Win32 EXE, create the JVM and use JNI to call the ‘main’ of a Java class I wrote below.
    This class runs (some undocumented) code to bootstrap the RMI machinery. Hereafter my EXE process process remains alive and is available to service RMI requests. Using this approach, I wouldn’t need to recompile java.c inorder to rename it as long as my custom JNI code is able to parse in all the VM options passed in by RMID in order to create the JVM.
    I was missing the crucial step of calling back into rmid (the Activator) and registering the newly created group, only after which would rmid start creating instances of the remote object. Your advice that I carefully read the spec helped!
    public class Host {
    public static void main(String[] args) throws Exception {
    Class clsInputStream = Class.forName("sun.rmi.server.MarshalInputStream");
    Constructor ctor = clsInputStream.getConstructor(InputStream.class);
    Method readObj = clsInputStream.getMethod("readObject", null);
    Method readLong = clsInputStream.getMethod("readLong", null);
    // Instantiate MarshalInputStream
    Object in = ctor.newInstance(System.in);
    // Read all the data passed in by the Activator (rmid)
    ActivationGroupID id = (ActivationGroupID) readObj.invoke(in);
    ActivationGroupDesc desc = (ActivationGroupDesc) readObj.invoke(in);
    long incarnation = (Long) readLong.invoke(in);
    // Create the ActivationGroup
    ActivationGroup grp = ActivationGroup.createGroup(id, desc, incarnation);
    // Callback into rmid to register the group.
    ActivationGroup.getSystem().activeGroup(id, grp, incarnation);
    // rmid will now invoke ActivationGroup.newInstance to create the RMI server
    Thanks,
    Ranjit

  • Quick rmi activation question

    Hi folks,
    I am having a problem with one my activatable objects. Originally I was working on NT but now I'm on Linux and there is a strrange difference in behaviour between the two.
    My Activatable Object starts up once on NT and on any subsequent calls to that object the original 'activated' object is used and no new instance created. However on Linux it seems that SEVEN instances of this objects is created! It's very strange indeed.
    Does anyone have any ideas as to why this is?
    I will enclose the rmid logs and also the command I use to run rmid.
    Any help/suggestions would be greatly appreciated.
    Thanks in advance,
    Brian
    Command used to run the rmid
    ${JAVA_HOME}/bin/rmid -J-Djava.security.policy=/opt/arantech/current/etc/config/policy -C-Djava.rmi.server.logCalls=true -port 1098 -log /var/opt/arantech/assure/procman
    RMID log on startup ( notice all newInstance calls) :(
    Tue Jul 29 15:06:35 IST 2003:ExecGroup-0:err:29-Jul-2003 15:06:34 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:35 IST 2003:ExecGroup-0:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:35 IST 2003:ExecGroup-0:err:29-Jul-2003 15:06:35 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:35 IST 2003:ExecGroup-0:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:37 IST 2003:ExecGroup-1:err:29-Jul-2003 15:06:37 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:37 IST 2003:ExecGroup-1:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:37 IST 2003:ExecGroup-1:err:29-Jul-2003 15:06:37 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:37 IST 2003:ExecGroup-1:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:39 IST 2003:ExecGroup-2:err:29-Jul-2003 15:06:39 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:39 IST 2003:ExecGroup-2:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:39 IST 2003:ExecGroup-2:err:29-Jul-2003 15:06:39 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:39 IST 2003:ExecGroup-2:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:41 IST 2003:ExecGroup-3:err:29-Jul-2003 15:06:41 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:41 IST 2003:ExecGroup-3:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:41 IST 2003:ExecGroup-3:err:29-Jul-2003 15:06:41 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:41 IST 2003:ExecGroup-3:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:44 IST 2003:ExecGroup-4:err:29-Jul-2003 15:06:43 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:44 IST 2003:ExecGroup-4:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:44 IST 2003:ExecGroup-4:err:29-Jul-2003 15:06:43 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:44 IST 2003:ExecGroup-4:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:46 IST 2003:ExecGroup-5:err:29-Jul-2003 15:06:45 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:46 IST 2003:ExecGroup-5:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:46 IST 2003:ExecGroup-5:err:29-Jul-2003 15:06:46 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:46 IST 2003:ExecGroup-5:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:48 IST 2003:ExecGroup-6:err:29-Jul-2003 15:06:47 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:48 IST 2003:ExecGroup-6:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:48 IST 2003:ExecGroup-6:err:29-Jul-2003 15:06:48 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:48 IST 2003:ExecGroup-6:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]
    Tue Jul 29 15:06:50 IST 2003:ExecGroup-7:err:29-Jul-2003 15:06:50 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:50 IST 2003:ExecGroup-7:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.transport.DGCImpl[0:0:0, 2]: java.rmi.dgc.Lease dirty(java.rmi.server.ObjID[], long, java.rmi.dgc.Lease)]
    Tue Jul 29 15:06:50 IST 2003:ExecGroup-7:err:29-Jul-2003 15:06:50 sun.rmi.server.UnicastServerRef logCall
    Tue Jul 29 15:06:50 IST 2003:ExecGroup-7:err:FINER: RMI TCP Connection(1)-192.168.1.107: [192.168.1.107: sun.rmi.server.ActivationGroupImpl[0]: public abstract java.rmi.MarshalledObject java.rmi.activation.ActivationInstantiator.newInstance(java.rmi.activation.ActivationID,java.rmi.activation.ActivationDesc) throws java.rmi.activation.ActivationException,java.rmi.RemoteException]

    Could you have run your activation-setup program seven times on Linux? Clean out your $JAVA_HOME/bin/log directory and run the setup once, then try your client again.
    EJP

  • Java.rmi.activation.ActivateFailedException

    I get this error using Activation
    java.rmi.activation.ActivateFailedException: failed to activate object; nested exception is:
    java.rmi.activation.ActivationException: unable to create activation group; nested exception is:
    java.io.IOException: The pipe is being closed
    I haven't found an answer to this on the web, nobody seems to know. I must be doing something wrong, but I have no clue

    i had the same problem, i imagine that you find the solution even if you did'nt have an answer to your post,
    here is the output when i try to call a remote method:
    java.rmi.activation.ActivateFailedException: failed to activate object; nested exception is:
         java.rmi.activation.ActivationException: unable to create activation group; nested exception is:
         java.io.IOException: Le canal de communication est sur le point d'�tre ferm�
    please i need help....

  • RMI Activation Framework

    Hi folks,
    Just wondering about the required result when inactive(ActivationID id) is called. Should this kill the jvm associated with this Activatable process?? If not does anyone know how to kill the jvm but still make it available for reactivation? unregister removes it totally so that is not the solution.
    Any help would be great ... or tips on using this api.
    ciao
    Brian

    You wrote:
    Activatable.inactive() is best called inside anUnreferenced.unreferenced method.
    Me:
    I don't understand what you mean by this? Haven't used
    them before.The best way to deactivate an Activatable is for the client to just throw away the remote reference and for the server to call Activatable.inactive() inside its Unreferenced.unreferenced method. This way DGC takes care of all the required cleanup at the proper times. Deactivating in response to a client action, as you have it, has the problem that it generally occurs inside a remote method invocation, so the implied unexportObject(false) call inside inactive() will fail. If inactive() returns false this is the reason - it has failed to unexport and it has not tried to do anything else about deactivation. The server can queue the deactivation event to itself via some means like TimerTask to get round this.
    The situation where I call inactive is from the user
    command, which calls an Activatble Object to stop a
    process. When this process is stopped I call
    inactive(ActivationID id) on the Activatable Object
    (from inside the Activatable Object, does this
    matter?)No
    but nothing seems to happen to the jvm
    associated with the Activatable Object (as in it is
    still visible in the Process Manager), should it be
    killed when inactive is called?Did inactive() return true? If not, nothing happens as I described above and earlier in the thread. Otherwise it should exit as long as there are no other RMI servers running. If say you have non-Activatable servers running as well as the Activatable you've just deactivated, the JVM will hang round till they are all unexported. It will also persist if you have any other non-daemon threads running.
    EJP

  • Java.rmi.activation.UnknownGroupException when startet from JDeveloper

    I'm currently working on a project using the activation feature of java. But when I try to debug my program with JDev3.1 I get this UnknownGroupException. (If I choose "run" inside JDev. - same result). If I try the same from a DOS-Shell using Sun's JDK1.3 the program works fine.
    Do you have any suggestions how to make it work with JDeveloper (ojvm) ?
    null

    Hi,
    I think we need some more information on this. I'm not familiar with the activation features in Java.
    What are the results if you try from a DOS-Shell using OJVM?
    Also, what are the results if you put -classic in the Java VM Parameters field of the Run/Debug tab in the project properties dialog box and then run or debug? This will force JDev not to use OJVM.
    I'm wondering if this is a problem with OJVM, or a problem with how JDev launches programs for run or debug.
    Thanks,
    Liz

  • RMI Activatable (unable to obtain activation system)

    Hello, I am new to forum... I have a simple rmi activation program.. Before writing program,I have checked some books and example in the sun site...
    Before starting to program, I command "start rmiregistry" and
    rmid -J-Djava.security.policy=rmi.policy -J-Dsun.rmi.activation.execPolicy=none
    Up to here ,everything is Ok.
    However,when I started to Setup program .I got the error Unable to obtaion activation system....
    Following my codes:
    my remote object...package impl.server;
    import java.rmi.*;
    import araclass.Kitapcik;
    import araclass.Soru;
    public interface Sinav extends Remote{
         Kitapcik bilgileriGetir() throws RemoteException;
         String sorulariGetir(Soru soru) throws RemoteException;
    package impl.activate;
    import impl.server.Sinav;
    import java.rmi.*;
    import java.rmi.activation.*;
    import araclass.Kitapcik;
    import database.Database;
    import araclass.Soru;
    public class SinavYordam extends Activatable implements Sinav{
         Database data;
         public SinavYordam(ActivationID id,MarshalledObject data) throws RemoteException{
              super(id,0);
         public Kitapcik bilgileriGetir(){
              data=new Database();
              data.baglan();
              Kitapcik kitap=data.kitapcikGetir(2);
              data.kapat();
              return kitap;
         public String sorulariGetir(Soru soru){
              String sor="";
              data=new Database();
              data.baglan();
              sor=data.soruGetir("Soru_Getir", soru.soru_no, soru.tabloAdi);
              data.kapat();
              return sor;
         public String[] siklariGetir(Soru soru){
              String[] sik;
              data=new Database();
              data.baglan();
              sik=data.siklariGetir("Soru_Getir", soru.soru_no, soru.tabloAdi);
              data.kapat();
              return sik;
    }and lastly setup program,
    import impl.server.Sinav;
    import java.rmi.*;
    import java.rmi.activation.*;
    import java.util.Properties;
    import java.util.prefs.Preferences;
    public class SinavServer {
         public SinavServer(){
         public static void main(String[] args) throws Exception{
                   System.setSecurityManager(new RMISecurityManager());
         Properties prop=new Properties();
            prop.put("java.security.policy","/workspace1/SINAV");
               ActivationGroupDesc.CommandEnvironment  cmd=null;
               ActivationGroupDesc grpdesc=new ActivationGroupDesc(prop,cmd);
              ActivationGroupID id=ActivationGroup.getSystem().registerGroup(grpdesc);
              String location="file:/workspace1/SINAV";
              ActivationDesc desc=new ActivationDesc(id,"impl.activate.SinavYordam",location,null);
              Sinav sin=(Sinav)Activatable.register(desc);
              Naming.rebind("Sinav", sin);
    } Thanks in advance..

    Actually, I got two diffirent exception in an interesting order.. I mean one day I got the following the error;
    Exception in  thread "main"  java.Access.Security.ControlException: access denied <java.io.FilePermission \\c\workspace1\SINAV read>
    at java.security.AccessControlContext.checkPermissionthat goes on...
    The other day ,
    Unable to obtain activation system exception today I could not have got so far. If I got, I would post.
    So anyone who I have an idea of this problem...
    Thanks in advance...

  • I meet a RMI Exception ,Can you help me!!

    This is the main Method:
    public static void main(String[] args) throws IOException, ActivationException, NamingException, NotBoundException
              System.out.println("Construting activiton description...");
              Properties pro=new Properties();
              pro.put("java.security.policy", new File("server.policy").getCanonicalPath());
              ActivationGroupDesc groupDesc=new ActivationGroupDesc(pro,null);
              ActivationGroupID id=ActivationGroup.getSystem().registerGroup(groupDesc);
              MarshalledObject paPara1=new MarshalledObject("This book is for Student");
              MarshalledObject paPara2=new MarshalledObject("This book is for Teacher");
              ActivationDesc desc1=new ActivationDesc(id,"BookImpl","http://localhost/download/",paPara1);
              ActivationDesc desc2=new ActivationDesc(id,"BookImpl","http://localhost/download/",paPara2);
              Product pa1=(Product) Activatable.register(desc1);
              Product pa2=(Product) Activatable.register(desc2);
              Context context=new InitialContext();
              context.bind("rmi://product1", pa1);
              context.bind("rmi://product2", pa2);
    This is error Mesage:
    Exception in thread "main" java.rmi.activation.ActivationException: unable to obtain ActivationSystem; nested exception is:
         java.rmi.ConnectException: Connection refused to host: 125.220.9.55; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:453)
         at ProductActivtor.main(ProductActivtor.java:27)
    Caused by: java.rmi.ConnectException: Connection refused to host: 125.220.9.55; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         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:84)
         at java.rmi.activation.ActivationGroup.getSystem(ActivationGroup.java:449)
         ... 1 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:178)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
         ... 7 more
    Can you help me? Thank you very much!!

    start rmid
    Also you need to do something better with your activatable references than just bind them. You need to serialize them to a file so that you can restart the system without redoing the registration.

  • Raising new Exception within RMI server

    hi all,
    i implemented an RMI server which, in one of his method, throws my custom exception.
    Since my RMI server is loading classes dynamically, i grabbed all those exceptions that comes when a class cannot be loaded in an MyClassNotLoadedException
    in my code i write the following lined
    try {
    MyClass example = (MyClass)class.forName("MyClass").newInstance();
    } catch(Exception e) {
    throws new MyClassNotLoadedException(e);
    when i am running my test client, i always got the following exception:
    java.rmi.activation.ActivateFailedException: failed to activate object; nested e
    xception is:
    java.rmi.activation.ActivationException: group creation failed after 2 t
    ries; nested exception is:
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception
    is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.rmi.activation.ActivationException: group creation failed after 2 tries; ne
    sted exception is:
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception
    is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedExcep
    tion
    java.lang.ClassNotFoundException: com.nokia.jiacc.IACClassNotLoadedException
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
    RemoteCall.java:245)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
    220)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
    at sun.rmi.server.Activation$ActivatorImpl_Stub.activate(Unknown Source)
    at java.rmi.activation.ActivationID.activate(ActivationID.java:89)
    at sun.rmi.server.ActivatableRef.activate(ActivatableRef.java:250)
    at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:110)
    at com.nokia.jiacc.IACCPlugInImpl_Stub.callMeRemotely(Unknown Source)
    at com.nokia.jiacc.examples.Client.main(Client.java:52)
    If instead, in the catch statement i don't raise any exception, everything works fine.
    can anyone help me?? is it so that every exception that i raise in my RMI server must
    extends RemoteException??
    hope that someone can help me
    thanx in advance and regards
    marco

    Don't need to extends RemoteException. But have you defined your
    Exception that is implements Serializable?
    public class YourException extends Exception
                                 implements Serializable
    {...}Regards,
    Geri

  • RMI server object getting garbage collected

    Hi all,
    I have seen a number of posts regarding the ConnectException and found that this can occur in a number of situations.
    I am having a problem here.
    I am having an RMI server that is always up and running. And the server object gets requests from the client at regular intervals. But, when the server object is not receiving any requests for a long time (ex: 1 day), then I think the remote object itself is getting garbage collected. And so, tough I am able to get the remote reference using the lookup method, I am getting "Connection refused to host: 192.168.0.216; nested exception is:
         java.net.ConnectException: Connection refused" when I call a method using this reference.
    I believe that this is because the server object getting garbage collected as there are no requests for the server since long. Please correct me if my assumption is wrong.
    I want to know, after how much time the server object gets garbage collected if no requests are received. But, my requirement is that the server object should always be available and WHENEVER a client request comes then that should be processed. What should I do to accomplish this task.
    If any one have any suggestions, please reply as soon as possible.
    Thanks in advance,
    srik4u

    You might do some research into using an activatable remote object. You run rmid (the rmi activation deamon) and register a subclass of java.rmi.activation.Activatable (instead of the usual UnicastRemoteObject) with it. With an activatable object, the remote reference to the activatable object doesn't need to have a live object behind it. If an activatable object is not running (ie: it hasn't been constructed yet, or it has been garbage collected ...as in your case) a remote reference to the object can still be exported to a client. The first time the client calls a method on the remote object, the activation service on the server sees the object is not active, and activates the object for the client. If the object is running ...it is rmi as usual. But if it gets gc'd again, the next invocation on the remote object will trigger the activation service again.
    (The above explanation paraphrases author David Flanagan from Java Enterprise in a Nutshell, O'Reilly)
    I have only built one of these, which loosely followed an example from the above mentioned book. It's a whole other ballgame over and above a regular rmi object. But like anything else, if you dig in and get your head wrapped around it, it eventually makes sense. Ok, why lie ...it confused the hell out of me and left me a little queasy. But you know the drill, by the time you build a few of them it will probably seem as easy as mapping the human genome, right? At any rate, it seems like what you might be after ...so have a look at it. Good luck, and wear your lifejacket.

  • Remote activation exception

    Hi,
    I have an rmi server registered with the rmi registry for remote activation. I get the following error when activated.
    I started rmid in debug mode using the following command:
    rmid -port 9242 -log c:\temp\rmid.log -J-Djava.security.policy="c:\temp\java.policy" -J-Dsun.rmi.log.debug=true -J-Dsun.rmi.server.activation.debugExec=true -J-Dsun.rmi.dgc.logLevel=10 -J-Dsun.rmi.dgc.logLevel=10 -J-Dsun.rmi.loader.logLevel=10 -J-Djava.class.path=C:\\temp\\test1.jar;C:\\temp\\wasspi_jmx_JSpiCola.jar;C:\\temp\\wasspi_JSpiCola.jar;C:\\temp\\castor.jar;C:\\temp\\xalan.jar;C:\\temp\\xerces.jar;C:\\temp\\log4j-1.2.15.jar
    output:
    May 12, 2009 6:46:13 PM sun.rmi.server.LoaderHandler loadClass
    FINE: main: name = "sun.rmi.server.Activation$DefaultExecPolicy", codebase = ""
    log.debug: recover()
    log.debug: recovering from c:\temp\rmid.log\Snapshot.1
    May 12, 2009 6:46:13 PM sun.rmi.server.LoaderHandler loadClass
    FINE: main: name = "sun.rmi.server.Activation", codebase = ""
    May 12, 2009 6:46:13 PM sun.rmi.server.LoaderHandler loadClass
    FINE: main: name = "java.util.HashMap", codebase = ""
    log.debug: reading updates from c:\temp\rmid.log\Logfile.1
    log.debug: rdUpdate size 1436
    FINE: RMI TCP Connection(2)-15.154.106.14: name = "java.rmi.activation.ActivationID", codebase = ""
    May 12, 2009 6:46:20 PM sun.rmi.server.LoaderHandler loadClass
    FINE: RMI TCP Connection(2)-15.154.106.14: name = "java.rmi.server.UID", codebase = ""
    rmid: debugExec: running "C:\temp\JDK\bin\java.exe -Djava.class.path=C:\temp\test1.jar;C:\temp\w
    asspi_jmx_JSpiCola.jar;C:\temp\wasspi_JSpiCola.jar;C:\temp\castor.jar;C:\temp\xalan.jar;C:\temp\xerc
    es.jar;C:\temp\log4j-1.2.15.jar -Djava.security.policy=c:\temp\java.policy sun.rmi.server.Activation
    GroupInit"
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err:Exception in starting ActivationGroupInit:
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err:java.io.StreamCorruptedException: invalid streamheader
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:768)
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:283)
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err: at sun.rmi.server.MarshalInputStream.<init>(MarshalInputStream.java:122)
    Tue May 12 18:46:21 GMT+05:30 2009:ExecGroup-0:err: at sun.rmi.server.ActivationGroupInit.main(ActivationGroupInit.java:63)
    Here is the server class:
    collectorAndServerProps.put("java.security.policy", "c:\\temp\\java.policy");
    collectorAndServerProps.put("java.class.path", "C:\\temp\\test1.jar;C:\\temp\\wasspi_jmx_JSpiCola.jar;C:\\temp\\wasspi_JSpiCola.jar;C:\\temp\\castor.jar;C:\\temp\\xalan.jar;C:\\temp\\xerces.jar;C:\\temp\\log4j-1.2.15.jar");
    String javaCommand = "C:\\temp\\JDK\\bin\\java.exe";
    String srcURL = "file:///c:/temp/wasspi_jmx_JSpiCola.jar";
    ActivationGroupDesc.CommandEnvironment cmdEnv = new ActivationGroupDesc.CommandEnvironment(javaCommand, null);
    ActivationGroupDesc groupDesc = new ActivationGroupDesc(collectorAndServerProps, cmdEnv);
    ActivationGroupID groupID = ActivationGroup.getSystem().registerGroup(groupDesc);
    MarshalledObject args = new MarshalledObject(bindName);
    ActivationDesc desc = new ActivationDesc(groupID, "com.hp.openview.wasspi.collector.rmi.RemoteJSpiColaImpl", srcURL, args);
    RemoteJSpiCola jSpiColaStub = (RemoteJSpiCola) Activatable.register(desc);
    Registry reg = LocateRegistry.getRegistry(Integer.parseInt(rmidPort));
    reg.rebind(bindName, jSpiColaStub);
    RemoteJSpiCola remoteJSpiCola = (RemoteJSpiCola) Naming.lookup(url);
    remoteJSpiCola.getData(argv);
    Any clues?
    Thanks,
    Thiyagu

    Looks like rmid.log is corrupt.
    Your server class shouldn't do its own registration. That causes the rmid.log file to grow every time you start it. You should have a separate registration program that you only run once, and serializes the activatable stub to a file, and another program that runs every system startup that reads that file and binds the stub to the registry. That will conserve the size of the rmid.log file and also eliminate most writing to it, which is when corruption can occur.

  • Rmi SocketTimeoutException

    Hi,
    We�re using a RMI connection. In rare occasions, when the api calls that the rmi server performs take too much time, we get an UnmarshalException which wraps a SocketTimeOutException. It happens 60 seconds after the client sent request to the server, even though we set the socketTimeOut (through SocketFactory) to 3 minutes.
    Another side effect is that the whole Application (rmi client side) stuck.
    We think that it might have something to do with the rmi garbage collection, which by default happens every 60 seconds, so we set these parameters as well:
    -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.rmi.dgc.client.gcInterval=600000
    And just on the safe side set this parameter:
    -Dsun.rmi.activation.groupTimeout=600000
    But nothing seems to work. We still get the UnmarshalException, after 60 seconds.
    If you have a suggestion, or encountered the same problem, please advise.
    Thanks,
    Libby

    My rmi server performs API calls to a dll. For example, one of these API calls is connect to some remote server. Connect can take up to 5 minutes. So, obviously I don't want to get timeout exception after just 1 minute. Is there a way to avoid getting the exception, and letting the server still work?
    This is the SocketFactory I'm using:
    public class TimedRMIClientSocketFactory implements RMIClientSocketFactory,
                        Serializable {
              private static final long     serialVersionUID     = 7765561455399852985L;
              private Integer mTimeOut;
              public Integer getTimeOut() {
                        return mTimeOut;
              public void setTimeOut(Integer aTimeOut) {
                        mTimeOut = aTimeOut;
              public Socket createSocket(String host, int port) throws IOException {
                        Socket s = new Socket(host, port);
                        s.setSoTimeout(mTimeOut); //RMI-TODO change
                        return s;
    }And this is the thread that registers the server
              public void run() {
                        Registry registry = null;
                        String name = "PAWCJNIServer";
                        try {
                                  ObjectInputStream ois = new ObjectInputStream(System.in);
                                  MarshalledObject mo = (MarshalledObject) ois.readObject();
                                  IJNICommRMIClient ps = (IJNICommRMIClient) mo.get();
                                  pawcJNIServer = new JNICommRMIServer();
                                  TimedRMIClientSocketFactory mySocketFactory = new TimedRMIClientSocketFactory();
                                  mySocketFactory.setTimeOut(mTimeOut);
                                  UnicastRemoteObject.exportObject(pawcJNIServer, 0, mySocketFactory, RMISocketFactory.getDefaultSocketFactory());
                                  ps.registerServer(pawcJNIServer);
                                  lastQueryDate = new Date();
                                  while (true) {
                                            try {
                                                      Thread.sleep(mSleepTime); // check every minute
                                            catch (InterruptedException e) {
                                                      myLogger.log(Level.INFO, "RMIThread interrupted");
                                            myLogger.log(Level.FINER, "in rmi thread - woke up checking if should shutdown");
                                            if (System.currentTimeMillis() - lastQueryDate.getTime() > mTimeOutBeforeShutDownMyself) {
                                                      myLogger.log(Level.INFO, "in rmi thread - should shutdown");
                                                      break;
                                            else {
                                                      myLogger.log(Level.FINER, "in rmi thread - should not shutdown");
                                  clean(registry, name);
                                  myLogger.log(Level.INFO, "in rmi thread - finished clean, shut down now....");
                        catch (Exception e) {
                                  myLogger.log(Level.INFO, "RMI thread got exception", e);
                                  myLogger.log(Level.INFO, "in rmi thread - cleaning registry");
                                  clean(registry, name);
                                  myLogger.log(Level.INFO, "in rmi thread - finished clean, shut down now....");
    }Thanks,
    Libby

  • Java RMI or Servers

    I want to have a server process running on a Windows computer as long as the computer is on, but a user is not necessarily logged in. I don't want to have someone have to go physically to the computer, but I want this to run automatically. How can this be done? Is there something like a "cron" job (Unix) for Windows?
    Also, I want a Java process on Unix to connect to this Windows computer and run commands. How can the Windows process be sure that the authorized user is connecting to the environment? The thing is we are already inside a company within a firewall , protected from the outside world. However, within this project only 4-5 people should be able to run commands on the Windows computer, so how can I secure it in that manner?

    On the Page: Making a UnicastRemoteObject Activatable
    "This page is just for developers who wish to change an existing class from being a sub-class of UnicastRemoteObject to being a sub-class of java.rmi.activation.Activatable."
    But then the second paragraph:
    "Now with the introduction of the class java.rmi.activation.Activatable and the RMI daemon, rmid, programs can be written to register information about remote object implementations that should be created and execute "on demand," rather than running all the time. "
    The second paragraph states that Activatable is for running on demand and this page says this page is for changing the class to a sub-class of Activatable.
    I don't want something that can run on demand, I want it to run all the time.
    Also, I have never written an RMI program before. I know basic Socket's to do a server/client program that way but never done RMI so maybe I'm lost with this Activatable stuff.

  • Third Party RMI

    Hi,
    I'm currently using Sun's reference RMI implementation in a production
    application. However, I would like to move to WebLogic RMI to leverage
    the 'clusterability' that it provides. The problem that I see is that
    WebLogic's RMI implementation is incomplete, in that it doesn't
    support the RMI activation framework. Is anyone aware of a third-party
    RMI product(i.e. not Sun or WebLogic) that has the advantages of
    both:-
    * efficient connection multiplexing
    * clusterability
    * support for RMI activation
    Thanks in advance,
    David Lang

    [email protected] (David Lang) writes:
    I'm currently using Sun's reference RMI implementation in a production
    application. However, I would like to move to WebLogic RMI to leverage
    the 'clusterability' that it provides. The problem that I see is that
    WebLogic's RMI implementation is incomplete, in that it doesn't
    support the RMI activation framework. Is anyone aware of a third-party
    RMI product(i.e. not Sun or WebLogic) that has the advantages of
    both:-
    * efficient connection multiplexing
    * clusterability
    * support for RMI activationWLS 7.0 supports activation although it is not the same as the
    standard RMI activation. You can use activation in EJBs by changing a
    deployment descriptor property. I think that activation is now the
    default for SFSB.
    andy

Maybe you are looking for

  • ICal Imported Events Don't Appear in One Calendar

    Hi, I'm transferring data off my old Powerbook G4 with OS 10.4.11 to my new Macbook Pro with Lion 10.7.3, and I'm having a problem with importing iCal data. When I did an iCal database backup import, 8 out of my 9 calendars seemed to be coming throug

  • Returning a whole vector

    I want to print out the objects in vector from a class called repeat in a class called output. Should I have a get method in repeat.Then in my output class have a repeat variable called repeat then say repeat.getVector and then print the items in the

  • Hierarchy dashboard prompt

    In the OBIEE 11.1.1.6, I make use of default RPD named 'SampleAppLite.rpd', and I created dashboard prompt for 'Product Hierarchy', however, in the request, there is no hierarchy, only has some columns, such as 'Brand','LOD' My issue is that the crea

  • Unable to log into SA540 as any user

    This is the 2nd time that this has happened. I am unable to log in my SA540 as any user including the Admin either through the SSL VPN portal or directly connected to the box. The fix is to reboot the device and it starts working but I as I am not on

  • Est-ce que l'autonomie de ma batterie diminuera si j'utilise mon iPad comme réveil-matin ?

    Bonjour à tous, Je voulais savoir si, parce que j'utilise mon iPad comme réveil-matin(pour d'autre chose aussi, évidement...), cela pouvait, à long terme, affecter l'autonomie de ma batterie. Je précise qu'il est branché toute la nuit, et on m'avait