Pid wrote: > On 21/7/09 23:23, Mitch Claborn wrote: >> I am toying with the idea of writing my own Realm for authentication. >> Much of the code and structures that I need are already present in the >> web application. Is there any way for the Realm to access Java objects >> from the web application? They don't appear to share the same class >> loader. >> >> As an alternative is there a mechanism for providing the functionality >> of a Realm, but within the web application structure? > > You can define the Realm in your context.xml, (which of course you'll > be configuring in the META-INF dir of your web-app, hint hint). > > I think this will load classes from your web-app classloader. > > > N.B. Check out the "localDataSource" attribute, if you're also using a > web-app specific DataSource. > > http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#DataSourceRealm > > p > I found that I can define the Realm in the conext.xml in my WEB-INF, but it is not being located - getting java.lang.ClassNotFoundException when the web app deploys/starts. I've triple checked that the class files are there in WEB-INF/classes. I also tried putting in a jar in WEB-INF/ilb. I'm guessing that the Realm is still being loaded in a different class loader. I would guess the Realm is loaded in the "common" class loader, as defined at http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html.
Any other ideas? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org