7 Replies Latest reply on Jul 24, 2008 11:01 PM by Mike Kuul

    How to use a seam component in an other one?

    Mike Kuul Newbie

      Hi guys!


      I know that this a newbie question but I just can't make it work after reading and trying all day.
      I want to use a simple component in an other one.
      First I have this class:

      @Stateless
      @Name("ProcessManager")
      @Startup
      @Scope(ScopeType.APPLICATION)
      public class ProcessManager implements ProcessManagerInterface{
           
                public void dosth(){
                     System.out.println("=====Hello World=====");
                      }
      }


      Then I have this interface:
      public interface ProcessManagerInterface {  
          
           public void dosth();     
           
      }

      Finally I have this test class:
      @Name("testing")
      public class Test {
           
           @In(required=false)
           ProcessManagerInterface processManager;
           
           public void dosth() {
                processManager.dosth();
           }
      
      }

      So, I restarted my server I tried to execute {testing.dosth()} but I always get a null pointer exception.
      Please, tell me how can I use my ProcessManager Component in an other component?


      Thanks in advance.
      Mike