Simple RMI/IIOP app : "no security manager: RMI class loader disabled"

Hello colleagues!
I do not understand the problem at all, and asking for your kind help.
This is my first code for RMI/IIOP. We are using JBoss as application server.
What I've done :
1) created test.Command interface , extending Remote
2) created test.CommandImpl , implementing above mentioned interface and java.io.Serializable, and extending javax.rmi.PortableRemoteObject.
BTW, Serializable is not implemented in some tutorials, but absence of Serializable causes NotSerializableException when trying to rebind (next step).
3) in server code, created initial context and called
context.rebind("test/Command",new CommandImpl());
4) Ran rmic -iiop test.CommandImpl . A result was two new cass files, CommandImplTie.class and CommandStub.class , both are also in package "test".
5) Created remote client and put CommandStub.class to client
classpath (under package "test", too).
6) In client code, initialized the context and called
context.lookup("test/Command").
On this line (lookup), the following exception is being raised :
javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: test.CommandImpl (no security manager: RMI class loader disabled)
     at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:368)
     at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:161)
     at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
     at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
     at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
     at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
     at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
     at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
     at javax.naming.InitialContext.lookup(InitialContext.java:347)
Is _Stub class all that client needs from server classes, to obtain
the reference ? I tried to put _Tie also to client, but with the same result.
All Jndi paths to JBoss server are correct, as I've used them successfully in other applications.
Many thanks in advance,
Daniel

Next few words to the topic.
I made tests with canonical RMI/IIOP tutorial from Sun.
When I use Sun's ORB (orbd.exe) , everything work fine. I started
orbd on the same PC as JBoss, and client and server are running
remotely.
But with JBoss ORB, I have the same exception as described above.
Server starts and registers in JNDI successfully, but client can not
obtain a remote reference. Exception is being thrown on
context.lookup().
So the difference is definitely in security managers for two ORBs.
I also tried to create new RMISecurityMananger and set it, but with
no effect.
Any ideas ?
TIA,
Daniel.

