When building the tomcat environment in Eclipse on Ubuntu, after Tomcat,server is configured, test a Web project and run it without Tomcat to choose, and the server Name column is grayed out. As follows:
Solution:
1. First your eclipse configuration needs to revert back to the reload state, but Eclipse does not have this feature, but you can replace a new workspace, File-switch Workspace-other, in the new workspace, The original configuration is not available.
2. Re-add the servers. Window-showview-servers. Then right--new-server in servers and add the Tomcat version on your computer. Finally click Finish, you may see the following prompt:/opt/tomcat/conf/catalina.policy (insufficient permissions), as shown:
Click Ok-finish directly to complete the Add.
3. At this point, the following files should be available under <eclipse workspace>/servers/<tomcat version> Server at Localhost-config:
Catalina.policy
Catalina.properties
Context.xml
Server.xml
Tomcat-users.xml
Xml
When I view my Eclipse workspace, the above files are not in the corresponding folder, in order to solve this problem, you need to copy these files from the/opt/tomcat/conf folder to <eclipse workspace>/ Servers/<tomcat version> Server at localhost-config below.
www.linuxidc.com @linuxidc:/opt/apache-tomcat-7.0.27/conf$ ls-la
Total Dosage
drwxr-xr-x 2 root root 4096 March 22:45.
drwxr-xr-x 9 root root 4096 June 00:59.
-rw-------1 root root 11955 March 22:45 catalina.policy
-rw-------1 root root 5402 March 22:45 catalina.properties
-rw-------1 root root 1394 March 22:45 context.xml
-rw-------1 root root 3288 March 22:45 logging.properties
-rw-------1 root root 6435 March 22:45 server.xml
-rw-------1 root root 1530 March 22:45 tomcat-users.xml
-rw-------1 root root 152716 March 22:45 web .
www.linuxidc.com@linuxidc:~/java/test/servers/tomcat v7.0 Server at localhost-config$ sudo cp */home/bobo/java/ test/servers/tomcat\v7.0\server\at\localhost-config/
4. Change the permissions of these files, or you will get an error.
Www.linuxidc.com@linuxidc:~/java/test/servers/tomcat v7.0 Server at localhost-config$ sudo chmod 777*
5. Click Eclipse's servers, press F5 (refresh), or right--refresh.
Article reprinted from: http://jingyemingyue.iteye.com/blog/1849880