0 Replies Latest reply on Aug 17, 2005 12:32 PM by robert.e.morgan

    Creating an ebj3 client inside an eclipse plugin

    robert.e.morgan

      Hi everyone,
      i'm trying to build an eclipse plugin to act as a client to my ejb3 server application. i have used the code from the applet example to successfully connect to the server from a standalone application, however when trying to use that same code inside a basic eclipse plugin i get a class not found exception. does anyone have a tutorial or an example that i could follow on how to connect to the server from inside an eclipse plugin.

      the code that i'm using to connec is:
      Client project (inside my plugin code):

       try {
       Context context = new InitialContext();
       System.out.println("This is the test "+HelloWorld.class.getName());
       HelloWorld hw = (HelloWorld) context.lookup(HelloWorld.class.getName());
      
       hw.sayHello();
      
       } catch (Exception e) {
       e.printStackTrace();
       }
      


      Server Project:
      helloWorld.java
      package hello;
      
      import javax.ejb.Remote;
      
      @Remote
      public interface HelloWorld {
       public void sayHello();
      }

      helloWorldBean.java
      package hello;
      
      import javax.ejb.Stateless;
      
      
      public @Stateless class HelloWorldBean implements HelloWorld {
       public void sayHello() {
       System.out.println("Hello EJB3 World !!!! ");
       }
      }
      


      the above client code placed inside a simple main works exactly as i want but fails when placed inside the plugin. I was told that this could be caused by the thread classloader. i'm still learning about ejb3 and eclipse plugins so any help that you could provide or links to examples/tutorials would be greatly appreciated.

      thanks in advance
      Robert