1 Reply Latest reply on Nov 13, 2007 9:28 AM by maximuszen

    Exception sending context initialized event to listener inst

    maximuszen Newbie

      Can you help me understand this error? I'm not using Java Server Faces? My code is a hack. I'm missing things conceptually because I'm just putting together some code from whatever I can get my hands on.

      Windows XP, Java SDK 1.5, JBoss 4.2.2

      Here is my code:


      <application-policy name = "zzz">

      <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
      flag = "required">
      <module-option name = "unauthenticatedIdentity">guest</module-option>
      <module-option name = "dsJndiName">java:/PostgresDS</module-option>
      <module-option name = "principalsQuery">SELECT password FROM xuser WHERE username=?</module-option>
      <module-option name = "rolesQuery">SELECT name, 'Roles' FROM role WHERE id = ANY
      ( SELECT role_id FROM user_role WHERE user_id =
      ( SELECT id FROM xuser WHERE username = ? ) )


      default/conf/auth.conf(I removed this) and
      the VM argument -Djava.security.auth.login.config=auth.conf

      // jBoss ClientLoginModule
      org.jboss.security.auth.spi.DatabaseServerLoginModule required


      public class Login extends Command {
      public String perform(HttpServletRequest request) {
      String username = request.getParameter("u");
      String password = request.getParameter("p");
      UsernamePasswordHandler handler = new UsernamePasswordHandler(username,password);
      Subject subj = null;
      try {
      LoginContext lc = new LoginContext("zzz",handler);
      } catch (LoginException e1) {
      return error;
      subj = lc.getSubject();
      Log.info("subj = "+subj);
      return ok;
      web.xml in application

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5"




      The World Street Journal posted a article about how Asian women are flocking to Korea because of the skills of plastic surgeons there. One of my relatives whose in grade school there told me a joke: Why is my wife so beautiful but my son so ugly? (I have a right to make fun of my own people. :)