tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Class cast exception when starting tomcat 7.0.1
Date Thu, 13 Jun 2013 20:40:35 GMT
> From: Jane Muse [] 
> Subject: RE: Class cast exception when starting tomcat 7.0.1

> I had catalina.jar in WEB-INF/lib.

Very, very bad move.

> It's needed because we have an implementation of Realm to store an 
> encrypted tomcat password users enter in the webapp.

Your custom implementation of Realm should be in Tomcat's lib directory, not the webapp's.

Such a Realm should not be tied into the operation of any webapp, other than configuring the
webapp to use it.

> If I remove it and add the catalina.jar from tomcat_home/lib to the 
> classpath

Not sure what you mean by adding it to the classpath; please explain.

> I have to change the signature from 
> org.apache.catalina.realm.RealmBase.Digest(String, String) to 
> org.apache.catalina.realm.RealmBase.Digest(String, String, String).

That's because internal Tomcat APIs often change between levels.  You certainly cannot count
on using an older version of Realm with a newer Tomcat (or vice versa).

> Should I not be writing code that needs classes from catalina.jar?

It would certainly be desirable not to be dependent on internal Tomcat classes.  Why do you
think a Realm should be storing a password (encrypted or not) anywhere?  A Realm would normally
be reading a password from some controlled storage, not writing to it.
 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message