In version 6.0.26 org.apache.catalina.users.MemoryUserDatabase sets readonly = true. In version 5.5.29 org.apache.catalina.users.MemoryUserDatabase sets readonly = false. This means that the save method will default to logging an error message rather than saving the user database file. public void save() throws Exception { if(getReadonly()) { log.error(sm.getString("memoryUserDatabase.readOnly")); return; } The message that is displayed in 6.0.26 is: memoryUserDatabase.readOnly=User database has been configured to be read only. Changes cannot be saved I cannot find any documentation or a JMX management bean to set readonly = false. Hence the save method I was using in Tomcat 5.0.28 and tomcat 5.5.29 no longer works. David Tugby
Tomcat home page... http://tomcat.apache.org/ ...which links to the Tomcat 6 docs... http://tomcat.apache.org/tomcat-6.0-doc/index.html ...which has a link for configuration... http://tomcat.apache.org/tomcat-6.0-doc/config/index.html ...which documents Realms... http://tomcat.apache.org/tomcat-6.0-doc/config/realm.html ...including the UserDatabaseRealm which in turn links to the JNDI how-to... http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#UserDatabase%20Resources ...which describes how to set the readonly attribute.
Thanks. Got this working by pasting the entire entry from http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#UserDatabase%20Resources into my server.xml file. So I must have entered a typo when I tried earlier. The documentation is not quite correct however. tomcat-6.0-doc/jndi-resources-howto.html states "The readonly attribute is optional and defaults to false if not supplied." In my humble opionion this should be changed to: "The readonly attribute is optional and defaults to true if not supplied." Thanks again for the prompt response. David Tugby
Docs updated for 7.0.x and 6.0.x. Fix will be included in 7.0.1 and 6.0.28 onwards.