Berek Bryan
Berek Bryan

Reputation: 14725

Tomcat Migration - Authentication Issue

I am trying to migrate to Tomcat 7 from Tomcat 6.

The app uses form authentication and when logging in the app gets stuck at /j_security_check as a blank white page.

Tomcat is displaying the user is authenticated and an error.

java.lang.NoSuchMethodError: org.apache.catalina.realm.GenericPrincipal.getRealm()Lorg/apache/catalina/Realm;

Not sure where to go from here.

[EDIT]

the server.xml file on the tomcat server is just the default.

context.xml in the application

  <Realm 
    appName="Informer" className="AuthRealm" 
    dbContext="java:comp/env/jdbc/appdb" debug="2" 
    krbFile="C:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.14\\conf\\krb5.conf"
    loginFile="C:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.14\\conf\\jaas.conf"                     
    ndcLdap="ldap://server:389" 
    nedLdap="ldap://server:389" roleClassNames="" 
    useContextClassLoader="true" userClassNames="" />

[[ EDIT ]]

I am calling the getRealm() method to generate a new GenericPrincipal object. Looks like I just need to update to the new constructor.

[[[ EDIT ]]]

Two issues. I was calling getRealm() and the call was in a constructor that did not take the realm as a parameter anymore.

So I looked up the new constructor for GenericPrincipal and all I had to do was remove the getRealm() call from the parameters.

Resolved.

Regards,

Upvotes: 0

Views: 2055

Answers (1)

madth3
madth3

Reputation: 7344

I don't see that AuthRealm class in the Tomcat docs. I guess it's a custom Realm which was programmed against Tomcat 6 and now the API has changed.

The object org.apache.catalina.realm.GenericPrincipal changed from version 6 to version 7 and now it doesn't have the getRealm() method.

Upvotes: 1

Related Questions