8 Replies Latest reply on Aug 23, 2002 1:55 PM by toni


    toni Newbie

      Hello when I try to run the test client I get:

      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled)]

      what causes this??

        • 1. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
          Joel Vogt Master

          A client will need the jar files from jboss/client and will also need a jndi.properties or you will have to set up the initial context given a hashset of your own properties

          • 2. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
            toni Newbie

            ok thaks but

            how do i load the jndi.properties is it just included in the classpath i tried something like:

            java -classpath CMPtest.jar:concurrent.jar:jaas.jar:jboss-j2ee.jar:jboss-jmx.jar:jbossmq-client.jar:jbosssx-client.jar:jnp-client.jar:jndi.properties:/home/tonik/jboss-client/ test

            but now I get this

            java.io.FileNotFoundException: /home/tonik/config/security.properties (No such file or directory)

            I dont understand why it is trying to locate a security.properties file in that directory. And is that a standard java security file or what.

            • 3. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
              Juha Lindfors Master

              you need a remote interface on the client -- local interfaces work only within the server VM.

              • 4. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
                toni Newbie

                I am actually running the test client on the same server.

                Hmm I wonder what this is , as this is not my own server ip number

                java.security.AccessControlException: access denied (java.net.SocketPermission connect,accept,resolve)

                and how do i add the jndi.properties into the test client

                this is what the default jndi.properties looks like in /jboss/server/default/conf

                # Do NOT uncomment this line as it causes in VM calls to go over
                # RMI!
                # java.naming.provider.url=localhost



                • 5. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
                  toni Newbie

                  * test.java
                  * Created on 18 August 2002, 22:43

                  import javax.naming.InitialContext;
                  import javax.rmi.PortableRemoteObject;
                  import net.tonik.*;
                  import java.rmi.RMISecurityManager;

                  * @author tonik
                  public class test {

                  /** Creates a new instance of test */
                  public test() { }

                  /** This simple application tests the 'Interest' Enterprise JavaBean whi
                  ch is
                  implemented in the package 'org.jboss.docs.interest'. For this to work, the
                  Bean must be deployed on an EJB server.

                  /** This method does all the work. It creates an instance of the Interest EJB
                  the EJB server, and calls its `calculateCompoundInterest()' method, then pri
                  the result of the calculation.
                  public static void main(String[] args)
                  // Enclosing the whole process in a single `try' block is not an ideal way
                  // to do exception handling, but I don't want to clutter the program up
                  // with catch blocks

                  // System.setProperty("java.naming.factory.initial",
                  // "org.jnp.interfaces.NamingContextFactory");
                  // System.setProperty("java.naming.provider.url",
                  // "localhost:1099");
                  // if(System.getSecurityManager() == null) {
                  // System.setSecurityManager(new RMISecurityManager());
                  // }

                  // Get a naming context
                  InitialContext jndiContext = new InitialContext();
                  System.out.println("Got context");

                  // Get a reference to the Interest Bean
                  System.out.println("Going for the reference");

                  Object ref = jndiContext.lookup("/test/CMPEntity");

                  System.out.println("Got reference");

                  // Get a reference from this to the Bean's Home interface
                  CMPEntityHome home = (CMPEntityHome)
                  PortableRemoteObject.narrow(ref, CMPEntityHome.class);

                  // Create an Interest object from the Home interface
                  CMPEntity cmpentityhome = home.create("1","tonik","tonik","tonik");

                  // call the calculateCompoundInterest() method to do the calculation

                  catch(Exception e)

                  • 6. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
                    toni Newbie

                    that was what my client looks like (previous message)

                    it never gets past this:
                    Object ref = jndiContext.lookup("/test/CMPEntity");


                    • 7. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
                      Adrian Brock Master

                      As Juha said above, you can only access an EJBLocalHome
                      from inside the same java virtual machine (JVM).

                      If you do something like "java TestClient" you are
                      starting a new JVM.

                      To access the entity from a different JVM you need
                      a remote interface.


                      • 8. Re: org.jboss.ejb.plugins.local.LocalHomeProxy
                        toni Newbie

                        ok thanks will try that then I assumed it was one virtual machine per java installation