configuration - Tomcat 7 overrides the tomcat-users.xml when using Eclipse -
i using tomcat 7
deploy web projects on. more comfortable when using eclipse interface
start , stop tomcat, i've added in eclipse's servers
, check "use tomcat installation" in server locations
. 1 more thing use tomcat's web manager tool
deploy/undeploy projects. know in order use manager/html tool have sign in. username , password authenticate set in tomcat-users.xml (in file):
<role rolename="tomcat"/> <role rolename="manager"/> <role rolename="manager-script"/> <role rolename="manager-gui"/> <role rolename="standard"/> <role rolename="admin"/> <user username="tomcat-eclipse" password="tomcat-eclipse" roles="tomcat,manager,manager-script,standard,admin"/> <user username="root" password="toor" roles="manager-gui" />
everything works fine until moment in time (i'm not sure maybe after several restarts or redeploys) configuration i've entered flushed , default (empty configuration) file overrides customized config.
q: causes file overridden , how can prevent that? thanks.
edit:
a: suggest based on experiments is:
- variant one: change tomcat 7's tomcat-users.xml file before add eclipse. because suspect when using "use tomcat installation" option eclipse copied old tomcat-users.xml in metadata folder , when change later in tomcat's install dir, don't overrides in metadata. then, reason, when running server through eclipse suspect checks if files same , if not overrides tomcat-users.xml in tomcat's installation folder.
- use "use workspace metadata" option. default. go eclipse's package explorer -> tomcat server -> tomcat-users.xml , change there. can copy contents of
your-tomcat-install-dir/webapps
your-eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/
in order have nice tomcat html interface (as shown in tutorial: installing tomcat 7 , using eclipse).
try it. :)
in eclipse go project 'servers' in 'project explorer' panel , inside folder 'tomcat v7.0 server @ localhost-config'(this default name tomcat server maybe yours different) change there tomcat-users.xml
project explorer > 'server's > tomcat v7.0 server @ localhost-config > tomcat-users.xml
Comments
Post a Comment