Hi,

sorry for the confusion, I made a mistake with the class name, it does work as described! :)


kind regards


Am 04.09.2015 19:35 schrieb Christopher Schultz:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Juls,

On 9/4/15 10:01 AM, juls wrote:
thanks, I guess that was the right hint.

I hope so!

I now implemented a custom X509UsernameRetriever, created a jar
and placed it in $CATALINA_HOME/lib.

import java.security.cert.X509Certificate;

public class X509UsernameRetrieverClass implements
org.apache.catalina.realm.X509UsernameRetriever {

@Override public String getUsername(X509Certificate cert) {
//String name = cert.getSubjectDN().getName(); String name =
String.valueOf(cert.getSerialNumber()); return name; } }

Then I changed the realm configuration in
$CATALINA_HOME/conf/server.xml

<Realm className="org.apache.catalina.realm.MemoryRealm"
X509UsernameRetrieverClassName="xx.xx.xx.X509UsernameRetrieverClass"
/>


When starting Tomcat I get a ClassNotFoundException for my custom
class. According to the Class Loader Documentation the Common
Loader should load all jars in the lib folder.

Correct.

Is there something else I need to pack into the jar for Tomcat to
load the class?

You shouldn't need anything else. Can you show the output of:

$ unzip -v lib/your-jar.jar

?

Also, what's the full stack trace of the CNFE?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV6dZwAAoJEBzwKT+lPKRYEgkQAJe5hI+5XF+9ty11l/XKNrSR
ypXeGSAOaeGMcjuUrWc+NUJdzPrd3riQ/98VssjKJMG8i4NmAvX4XczibzL2M3xp
3O5V1ywPaKY4piuTs1LDxqqL8s2j1qmDojkZe3oIslr0sVL1XlHthlGV+vfPobIX
ARa0FuLBqrhxtaYUxa7qnudBjslvyixpuWQMQnk6uU573+L7Ngyz9SWn2QXDBxag
P9QYHWQnYhiANlZ4CNHpWP+RLm1uRIJ8qry/5CyKgPZCeVMKtxoXF4LBu4UBdtKn
gTyDpBVmy1VQM6i3yDWEFMob8N1Rw1FWkriR2Ve+E36QN9nNj93jeaSKvWF1ByGj
yn/msEitIG5MWLwRySlJpR6h45zY5FojU42vFMhIN2iDbqMt+f2ReCQziDdyiEcL
O71IGjT/UFVAVd00W/BCC15auMKH3c4H6ju21GgLRuYU6qTGC27ZjujTuBjpCGU7
KoWFsn/+skW+DqyRjZ+BYqf7NH5sseXfWfw8rpKh3S+M5qqR7BSB4rYtUQFbkhuv
r9movEctAn/ZxCRpHGSjfJMLGf4ywtfdl1ZjQuCzN2F89p+tGTjFIRBp7E9YwiuQ
6JEyXVpBeyll4P1lnq/E7aiYaY+DDhjJumjhPmn86sYOqLR8EAEYUyJ7/nX8Ii2S
FOF/0sEIwLzucd6f7hUE
=dq03
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to