Hello, I'm evaluating now SEAM framework as new Web development framework for 
our project. I have some poblems using it.
I took the Logout stateful session bean as in booking example and separated the 
db calls outside the ejb:


  | public class ChangePasswordAction implements ChangePassword {
  | @In(create=true)
  | ChangePwdDao changePwdDao;
  | 
  | public String changePassword()
  | {
  |    if ( changePwdDao.changePassword()) {
  |       FacesMessages.instance().add("Password updated");
  |       return "main";
  |    }
  |    else 
  |    {
  |        FacesMessages.instance().add("verify", "Re-enter new password");
  |        changePwdDao.cancel();
  |          return null;
  |     }
  | }  

In ChangePwdDao:

  | @Scope(EVENT)
  | @Name("changePwdDao")
  | public class ChangePwdDao {
  |   @In @Out
  |   private User user;
  |   @PersistenceContext
  |   private EntityManager em;
  |   public boolean changePassword() {
  |     //using em here
  |  }
  | 

I receive NullPointerException while trying to use EntityManager inside the 
dao. As I understand SEAM injects the user variable but doesn't inject em 
(EntityManager).
I would like to see what's wrong with my code.
Thank you  in advance.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007426#4007426

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007426
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to