Eclipse STS connecting to Tomcat - eclipse

In Spring Tool Suite IDE, have added Tomcat server and started it. Console output says : INFO: Server startup in 19182 ms
But on trying url http://localhost:8080/, gives HTTP error 404
STS version - 3.6.2.
If server is started outside Eclipse, Tomcat homepage is accessible as usual.

Try http://localhost:9087/ and see if that works. You may need to check your configurations for other port numbers, but 9087 should work.

Got it working!
Wile running tomcat in eclipse, not all files are copied in the new deployment location in the eclipse workspace. But after manually copying index.jsp and related images, the home page came.

Related

Tomcat server does not run in localhost

The Apache Tomcat server is started but it does not open in the browser (i.e. localhost) giving 404 error.
Tried changing port no in server.xml, then changing server location to Tomcat installation but nothing worked. Eclipse gives these errors while starting the Tomcat server, shown in the screenshot:
This usually only happens if your configuration is screwed up or the mapping from your IDE to your webapp folder. I would set server.xml back to normal. Then verify your web.xml file is in the correct location and configured properly. Look it up in your eclipse config and see if eclipse is actually finding it. Sometimes if your IDE does not find web.xml then when it builds you get a 404.
You can rule out your IDE by building your WAR then running it directly in Tomcat without eclipse.

make tomcat take project from workspace

I am working on ubuntu 14.04, have downloaded tomcat7 and then eclipse luna.
I added Tomcat7 to eclipse and started the server. I have changed the port to 3030. When i hit the lolachost:3030, I get a blank page whereas when i deploy a project on server this is the log i see.
org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/share/tomcat7/webapps/first
This is not my workspace path, and it shows 404 page on browser. i need to configure tomcat7 to point my workspace?
Have you tried to Add project to Tomcat Server in Eclipse ?
View "Servers" -> your tomcat server -> "Add and Remove"
I think simply running from localhost cannot run your project, first From eclipse run on server, get the url run it on any browser.

404 Error Apache Tomcat 7 running JSP file from Eclipse Juno IDE

I am using Tomcat 7 on the Eclipse IDE to run a JSP file.
It was working fine 2 days ago but now when I'm running my file a 404 Error is showing up:
HTTP Status 404 - /
type Status report
message /
description The requested resource is not available.
Apache Tomcat/7.0.34
I figured that the server is working fine as it would not give me the error if it wasn't responding. The port I'm using for Tomcat is 8089. Can the reason be that maybe Eclipse is trying to use another port instead of the one I set for the server?
What can I do to run my file without having this error?
Sometimes, when you're testing a webapp project, eclipse won't adding the full path to the JSP page you want to access and try to connect to http//localhost:8080/YOURPAGE.jsp, this is problematic as the context is missing.
Why are you using port 8089 and not 8080?
It is possible that the context is missing in the tomcat server.xml, do you have a line similar to this?
<Context docBase="WebProject" path="/WebProject" reloadable="true" source="org.eclipse.jst.jee.server:LoginServlet"/></Host>

Starting tomcat in eclipse vs command line

I am using tomcat 6 and when I start it from the command line the application it's running works fine, but when I start tomcat from eclipse (I added it as a server in eclipse) I get a 404 error when I try to run the application in my browser. Any ideas why this is?
By default, when you reference an existing Tomcat instance in Eclipse, only its engine is been used. All already-deployed webapps in Tomcat's /webapps folder are ignored. You seem to expect that they are also accessible when you start Tomcat from inside Eclipse.
You need to configure the Tomcat server reference in Eclipse to set Server Locations to Use Tomcat installation instead of (default) Use workspace metadata. Double click the Tomcat server entry in Servers view to edit it.
This way, everything which is deployed to Tomcat, outside control of Eclipse, will also be available when you start Tomcat from inside Eclipse.

Tomcat and Eclipse server configuration

I installed tomcat on my ubuntu. When i create a new Dynamic Web Project I choose the tomcat 7 server. When I launch my page it works on localhost:8080/app/page but if I go on localhost:8080 it give me a 404 error.
If i start tomcat server with an external script like /etc/init.d/tomcat start, it works but I cannot launch my app because it says that the port 8080 is already occupied (by the other instance of tomcat).
I'm confused on how set everything, I would start tomcat at boot and link that instance for my apps.
Can you explain how I hato to do?
Open the server configuration in the Servers tab on Eclipse. On "Server Locations", mark "Use Tomcat installation".
EDIT: to be more precise, this will make Eclipse "take control" of your Tomcat folder. So it will not just make a replica on eclipse .metadata and deploy only your apps on it; instead it will be like if you ran bin/startup, but using some of the configuration defined on Servers view. So if you go localhost:8080 you will see the Welcome page, because /ROOT is now started by Eclipse.
So, I am not against "Starting/Stopping" the server from eclipse but to keep it simple, I think you can stop the server from eclipse (Click on windows/showview/Servers and then stop the server). Then I think you should not get an error if you start tomcat again from external script. Then you can right click on your dynamic web project in eclipse and export it as a war file inside tomcat-install--dir/webapps. Where your web application is available (on which context) depends on the web.xml file. If you need further info on this plz let me know.