Thanks Chuck! > Do you happen to have a conf/Catalina/[host]/test.xml file? If so, it will override the one > in the webapp's META-INF/context.xml, causing your <Realm> to be ignored.
This was the problem. I modified that one and it is now using the JNDIRealm. However, that exposes a timing issue which I'm not sure how to solve. I embedded ApacheDS in my web application by implementing ServletContextListener so that it starts on contextInitialized and stops on contextDestroyed - when my web application starts and stops.. The problem now is that the application doesn't start until after the the context.xml is processed by Tomcat. This ends up with me getting errors like this, and my application isn't deployed: [java] 06:15:14,799 WARN [[/test]] Exception performing authentication [java] javax.naming.CommunicationException: localhost:10389 [Root exception is java.net.ConnectException: Connection refused: connect] [java] at com.sun.jndi.ldap.Connection.<init>(Connection.java:207) [java] at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118) [java] at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1580) [java] at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2616) [java] at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:287) [java] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175) [java] at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193) It's trying to connect to the LDAP server, but my application hasn't started yet - so the LDAP server isn't running. Is there some way to fix this so things are started in the right order? Any suggestions appreciated! Thanks, -- Greg __________________________________________________________________________________________________________________ DISCLAIMER:"The information contained in this message and the attachments (if any) may be privileged and confidential and protected from disclosure. You are hereby notified that any unauthorized use, dissemination, distribution or copying of this communication, review, retransmission, or taking of any action based upon this information, by persons or entities other than the intended recipient, is strictly prohibited. If you are not the intended recipient or an employee or agent responsible for delivering this message, and have received this communication in error, please notify us immediately by replying to the message and kindly delete the original message, attachments, if any, and all its copies from your computer system. Thank you for your cooperation." ________________________________________________________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org