I was having issues installing and running tomcat today and had to do a lot of research to get it running. I'm putting my solution here in case anyone runs into the same problem.
When I opened the url localhost:8080 in my browser, I would get a "refused to connect" error. I checked if the port 8080 was being used by another service, and it was not.
I then noticed that tomcat wasn't starting. I tried opening it through services but that didn't work either. Later services showed tomcat stuck in the "starting" status. I then tried to run tomcat through the command prompt with these commands.
cd: c:/filepathToTomcat/bin
bin>startup`
That gave me this error
jre_home variable undefined and java_home variable undefined
Using the solution to
https://stackoverflow.com/questions/18468681/tomcat-6-java-home
I created a setenv.bat file in the tomcat bin and set the java_home variable.
My setenv.bat file contained
#ECHO OFF
set "JAVA_HOME=C:\Program Files\Java\jdk-19"
set "JRE_HOME="
Tomcat still wouldn't run. A solution on
https://stackoverflow.com/questions/5398654/tomcat-not-starting
suggested using "catalina.bat run" on the command prompt instead of startup.
This showed that tomcat wouldn't start because it couldn't get the java virtual machine to run. I then uninstalled and reinstalled java and tomcat started working for me.
I used Java version 19 and tomcat 10.1.5 on a windows 11.
so I've manually installed tomcat version 9.0.10 and the newest java JDK.
I've correctly added the manager-gui and admin-gui users. i have went into the server.xml files and found that all the ports were correct.. (connecting to default port 8080) I had to do []# unset CATALINA_HOME or else it wouldn't let me start tomcat so I did and it started but when I went to the browser and typed in the localhost:8080 it didn't show, it only says firefox could not establish connection with server localhost:8080 so I went into logs to see if there were any errors and sure enough there was an error like so: /usr/local/tomcat/apache-tomcat-9.0.10/bin/catalina.sh: line 464: /usr/bin/Java/jdk-10.0.2/bin/bin/java does not exist.. and its probably right why would there be /bin/bin/ like that in a directory.. so i went into the catalina.sh file copied what it had inside into a blank file in documents and went to line 464 (txt editor numbered the lines for me) and what i found was this line at 464: eval $_NOHUP "\"$_RUNJAVA" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS %CATALINA_OPTS\
but I have no idea what to do about it.. i think i might have a path problem or could be a port problem but I don't think so... I've installed apache and it works great in the browser with localhost.. could that affect the tomcat access maybe?
anyway, id really appreciate any help I can get.. I'm very new to this by the way. I'm sorry, I couldn't copy and paste from my virtual machine so I had to type it. im on centos 7.
I think you are looking for tomcat deployment page where you can manage your artifact. If that is correct
First thing you need to check is that whether your installation contains tomcat manager application.
You can verify this by looking in to this path ("apache-tomcat-9.0.10\webapps\manager") If this path is absent you may have to reinstall your tomcat.
Try downloading the zip from the below path and start the server.
If you are trying to deploy your custom application you may have to provide the context path for accessing you application. Also you can verify the deployment by looking in to the above path. For eg: if you are trying to deploy test.war then a folder named test will appear in the webapp folder.
Hope this helps.
I see that problems like mine have been posted before, some of which posts were answered. I've attempted the fixes, which indeed seem like they should have worked, but I'm still running into the same problem:
I'm trying to run a dynamic web project in Eclipse Kepler (Java EE) via apache tomcat 7.0.53 on my localhost. I've created tomcat as a server in Eclipse, and copied the config files from /tomcat/7.0.53/libexec/conf into /workspace/Servers/Tomcat v7.0 Server at localhost-config, and changed the permissions on the files so that they are all readable and writeable.
However, when I try to start the tomcat server in eclipse, I get this error:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.
In case it's helpful, it's all being run in mac osx 10.6.8, on a 64-bit machine.
Thanks in advance for your help.
I am facing this issue. I have fixed as following way,
Step 1: Delete server at local host(Server tab)
Step 2: Delete Servers folder in (navigator/project explorer)
Step 3: After add New->server->Apache->choose path
Step 4: start the server
After it will work......
How to solve:
1.Close Eclipse
2.Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0.53 Server at localhost-config
3.Start Eclipse
4.Expand the Servers project, click on the Tomcat 7 project and hit F5
5.Start Tomcat from Eclipse
Go to Server --> Apache Tomcat v7.0 --> Add
Select jre7 instead of Workbench default JRE
Click on Finish
Stop Server and then Start Server
This is a permissions problem (I had the same issue in ubuntu 14.04, eclipse luna, tomcat7). The executable files are not marked as "executable" when tomcat is donwloaded from eclipse.
Just go to your "[tomcat]/bin" directory in your file system and add execution permission (x) to all .sh files. Then go back to eclipse/servers tab, delete the tomcat7 entry an create again, finally start tomcat from eclipse.
This same problem happened to me before then i got solution for config load error:
it can be solved Right click on Project-> Build Path-> Configure Build Path->go Library tab-> Add External Jar-> browse (Apache TomCat Folder->lib->and add servlet-api.jar) add click ok. it run fine for me.
Unfortunately, this is not much of an answer. I finally never got this working with eclipse Kepler. However, when I installed linux mint on my computer, and used its software installer to install linux 3.8 (indigo), added all the EE updates (all the web/xml additions via help-->install new software-->indigo update site), installed tomcat 7.0, I finally got eclipse to play nice with tomcat (that is, I can run the webapp on tomcat from eclipse, without copy/pasting all the requisite files into tomcat, which is saving me a boatload of time).
I'm sure there is a better way to do this - if anyone has any thoughts about what may have gone wrong in my initial environment, please advise - I'm curious why it didn't work. Here were the specs:
MacOS 10.6.8
Eclipse 4.3.2
Tomcat 7.0.54
My apologies, Raju, for not responding sooner. Thanks for your post.
How to solve:
Close Eclipse
Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0 Server at localhost-config
Start Eclipse
Expand the Servers project, click on the Tomcat 7 project and hit F5
Start Tomcat from Eclipse
I found that this is a good old fashion directory naming convention problem. I'm running Linux Ubuntu and noticed that right under {your work space}/Servers there appeared a strange error type file when I opened it had all kinds of chunks of the crazy long directory name "Tomcat 7.0 Server... bla bla" So I deleted the Server, then made use of this little ditty cause my version also won't let me re-add the server again:
1. Close Eclipse
2. In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings delete the following two files:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
3. Restart Eclipse
Then I re-added the server using a friendlier server name without any crazy spaces or chars: Tomcat7ServerAtLocalHost
The wella... it started with a brand new error for me to debug... which means I'm on the right track... BTW, the new error is: "Cannot publish to the server because it is missing its runtime environment."
So I'm off to debug that mess... Cheers!
This problem is mostly associated with file permissions. So the best way to solve the problem is to install a local copy of Tomcat on your development machine instead of putting Tomcat in a system directory such as /usr/share/tomcat7. This way all Tomcat conf files belong to the user and user group so that it can be run from Eclipse by the user. I normally place Tomcat at my local folder such as /home/abc/dev and it works perfectly with Eclipse development environment.
For me the only solution that works is this solution suggested here:
Could not load the Tomcat server configuration
cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /var/log/tomcat7 log
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo chmod -R a+rwx /usr/share/tomcat7/conf
In many materials about tomcat what I've looked I saw that authors uses exeternal batch script for start and stop tomcat.
I didn't see information about wrting this script. I think this script provided by tomcat.
I used exe file for installing my tomcat 7 on my windows 7. In tomcat directory I search startup.bat. This file is missed.
Can you help me?
It should be in the /bin directory. If you're missing this file possibly it means that you have installed Tomcat using Windows Installer. Try to download appropriate .zip archive, I believe that you will find startup script there.
I was puzzled by this - windows people need to script too!
However I think it is because tomcat gets installed as a service with a manager. If you want to start and stop it without using the manager you start and stop the service directly.
You can do this by typing (in an admin command prompt)
net start tomcat7
and
net stop tomcat7
Though it would be everywhere, still if you download the zip from their site, you can follow these instructions - http://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html
bin\startup.bat is for windows & .sh is for Unix.
Have you checked bin directory under Tomcat instalation dir? It should containt *.bat for start and stop server etc.
If you want to start Tomcat server by using startup.bat and you are unable to find it(that's because installer does not have it, you can only see it if you download and run .zip this will show startup.bat explicitly https://www.screencast.com/t/RMPCq5eJre3),
So to solve the issue just go to C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7\bin and double click Tomcat.exe, a command prompt like screen will appear this is the the same as clicking startup.bat script. Hope this helps
I am currently having a problem starting Glassfish inside Eclipse on OS X. It just hangs whilst trying to start the domain.
I think the problem may lie with the permissions of Glassfish - When I use the 'start-domain domain1' command even in terminal, I must use 'sudo' otherwise I get a 'permissions denied' error. If I use 'sudo', then the server starts successfully from terminal.
I think this error may be carrying over into Eclipse - that is, the server is trying to start but is timing out because Eclipse is not starting the server with the correct permissions etc.
Is there any way to start the server via Eclipse by giving it root permissions? Or another solution, is there any way to change the Glassfish permissions so that it can be started without the 'sudo' command?
Thanks.
You should have installed the glassfish directory in your home folder (it's usually /home/user/ on linux - I haven't used OS X, but I think it's the same). Re-install glassfish and make sure you place it in your home path (it's the recommended path anyway). Then reconfigure eclipse with the path of the new install.
--
Hope it helps