Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

publishing error in tomcat7

I encounter a problem " 'publishing to tomcat v7.0 server at localhost' has encountered a problem" while starting my tomcat server from eclipse. This problem arised after i tried to solve the 404 error by selecting the 'use tomcat installation' option in the setting of the server. The server seems to be running but it actually isn't.

Publishing the configuration... Error copying file to /usr/share/tomcat7/backup/catalina.policy: /usr/share/tomcat7/backup/catalina.policy (No such file or directory) /usr/share/tomcat7/backup/catalina.policy (No such file or directory) Error copying file to /usr/share/tomcat7/backup/catalina.properties: /usr/share/tomcat7/backup/catalina.properties (No such file or directory) /usr/share/tomcat7/backup/catalina.properties (No such file or directory) Error copying file to /usr/share/tomcat7/backup/context.xml: /usr/share/tomcat7/backup/context.xml (No such file or directory) /usr/share/tomcat7/backup/context.xml (No such file or directory) Error copying file to /usr/share/tomcat7/backup/server.xml: /usr/share/tomcat7/backup/server.xml (No such file or directory) /usr/share/tomcat7/backup/server.xml (No such file or directory) Error copying file to /usr/share/tomcat7/backup/tomcat-users.xml: /usr/share/tomcat7/backup/tomcat-users.xml (No such file or directory) /usr/share/tomcat7/backup/tomcat-users.xml (No such file or directory) Error copying file to /usr/share/tomcat7/backup/web.xml: /usr/share/tomcat7/backup/web.xml (No such file or directory) /usr/share/tomcat7/backup/web.xml (No such file or directory)

any suggestions guys.

like image 391
haedes Avatar asked Feb 22 '23 20:02

haedes


1 Answers

Firstly, when in Eclipse you choose the "Use Tomcat installation (takes control of tomcat installation)" we are wrongly assuming Eclipse simply runs the Tomcat server as if you would type the command

/usr/share/tomcat7/startup.sh

but the truth is that Eclipse (through its tomcat plugin) tries to do something else before starting the server.

What Eclipse tries to do is a backup of the config files into a folder called backup and the reason you are getting this error is because it is unable to create the folder /usr/share/tomcat7/backup and content on it. It is purely a permission issue as Eclipse (other user) has not privileges to write on disk. Here is what you can do:

  1. Open a Terminal
  2. Create the backup folder with superuser permissions
  3. Give writing permissions to allow Eclipse copy the files from conf folder to backup folder

All these 3 steps can be done with the following commands

cd /usr/share/tomcat7
sudo mkdir backup
sudo chmod 777 backup

Then try to run again Tomcat server from Eclipse. It should work...

I hope it helps!

PS: About the error 404 in localhost:8080 when you start Tomcat from Eclipse (using workspace metadata), you will not be able to see the Tomcat welcome page because the Tomcat in the workspace has not deployed the ROOT.war hence there are not pages to display but the server runs and is ready to debug your applications, which is the purpose of running Tomcat through Eclipse.

like image 112
diegosasw Avatar answered Mar 03 '23 02:03

diegosasw