3 Replies Latest reply on Jan 17, 2008 10:55 AM by Pete Muir

    seam don't do the initialization

    robert trudel Newbie

      hi

      i use seam 1.2.1 and jboss 4.05

      i have a mbeam who implements Schedulable and i would like to use a seam component

      i do:

      TestService as = new TestService();
        try {
         test.calculate;
       } catch (Exception e) {
         e.printStackTrace();
        }
      }
      


      my testservice class

      @Name("testService")
      @Scope(ScopeType.APPLICATION)
      public class TestService {
         public boolean calculate()throws Exception {
         TestComponent tc = TestComponent.getInstance();
         return tc.test();
         }
      }
      


      my test component code
      @Name("testComponent")
      @Scope(ScopeType.CONVERSATION)
      public class TestComponent
      implements Serializable{
      
       @In (create=true)
         User user ;
      
         protected TestBean testBean ;
      
        public static TestComponent getInstance() {
        try {
        return
      (TestComponent)Component.getInstance(TestComponent.class,
       true);
         } catch (Exception e0) {
         throw new TechnicalException(e0);
       }
       }
      }
      



      when i try to get an instance of TestComponent in TestService class, i debuged and i saw than seam don't find the lookup in the context (Contexts.lookupInStatefulContexts(name)) and i get No application context active . Seam don't do any initialization.

      is there any solution?

      thanks