[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