Similar Messages

  • No security manager: RMI class loader disabled

    i tried to add a filter to my client jmx
    my filter is:
    class Filter implements NotificationFilter {
    public boolean isNotificationEnabled(Notification n) {
              return (n.getType().equals("example.user.remove"))
              ? true
              : false;
    in my client i use:
    Filter filter=new Filter();
    Listener listener=new Listener();
    mbeanServer.addNotificationListener(mbeanName, listener, filter, null);
    if i dont put the filter(if i use null) my client works but when i include the filter I have this error:
    java.rmi.UnmarshalException: java.lang.ClassNotFoundException: Filter (no security manager: RMI class loader disabled); nested exception is:
         java.lang.ClassNotFoundException: Filter (no security manager: RMI class loader disabled)
    what is wrong?

    You need to make sure that Filter.class is on your classpath, either directly as the .class file or in a JAR file that is on the classpath.

  • No security manager: RMI class loader disabled Error at RMI client programm

    Got following error on invoking remote method from RMI client,
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.rmi.RmiImpl_Stub (no security manager: RMI class loader disabled)
    Please let me know solution.

    Hello JAAZ,
    I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
    I think debugging RMI-applications is not as easy as "normal" applications ..
    maybe this helps..
    Regards
    tk

  • ERROR: RMI Class loader disabled

    Despite of setting classpath, policy tool I am getting following error. What does the error mean and What is the solution?
    E:\Javaprog\RMI>java MultiplyServerImpl
    Server could not start java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: MultiplyServerImpl_Stub (no security manager: RMI class loader disabled)

    Hello JAAZ,
    I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
    I think debugging RMI-applications is not as easy as "normal" applications ..
    maybe this helps..
    Regards
    tk

  • Rmi with security manager not working in netbeans

    Hello i'm trying to use rmi but get the error java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve) when i run it in netbeans. here is my code
    public static void main(String[] args) {
            if (System.getSecurityManager() == null) {
                System.setSecurityManager(new SecurityManager());
            try {
                String name = "Compute";
                Compute engine = new ComputeEngine();
                Compute stub =
                    (Compute) UnicastRemoteObject.exportObject(engine, 0);
                Registry registry = LocateRegistry.getRegistry();
                registry.rebind(name, stub);
                System.out.println("ComputeEngine bound");
            } catch (Exception e) {
                System.err.println("ComputeEngine exception:");
                e.printStackTrace();
        }It works if i don't have a security manager and it works with a security manager if i don't use netbeans to run it and use the command line. i need to use a secuirty manager because the client code is running in eclipse and it moans that there is no security manager if i run it without one
    this is the error i get when running with no security manager
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
         java.lang.ClassNotFoundException: takenoteremote.Compute (no security manager: RMI class loader disabled)
    Please help

    I have sort of got it to work, i took out the security manager and used the code base parameter on the command line, and put my interface into a jar file. I can only get it to work though on the command line, if i run it in netbeans it doesn't find the class in the jar file it needs.
    Any ideas?

  • Tomcat50-jwsdp Security Manager and RMI

    I need to know how to configure the Tomcat 5.0 security manager to run RMI applications.
    I'm building a jax-rpc application that uses RMI to access a back-end process.
    I cannot run RMI because no security manager is running:
    java.rmi.RemoteException: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: wxservice.remote.WebService$Listener (no security manager: RMI class loader disabled); nested exception is:
         java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: wxservice.remote.WebService$Listener (no security manager: RMI class loader disabled)However, when I try to enable security using the command
    C:\tomcat50-jwsdp\bin\catalina.bat run -securityI get the following exception:
    java.security.AccessControlException: access denied (java.util.PropertyPermission org.apache.commons.launcher.waitForChild read)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
            at java.security.AccessController.checkPermission(AccessController.java:427)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
            at java.lang.System.getProperty(System.java:627)
            at org.apache.commons.launcher.ChildMain.run(ChildMain.java:199)Any help would be sincerely appreciated.

    First of all, you don't have to use RMISecurityManager as the security manager at all. It's a legacy class from Java 1.1. times that the RMI tutorials continue to refer to, see this thread:
    http://forum.java.sun.com/thread.jsp?forum=58&thread=161874
    Secondly, it is tricky but Java 2 allows a security manager to be set more than once -- it all depends on whether the currently installed manager allows to be replaced [RuntimePermission("setSecurityManager") permission].
    Finally, if you expect that the user will define a security policy through command line, all you have to do is code something like this:
    if (System.getSecurityManager() == null)
       System.setSecurityManager(your_security_manager);to set yours only when nothing was set on the command line.
    Vlad.

  • When we use RMI-IIOP?

    Dear,
    Can anyone tell me when we use RMI-IIOP? When we use RMI-IIOP and
    EJB? When will use JSP? When will use servlet?
    Sorry for that silly question, but i really want to know it?
    kurt

    As I know, If using RMI-IIOP, we have to handle lots of stuffs like
    connection pool, security...etc.
    Am I right?
    Kurt
    Tom Barnes <[email protected]> wrote in message
    news:[email protected]..
    >
    >
    Andy Piper wrote:
    RMI-IIOP is useful for:
    a) Interop, i.e. between different appservers
    b) C++ client integration
    Customers also sometimes want it because they have security
    restrictions on what protocols they can put through a firewall.
    It is also useful for light-weight Java clients. RMI-IIOP clients need
    not use the (large) weblogic.jar jar.
    Tom

  • RMI/IIOP and WTC

    The web docs talk about modifying RMI/IIOP applications to use WTC.
    Just need a confirmation that RMI/IIOP calls to EJBs in WLS will not be
    transactional. That XA transactions will require the ATMI interface to
    Tuxedo EJBs. (Beta in WLS 6.1)

    Carl,
    I for one would be interested to hear how you are using the Tuxedo/WTC (I
    assume you mean Java ATMI) in your application. We need some feedback here
    in development land so that we can see which things you like about jATMI and
    which things you like less...
    Of course, anyone using jATMI can reply as well...
    John Wells (Aziz)
    [email protected]
    [email protected]
    "Carl Lawstuen" <[email protected]> wrote in message
    news:3bba357d$[email protected]..
    Thanks for the clarification. While we will need to support CORBA style
    access at some time, the Tuxedo/WTC interface fits nicely in our current
    legacy to WLS architecture.
    "Andy Piper" <[email protected]> wrote in message
    news:[email protected]..
    "Carl Lawstuen" <[email protected]> writes:
    Yes, the ATMI interface to WTC should be transactional.
    But I would assume that RMI/IIOP applications that uses WTC for access
    to
    WLS naming service would not be transactional due to limitations in
    the
    RMI/IIOP specification regarding transactions.
    Just looking for confirmation that BEA has not done anything to make
    RMI/IIOP calls into WLS transactional.RMI-IIOP calls over wtc (i.e. RMI-TGIOP) are transactional and
    secure. RMI-IIOP calls over vanilla IIOP are not transactional, but
    can be secure. OTS support is coming in Acadia.
    RMI-IIOP over wtc totally leverages the ATMI support so you get all
    the same features + CORBA-style access. The RMI-IIOP spec is fairly
    irrelevant in this instance since we do not have to to support
    interoperable transactions to support transaction propagation from Tux
    over WTC. That's kind of the whole point - the specs have their rough
    edges when it comes to defining transactions and security over IIOP
    but we give you exactly what you want (transactions and security)
    using the internal tux domains protocol.
    andy

  • How to get InitialContextFactory using RMI/IIOP without using weblogic.jar

    Hi Robert
    I know this is an old post. but I am interested in knowing how to get the
    initial context using RMI/IIOP without the use weblogic specific classes
    like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
    you can provide as an example, it would be just great.
    thanx in advance
    Daya Sharma
    See comments inline...
    Stewart Wachs wrote:
    I would like to get an initial context to Weblogic JNDI from a client.
    code snippet:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFacorty");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    Context ctx = new InitialContext(ht);
    catch(...) {
    This works fine when I include weblogic.jar (and other dependend weblogic
    jar's) in the classpath.
    Is there a way to access WL JNDI from a client without the weblogicclasses
    in the classpath?If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
    the
    answer is no, you will need at least some of the weblogic classes on the
    client.
    If not, is there a lightweight jar available for distribution for client
    JNDI connectivity?This is something in the works. In addition, a colleague and I are working
    on
    a white paper that describes the "Thin Client Options with WebLogic Server"
    that we hope to make available in the not too distant future...
    Are there any licencing issues with distributing the weblogic classes to
    clients that need to access WL JNDI?No. WLS is licensed by the server so you are free to distribute
    weblogic.jar
    to your clients.
    Hope this helps,
    Robert

    Take a look at the RMI/IIOP section of our whitepaper "Small Footprint
    Client options for BEA WebLogic Server" at:
    http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
    Daya Sharma wrote:
    Hi Robert
    I know this is an old post. but I am interested in knowing how to get the
    initial context using RMI/IIOP without the use weblogic specific classes
    like weblogic.jndi.WLInitialContextFactory . If you have a code snippet that
    you can provide as an example, it would be just great.
    thanx in advance
    Daya Sharma
    See comments inline...
    Stewart Wachs wrote:
    I would like to get an initial context to Weblogic JNDI from a client.
    code snippet:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFacorty");
    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    Context ctx = new InitialContext(ht);
    catch(...) {
    This works fine when I include weblogic.jar (and other dependend weblogic
    jar's) in the classpath.
    Is there a way to access WL JNDI from a client without the weblogic
    classes
    in the classpath?
    If you are using WLS 6.1, you could use RMI/IIOP to do this but in general,
    the
    answer is no, you will need at least some of the weblogic classes on the
    client.
    If not, is there a lightweight jar available for distribution for client
    JNDI connectivity?
    This is something in the works. In addition, a colleague and I are working
    on
    a white paper that describes the "Thin Client Options with WebLogic Server"
    that we hope to make available in the not too distant future...
    Are there any licencing issues with distributing the weblogic classes to
    clients that need to access WL JNDI?
    No. WLS is licensed by the server so you are free to distribute
    weblogic.jar
    to your clients.
    Hope this helps,
    Robert

  • Binding RMI-IIOP Remote Object in RMI Registry through JNDI

    hi friends
    I am writing RMI-IIOP Remote Object, both server program, and client program
    are java programs. Through JNDI (with cosnaming name service), my program is working.
    But what i want is, I want to use JNDI (with rmi registry name service) for my RMI-IIOP Remote Object ( and not RMI -JRMP Remote Object). Both my server
    program and client programs are java(and not corba)
    I am not getting this, while starting server its showing some error
    Is it not possible to bind rmi-iiop remote object in rmi registry through jndi, why

    because you are supposed to use the COSNaming service with IIOP. Even if you could bind an IIOP remote object into an RMIRegistry the clients wouldn't be able to use it because the RMI Registry doesn't do the extra processing that the COSNaming service does with IIOP references.

  • RMI Dynamic Class Loading

    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:
    No Security Manager: RMI Class Loader disabled"...
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying to

    I'll try having a crack at this, see inline comments
    Chirag Shah wrote:
    Hello,
    I have a standalone Java Client which is connecting to an RMI based svr component on WLS 6.0sp1. However, before connecting to the RMI Svr, I am trying to boot strap couple of other CLASS files from the App Svr. using the RMIClassLoader. Now here's the problem...
    I have placed my classes( one which I want to download and instantiate before I start making conventional calls to RMI Svr remote methods) in the folder WL_HOME/config/examples/rmi/*.class
    which is the code_base url I use. However, the error I get when trying to download the classs using RMIClass loader is:I'll assume that you're using a proper URL (file://) to instanciate your ClassLoader.
    >
    No Security Manager: RMI Class Loader disabled"...
    Does your client explicitly set a SecurityManager using the following command?
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new java.rmi.RMISecurityManager());
    Also,I believe that it should only be your client changing its policy file (for the network classload).
    >
    due to which I can not even get connected to my remote object after that. Can somebody please tell me how can I set whatever option it is so that I can get this thing working.
    I tried using the "Grant all" security policy too on the client side & server side in vain.
    Any help is truly appreciated. Thanks a lot!
    cl I am trying toHope it helps,
    Stephane Vaucher
    CIRANO
    Research Professional

  • Dynamic Class Loading (RMI)

    Hi,
    i have my rmi server, implementing objects,stubs and skeleton classes deployed in my Tomcat server and they are stored under the tomcat root folder.
    In anoather jvm iam trying to load the classes thru the below code.
    java -Djava.rmi.server.codebase=http://ssd8/tomcat-3.2.4/install_dir/webapps/ROOT/WEB-INF/rmicode stockMarketClient
    ssd8 is the hostname(machine) which contains all my rmi server files.
    and stockmarketclient is my rmi client.
    Iam getting the java.lang.noclassdeffound error.
    what may be the problem???
    Should i have the security policy file in the client machine.

    Please Do tell me if any of the following worked I'll be greatly obliged
    1) Try this
    java -Djava.rmi.server.codebase=http://servername/dir1/dir2/ RMIServer
    This / thing at the end of the URL is very important
    2) This is how I did it just Today
    Dynamic Class Loading Using RMI
         Server Side
    1) Main Interface
    2) Implementing Class
    3) Stub & Skel                    (RMI Server & Web Server)
    4) All Other Classes used by the Server
         Web Server Side
    1) Main Interface
    2) Stub & Skel                    (RMI Server & Web Server)
    3) All Other Classes (not Main Client Class)
         Client Side
    1) Main Interface
    2) Main Client Class
    3) Stubs
    4) Security Manager
         RUNNING
    SERVER
         java DataServerImpl
    CLIENT
         java DataClient xyz
    Note
    Make Calls as follows
    System.setSecurityManager(new LaxSecurityManager());
    DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
    Runnable r = (Runnable)server.getNewClass();
    r.run();
    DON'T make Calls as follows
    System.setSecurityManager(new LaxSecurityManager());
    DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
    NewClass obj = server.getNewClass();
    obj.run();
    if done as above provide the Class NewClass to the Client as well ( whole purpose defeated)
    Code
         // SecurityManager
    import java.rmi.*;
    import java.security.*;
    public class LaxSecurityManager extends RMISecurityManager
         // All Checks are routed through this method
         public void checkPermission(Permission p)
              // do nothing
         // Main Interface
    import java.rmi.*;
    public interface DataServer extends Remote
         public boolean login(String usr_name,char[] pass_wrd) throws RemoteException;
         public Object getNewClass() throws RemoteException;
         // Main Server
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    public class DataServerImpl /*extends UnicastRemoteObject*/ implements DataServer
         static
              try
                   LocateRegistry.createRegistry(1099);
              catch(Exception e)
                   System.err.println("Static " + e);
         public boolean login(String usr_name,char[] pass_wd) throws RemoteException
              System.out.println("Welcome " + usr_name);
              if( pass_wd == null || pass_wd.length == 0 || pass_wd.length > 10 )
                   return false;
              return true;
         public Object getNewClass() throws RemoteException
              System.out.println("Returning New Class");
              return new NewClass();
         public DataServerImpl() throws RemoteException
              try
                   System.setProperty("java.rmi.server.codebase","http://localhost:8080/");
                   UnicastRemoteObject.exportObject(this);
                   Naming.rebind("DataServer",this);
              catch(java.net.MalformedURLException e)
                   System.err.println("DataServerImpl " + e);
                   return;
              System.out.println("Server Registered");
         public static void main(String[] args) throws Exception
              new DataServerImpl();
         // Class Moving Around the Network
    public class NewClass implements java.io.Serializable,Runnable
         int num;
         public void run()
              System.out.println("Start the Server with Number = " + num);
         public NewClass()
              num = (int)(Math.random()*1000);
         public String toString()
              return num + "";
         // Client
    import java.rmi.*;
    public class DataClient
         public static void main(String[] args) throws Exception
              System.setSecurityManager(new LaxSecurityManager());
              String pass = new String();
              if(args.length == 0)
                   System.err.println("usage: java DataClient PassWord");
                   System.exit(1);
              else
                   pass = args[0];
              DataServer server = (DataServer) Naming.lookup("rmi://localhost:1099/DataServer");
              Runnable r = (Runnable)server.getNewClass();
              r.run();
    All the Best

  • Security Issues with Dynamic Loading

    Hi,
    I am trying to run a simple RMI example that uses dynamic class loading but I am hitting a problem I cannot get around - can anyone help?
    The problem I am getting is that when I run my client program I get the exception listed at the bottom of my post.
    I have the following in my server class called WarehouseServer:
       System.setProperty("java.security.policy", "server.policy"); 
       System.setSecurityManager(new SecurityManager());  I have the a server.policy file located in the same folder as my server class:
        grant {   
            permission java.security.AllPermission "", "";   
        };   I run my server using the following command:
    *{noformat}java -Djava.rmi.server.codebase=http://localhost:8080/ WarehouseServer{noformat}*
    I have also tried running the server using this command:
    *{noformat}java -Djava.rmi.server.codebase=http://localhost:8080/ -Djava.security.policy=server.policy WarehouseServer{noformat}*
    But on both occasions I get the same exception when running my client program.
    Any idea?
    Cheers,
    Sean.
    =====================================================================
    Exception in thread "main" java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: Book (no security manager: RMI class loader disabled)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:178)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
    at $Proxy0.getProduct(Unknown Source)
    at WarehouseClient.main(WarehouseClient.java:32)
    Caused by: java.lang.ClassNotFoundException: Book (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
    ... 4 more

    Thanks EJB. You are correct! I only had the security manager and policy set up in the server; I didn't have it set up in the client. God these RMI errors can be obscure at times.
    For anyone else that may come across it this. I was following an example from this chapter 10 of this book [url http://www.amazon.com/Core-Java-Vol-Advanced-Features/dp/0132354799/ref=sr_1_1?s=books&ie=UTF8&qid=1299739763&sr=1-1]Core Java, Vol. 2: Advanced Features, 8th Edition . The example outlines setting up the security manager and policy in the server, but fails to mention that you also need to set this up in the client.
    When you download the code associated with the book from the [url http://www.horstmann.com/corejava.html]website , you'll see that both the client and server have the security manager and policy set up.
    I actually removed the security manager and policy from the server, I left the security manager and policy in the client, and everything worked fine!

  • Rmi-iiop: calling secured method on Ejb -- NO PERMISSION Exception

    In WL6.1, I have an Ejb with secured methods. The (Swing) client application accesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was supplied in the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.
    Using the t3 protocol the program works fine, but that would require the 25Mb weblogic.jar on all clients, which is unattainable for us.
    Any ideas how this situation can be corrected?
    -Allard Siemelink

    Hi Allard,
    Please pose this in the weblogic.developer.interest.rmi-iiop.
    Thanks,
    Allard Siemelink wrote:
    In WL6.1, I have an Ejb with secured methods. The (Swing) client application accesses the Ejb through rmi-iiop using the JDK1.3.1 Orb.
    Unfortunately, it seems that the caller identity (which was supplied in the InitialContext lookup) is not propagated
    to the server: any call to a secured method
    fails with a CORBA NO_PERMISSION Exception.
    Using the t3 protocol the program works fine, but that would require the 25Mb weblogic.jar on all clients, which is unattainable for us.
    Any ideas how this situation can be corrected?
    -Allard Siemelink--
    Apurb Kumar
    Developer Relations Engineer
    BEA Support

  • Security Manager and RMI

    I am developping an application that uses RMI.
    So in the code i must declare the RMISecurityManager as the security manager. But if the user specify the standard security manager on the command line it dont works.
    I understand why, because my question is :
    How the user can ensure that my application is safe if he cannot specify the basic security manager on the comnd line ( -Djava.security.manager ) ?
    tom

    First of all, you don't have to use RMISecurityManager as the security manager at all. It's a legacy class from Java 1.1. times that the RMI tutorials continue to refer to, see this thread:
    http://forum.java.sun.com/thread.jsp?forum=58&thread=161874
    Secondly, it is tricky but Java 2 allows a security manager to be set more than once -- it all depends on whether the currently installed manager allows to be replaced [RuntimePermission("setSecurityManager") permission].
    Finally, if you expect that the user will define a security policy through command line, all you have to do is code something like this:
    if (System.getSecurityManager() == null)
       System.setSecurityManager(your_security_manager);to set yours only when nothing was set on the command line.
    Vlad.

Maybe you are looking for