2 Replies Latest reply on Feb 22, 2007 1:23 PM by Gary Cuozzo

    Custom LoginModule and ClassCastException

    Edward Edkowski Newbie

      Hi,

      I wrote my own login module for operating on user accounts as beans.
      After JBoss restart everything is fine, but after I reload my EAR the following appears

      java.lang.ClassCastException: $Proxy94
       at ms.gpw.login.impl.LoginPasswordLoginModule.login(LoginPasswordLoginModule.java:70)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
       at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
       at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
       at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
       at ms.gpw.login.servlet.DoLoginServlet.doPost(DoLoginServlet.java:46)
       ...
      


      This is during obtaining from JNDI a local stateless session bean interface.
      The login modules are in server/default/lib in a .jar.
      Everything else is packacked in the EAR (so far a few servlets in a WAR and EJB3 .jar
      containing account data beans).

      Am I doing something wrong? Is it a bug or is it a feature?

      Thanks,
      Edek