0

Please follow Getting error while starting Tomcat Server 9 in Eclipse though command line run is successfull for my query.

I would appreciate an early response.

Best,

Arushi

Here are screens:

screen 1 screen 2 screen 3 screen 4

Kamil
  • 2,712
  • 32
  • 39
Mona
  • 7
  • 5
  • is the tomcat pointing to the correct jdk/jre... ? please provide screenshots or any relevant logs that might be useful – Shoaeb Dec 19 '19 at 13:42

2 Answers2

0

Change the directory to WEB-INF. It worked fine after that. Which is after tomcat/../web-inf/

Before that check

whether the tomcat folder have root access. In cmd, you will run as a user. But eclipse can't. I had the same problem in Linux. After giving the access permission, no error message. If it is running in cmd, then it might be due to permission.

Did you stopped Tomcat before deploying in eclipse? Stop tomcat using cmd and run in eclipse.

Restart the server again.

If same persists then reinstall it.

I hope these steps will solve your problem.

S14321K
  • 220
  • 3
  • 19
  • I installed WTP tools too for 2019-09 but still the same error. How do I re-install Apache so that the installation doesn't become messy and throw errors? – Mona Dec 20 '19 at 05:02
  • First stop the tomcat from cmd. Remove the deployed server from "Manage Deployments" which is in Eclipse, take a back up of your project if you deployed in tomcat/webaps folder, then uninstall tomcat. Again install tomcat. Before that check the tomcat version is compatible with your project. Thats more important. Your first image states that the Tomcat9.0.30/endorsed is not supported. Check this for more details http://tomcat.apache.org/whichversion.html – S14321K Dec 20 '19 at 07:29
  • Ok so for the Tomcat 9.0.30/endorsed I have Java 10 which is compatible by the link you shared. Also could you outline how do I completely uninstall tomcat server and then reinstall so as not to mess things up with path inconsistencies? – Mona Dec 20 '19 at 12:18
  • Are you using MAC? I don't have any idea about this in MAC, I'm sorry. But I can give you an outline as you asked. Go to Window - Preferences - Server - Runtime Environments. You will see the servers which you have deployed. Remove it. If you have a back up of tomcat-9.0.30. Then remove the previous one and set the path to new tomcat folder and deploy. Bottom if you can see server near the console tab, you can add the tomcat and deploy it. Once afetr deploying, double click on the the tomcat server. It will open the settings screen. There you can configure. I did this a long before. – S14321K Dec 20 '19 at 23:19
  • Could I be provided with exact steps to uninstall Apache Tomcat from Eclipse in Mac? I am not sure how to do it as dependencies too would need to be uninstalled. – Mona Dec 23 '19 at 14:13
  • @Mona I would like to help you, but improper guidance may lead to crash the project. I never used MAC before. So I don't have any idea about this in MAC. As I mentioned above, In Eclipse, go to Window-Preferences..(steps are already mentioned above) and remove or delete the tomcat folder which you have now. Take a copy of all your settings done in your tomcat, and place the new tomcat folder and deploy it again. This is how I do in Windows and Linux. You cant uninstall it. Deleting the existing folder is the only way of uninstalling the tomcat. – S14321K Dec 23 '19 at 17:27
  • I did that in Mac by steps in https://wolfpaulus.com/tomcat/ and https://stackoverflow.com/questions/985980/removing-the-apache-tomcat-runtime-from-a-project-in-eclipse. Now even for ./shutdown.sh from cmd line I get this err -"Djava.endorsed.dirs=/Library/Tomcat/endorsed is not supported. Error: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit." though ./startup.sh works fine. In Eclipse I still get timeout err – Mona Dec 24 '19 at 17:42
  • Timeout error that I get is localhost was unable to start within 120 seconds which I configured by changing the regular default setting – Mona Dec 24 '19 at 17:44
  • Better delete the Tomcat folder and re-install it again. You can straight away go to that tomcat folder and delete it. Tomcat might have got crashed Follow the same steps as mentioned in this https://wolfpaulus.com/tomcat/ . That 5th and 6th are the giving ownership to the files. After completing this 5 and 6, check the ownership using command without double quotes " ls -l ". Check all the User,Group and Others got the execute permission. For better understanding https://help.ubuntu.com/community/FilePermissions – S14321K Dec 24 '19 at 18:13
  • You mean I should delete the apache-tomcat-9.0.30 folder in /usr/local? Or just the Runtime environment? – Mona Dec 25 '19 at 07:39
  • Yes, if you have tomcat in this directory /usr/local. Then you can delete the file. Again follow the steps. Finally, check whether the file has the required permissions. I hope you would have gone through the FilePermissions. If you are using Mac OS X, then it is a Unix OS and its command line is 99.9% the same as any Linux distribution.. – S14321K Dec 25 '19 at 09:01
0

Update: I installed 201912 version of Eclipse, deleted Tomcat folder from /usr/local/. Followed all steps in https://wolfpaulus.com/tomcat/ and am able to access Tomcat Server without any issue. Thanks to all for the great help!! Will mark this as solved.

Mona
  • 7
  • 5