EJBTHREE-1246
javapenguin Feb 24, 2010 1:46 AMI am using jboss-5.1.0.GA.
I keep getting this EJBTHREE-1246 warning every time I am injecting an ejb into another ejb and calling a method.
I get no warning if I call the same method from a servlet.
The functionality works fine and I get the required result from all my code. It is just this irritating warning every time I call a method.
Does anyone have the same problem and hopefully an answer to my problem.
Example 1 (Give warning):
@Service(name = "ManagementServiceEJB")
public class ManagementServiceBean implements ManagementService {
private static final Logger LOG = Logger.getLogger(LoginServiceBean.class);
@EJB
LoginServiceLocal loginService;
public void start() throws Exception {
LOG.info("start");
String name = "gary";
Login login = loginService.findLogin(name);
if(login == null) {
login = new Login();
login.setLogin(name);
login.setPassword("default");
loginService.createLogin(login);
}
}
}
Output 1:
08:38:04,071 INFO [LoginServiceBean] start
08:38:04,196 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
08:38:04,198 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
08:38:04,208 INFO [LoginServiceBean] Finding login: gary
Example 2 (Give warning):
@Stateless(name = "LoginServiceEJB")
public class LoginServiceBean implements LoginServiceLocal, LoginServiceRemote {
private static final Logger LOG = Logger.getLogger(LoginServiceBean.class);
@Resource(mappedName = "topic/quinn.log.topic")
private Destination destination;
@EJB
private MessagingService messagingService;
@PersistenceContext
Session session;
public void createLogin(final Login login) {
LOG.info("Creating login: " + login.toString());
session.save(login);
MessagingCallback messagingCallback = new MessagingCallback() {
public Message createMessage(javax.jms.Session session) throws JMSException {
return session.createObjectMessage(login);
}
};
try {
messagingService.postMessage(destination, messagingCallback);
} catch (JMSException e) {
throw new RuntimeException(e);
}
}
}
Output 2:
08:40:49,615 INFO [LoginServiceBean] Creating login: User{login='keyley', password='smallpassword'}
08:40:49,626 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
08:40:49,626 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
08:40:49,956 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
08:40:49,957 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
Example 3 (No warning):
public class CreateLoginServlet extends HttpServlet {
@EJB
LoginServiceRemote loginService;
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
LoginDTO dto = new LoginDTO();
dto.setLogin(request.getParameter("login"));
dto.setPassword(request.getParameter("password"));
loginService.createLogin(dto);
response.sendRedirect("ListLoginServlet");
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}