[jboss-user] [JBoss Seam] - java.lang.RuntimeException: Could not create Component: auth

grdzeli_kaci do-not-reply at jboss.com
Mon Mar 19 03:20:50 EDT 2007


hi all, 
i got this error :

  | 23:18:43,533 ERROR [[/MagticomBilling]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
  | java.lang.RuntimeException: Could not create Component: authenticator
  |         at org.jboss.seam.init.Initialization.addComponent(Initialization.java:833)
  |         at org.jboss.seam.init.Initialization.addComponents(Initialization.java:715)
  |         at org.jboss.seam.init.Initialization.init(Initialization.java:478)
  |         at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
  | 

could anybody help me what happened ?

my component.xml looks like :

  | <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
  | 
and AuthenticatorAction class 

  | @Stateless
  | @Name("authenticator")
  | public class AuthenticatorAction implements Authenticator{
  |     
  | @PersistenceContext
  |     EntityManager em;
  |     
  |     @Out(scope=SESSION,required=false)
  |    private Users user;
  |     
  |     
  |     @In Identity identity;
  |     
  |     @In Actor actor;
  |     
  |     public boolean authenticate() {
  |         try{
  |             String userName = identity.getUsername();
  |             String userpasswd = identity.getPassword();
  |             
  |             List<Users> list = (List<Users>)em.createNamedQuery("Users.findByUserName").setParameter("userName",userName).getResultList();
  |             if (list==null || (list!=null && list.size()!=1)) {
  |                 return false;
  |             } else {
  |                 user = list.get(0);
  |                 byte [] dbpasword = user.getUserPwd();
  |                 
  |                 
  |                 MessageDigest md5 = MessageDigest.getInstance("MD5");
  |                 md5.reset();
  |                 md5.update(userpasswd.getBytes());
  |                 byte[] usrpwd = md5.digest();
  |                 
  |                 boolean result = MessageDigest.isEqual(usrpwd, dbpasword);
  |                 
  |                 if (!result) {
  |                     return false;
  |                 }
  |             }
  |             return true;
  |         } catch(Exception e) {
  |             e.printStackTrace();
  |             return false;
  |         }
  |     }
  | }
  | 
  | 

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029214



More information about the jboss-user mailing list