1 Reply Latest reply on Oct 15, 2002 9:53 PM by adrian.brock

    Run template from different node?

    siegfried1

      How do I modify the client in the template directory of the quickstart to run from something other than local host? Where can I specify an IP node? As I recal, the lookup method's parameter is vendor specific.

      siegfried


      Here is the source code:

      /*
      * JBoss, the OpenSource J2EE webOS
      *
      * Distributable under LGPL license.
      * See terms of license at gnu.org.
      */
      package test.client;

      import javax.naming.InitialContext;
      import javax.rmi.PortableRemoteObject;

      import test.interfaces.TestSession;
      import test.interfaces.TestSessionHome;

      public class TestClient {

      public static void main(String[] args){
      try {
      InitialContext lContext = new InitialContext();

      TestSessionHome lHome = (TestSessionHome) lContext.lookup( "ejb/test/TestSession" );
      TestSession lSession = lHome.create();
      // Get a new Id of the Test Entity
      int lId = lSession.getNewEntityId();
      System.out.println( "New Entity Id is: " + lId );

      lSession.remove();
      } catch( Exception e ){
      e.printStackTrace();
      }
      }

      }