[jboss-user] [JBoss Seam] - seam don't do the initialization

robert-trudel do-not-reply at jboss.com
Wed Jan 16 16:16:53 EST 2008


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120646#4120646

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120646




More information about the jboss-user mailing list