0

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,

1
  • What's in your configuration files? Commented Mar 22, 2012 at 16:52

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

just had to update the constructor by removing the getRealm() call

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.