I'm wondering why my method that's marked with the @Factory annotation in my
stateless session bean isn't being invoked. Because I'm still new to EJB and
Seam, I'm wondering if I don't understand the concepts well enough yet. Here's
what I have (some sample code - the syntax may not be entirely correct - but my
actual code compiles):
My stateless session bean implementation:
@Name("TestStatelessBean")
| @Stateless
| public final class TestSLSBBean implements TestSLSBLocal {
| @Out(value="testVar")
| private String testVar = null;
|
| @Factory("testVar")
| public void init() {
| ....
| }
|
| public void testSLSBMethod() {
| ....
| }
| }
The business interface for this bean:
@Local
| public interface TestSLSBLocal {
| void init();
|
| void testSLSBMethod();
| }
The stateless session bean is invoked from a stateful session bean with the
default conversation scope:
@Name("TestStatefulBean")
| @Stateful
| public final class TestSFSBBean implements TestSFSBLocal {
| @In(value="TestStatelessBean", create = true);
| TestSLSBLocal test;
|
| void testSFSBMethod() {
| test.testSLSBMethod();
| }
| }
So when test.testSFSBMethod() is invoked, the init method in TestStatelessBean
is somehow never invoked before testSLSBMethod is called (at least it doesn't
appear so in my debugger). I would hate to have to add the init() method call
to everyone one of the methods in the TestSLSBBean class. What am I doing
wrong, or do I have to add init() for each method in the TestSLSBBean class?
Thanks!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973774#3973774
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973774
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user