2 Replies Latest reply on May 20, 2003 2:25 PM by lycheel

    Connect to MEJB problem

    jxtang

      I modified one of the examples in Administration & Development Manual to connect tom the MEJB in my JBoss server with version 3.0.6. The relevant code snippet is as

      InitialContext ic = new InitialContext();
      Object ref = ic.lookup( "ejb/mgmt/MEJB" );

      ManagementHome home = (ManagementHome)PortableRemoteObject.narrow( ref, ManagementHome.class );
      Management mejb = home.create();


      However, I got the following exception:

      [java] javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.management.mejb.MEJB (no security manager: RMI class loader disabled)

      [java] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:368)

      [java] at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:159)

      [java] at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)

      .....

      I do not know how security manager play here. Do I miss any jar file in the build.xml? Is there anything needs to be done in the Jboss server configuration? Thanks in advance!

        • 1. Re: Connect to MEJB problem
          jxtang

          One of the solution is to add the server/default/deploy/ejb-management.jar into the build.xml. As the JNDI lookup operation returns a valid object, it needs certain classes and description files to load the proxy.

          Any better solution or comments are welcome.

          • 2. Re: Connect to MEJB problem
            lycheel

            Hi,

            Did you get MEJB to work? May I benefit from your experience?

            What I'm trying to do is similar to what you did except
            that I need to display in jsp pages. So I tried to put
            a java block in a jsp page like below:

            InitialContext ic = new InitialContext();
            Object ref = ic.lookup( "ejb/mgmt/MEJB" );

            ManagementHome home = (ManagementHome)PortableRemoteObject.narrow( ref, ManagementHome.class );
            Management mejb = home.create();


            but when accessing the jsp page, it complains about
            a bunch of ClassNotFoundException. How are running
            the example? Which 'Administration & Development Manual' you used?

            Thanks.