0 Replies Latest reply on Apr 18, 2007 11:37 PM by prashanth kodoth

    sample hello world application

    prashanth kodoth Newbie

      I am a beginner. I want to start with a hello world application.
      at this point i made the following :
      a>business interface
      b>bean
      c>test client


      a>firstInterface.java

      package server;

      import javax.ejb.Remote;

      @Remote
      public interface firstInterface
      {
      public String hello();

      }

      b>firstBean.java

      package server;

      import javax.ejb.Remote;
      import javax.ejb.Stateless;

      @ Stateless
      @ Remote(firstInterface.class)
      public class firstBean implements firstInterface
      {

      public String hello()
      {
      System.out.println("hello()");
      return "hello world !";
      }
      }


      c>firstTestClient.java

      package client;

      import javax.naming.Context;
      import javax.naming.InitialContext;
      import server.firstInterface;

      public class firstTestClient {

      /**
      * @param args
      * @throws Exception
      */
      public static void main(String[] args) throws Exception
      {
      // TODO Auto-generated method stub
      Context ctx = new InitialContext();

      firstInterface fInterface = (firstInterface) ctx.lookup("server/firstInterface");
      System.out.println(fInterface.hello());
      }

      }



      i have no idea as what to do further. I do not know the flow. for instance what all xml files do i need to generate and esentially how do i deploy the bean.

      i realy appreciate if you guys could help me out.

      thank you.