Platform: JBoss AS 7.1.1.
I have a beanless method that should call another method of the same bean but must go through the EJB container.
@Stateless public class OrderManager { @Resource SessionContext ctx; @Inject MailUtil mm; Logger logger = Logger.getLogger("Test"); public void method1() { if (mm == null) { logger.info("MailUtil is null"); } ctx.getBusinessObject(OrderManager.class).method2(); } @Asynchronous public void method2() { if (mm == null) { logger.info("MailUtil is null"); } } }
Unfortunately, the introduced variable mm is null in method 2 (). Although inside the method 1 () there is a correctly entered variable mm.
Is this a defect in JBOss, or am I doing something wrong? Thanks.
source share