I use JBoss AS 4.0.3RC1 and I have two session beans with the following classes:
@Local public interface MyManager
@Stateless public class MyManagerBean implements MyManager
@Remote public interface Tester
@Stateless public class TesterBean implements Tester
The first session bean just have one business method that returns a string.
The second session bean also have one business method that calls the method on the first bean.
My question is: In the Tester bean, why doesn't
@PersistenceContext private static MyManager myManager;
private static MyManager myManager;
static
{
try
{
InitialContext ctx = new InitialContext();
myManager = (MyManager) ctx.lookup(MyManager.class.getName());
}
catch (NamingException e)
{
e.printStackTrace();
}
}Please forget my previous post! I am supposed to use @EJB instead!!!
Sorry about that.
/Patrik