Mike Flynn
Mike Flynn

Reputation: 24325

Tomcat keeps resetting my tomcat-users.xml file

I am new to Java/Tomcat development and I am seeing this issue where my tomcat-users.xml file keeps getting reset. My user keeps getting removed and I'm not sure why. I am launching my application from Eclipse that is being deployed to this Tomcat instance.

C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0

VM Arguments

-Dcatalina.base="C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0" -Dcatalina.home="C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0" -Dwtp.deploy="C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\wtpwebapps" -Djava.endorsed.dirs="C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\endorsed"

Upvotes: 17

Views: 8983

Answers (3)

Nethaji Narasimalu
Nethaji Narasimalu

Reputation: 259

If using any IDE, Update server.xml in Eclipse as below:

<Resource auth="Container" readonly="true" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>

Upvotes: 2

Soumyaansh
Soumyaansh

Reputation: 8998

Please try this :

  • Go to tomcat's conf folder and open the server.xml file, in the file between 'GlobalNamingResources' tags you will get 'Resource' tag , add readonly="true" and thats all you need.

Upvotes: 4

Mike Flynn
Mike Flynn

Reputation: 24325

I updated the tomcat-users.xml file under Servers in Project Explorer. That seems to be copying it over to the real Tomcat Server.

Upvotes: 32

Related Questions