4 Replies Latest reply on Aug 29, 2011 9:43 AM by Emiliano Ricci

    jdbcRealm - ClassCastException when trying to log in

    a s Newbie

      hello, i'm currently migrating a webapp from tomcat 4.x to jboss 5.0.0.GA but if i try to login into the webapp i get the following error:

      java.lang.ClassCastException: org.apache.catalina.realm.GenericPrincipal cannot be cast to org.jboss.web.tomcat.security.JBossGenericPrincipal
      ...
      


      i'm using jdbcRealm for the authentication and the context.xml looks like this:
      <Context path="/myApp"
       debug="0"
       privileged="true">
       <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
       driverName="com.mysql.jdbc.Driver"
       connectionName="jdbc:mysql://localhost:3306/myapp?characterEncoding=utf-8&autoReconnect=true"
       connectionName="test"
       connectionPassword="***"
       userTable="LOGIN" userNameCol="LOGINNAME"
       userCredCol="PASSWORD"
       userRoleTable="ROLES" roleNameCol="PRINCIPAL"
       digest="MD5" />
      </Context>
      


      when i login with a wrong name/pw i get to my errorpage so the connection seems to be alright.

      has anyone a suggestion what might cause this error?