Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] Exception: callbackHandler == null

Hi all!

I am tried to imitate the the sample application: "o.e.r.sample.app.server" and "o.e.r.tests".

The problem is the server throw a exception says "callbackHandler == null" in the server side loginModule:

public class DW2ServLoginModule implements LoginModule {
....
   public boolean login() throws LoginException {
     ...
      if (callbackHandler == null) {
           throw new EUnexpectedCase("callbackHandler == null");
      }
     ...
   }
}

in the client side, I use IAuthenticationService (just like o.e.r.security.services.itest.authentication.AuthenticationClientITest) to login:

class client {
  ...
 private IAuthenticationService getAuthService() {
  if (authService == null)
  {
   ServiceReference ref = ctx.getServiceReference(IAuthenticationService.class.getName());
   if (ref == null)
    throw new ExceptionRT("Service not registered: " + IAuthenticationService.class.getName());
   
   authService = (IAuthenticationService)ctx.getService(ref);
  }
  
  return authService;
 }
 ...

 private void login() {
  IAuthenticationService as = getAuthService();
  AbstractCredential[] credentials = new AbstractCredential[2];
  
  NameCredential nc = new NameCredential("User name:", "xx");
  nc.setName(userName);
  PasswordCredential pc = new PasswordCredential("Password:", false);
  pc.setPassword(password);
  
  credentials[0] = nc;
  credentials[1] = pc;
  
  as.login("dw2AppServ", credentials);
  }
}

What's wrong?



Yau

Back to the top