Why not able to run the servlet on Tomcat server? - java

I have created the servlet program on the different location of Workspace and after that I created another location of workspace I am getting the error
But this error doesn't come when I run it on previous workspace location, and also I have closed the previous workspace still getting the error.

As the error clearly states, some other program is already listening on those ports.
You can use TCPView to find out what.

It seems you have launched the project from both the workspaces, who are trying to use the same tomcat instance. So when the second Tomcat instance is launched it encounters port already in use error.

Related

Tomcat in Eclipse is giving error 404:requested resource not found

I am making a project in Java which is a online web application. I am facing issues with Tomcat 8 and jsp, if I try to run my jsp files on server it gives an error that 404:requested resource now found.
I tried every way given on you channel but nothing helped. Now I'm at an stage I have configured the server 100 times and nothing helps. I created a new project on other workspace and copied everything there and then run those jsp files it executed well for once and then after that when I stopped the server it again started giving the same error.
Whenever I restart the server the server does not start and gives error Tomcat failed to start and then when I remove my project below the server name it starts. If I configure new server same happens.
I can't figure out where the problem lies as earlier I was able to run my project using same Eclipse Luna IDE.
Based on your question, it seems you need to configure eclipse to take control from Tomcat.
Maybe this can help as well: HTTP Status 404 - The requested resource (/) is not available

Deployment springboot project on server with error

I can run the project in IDEA, however,I put the project in tomcat/webapps, but it can't work. Who can help me solve this problem? thank you!
The last exception screen shot basically shows that your container did not start as the port that you have given is already in use by a different process.
Error showing that your 8080 port is already bind or running by some other application.Either change port or kill 8080 from other application.
Do mvn-clean, mvn-compile on your project directory.
Clean your tomcat server directory, right click on server->properties->switch location from workspace metadata to /server/tomcat...
If any other process is running on your server then stop it, clean Tomcat directory then restart server. If in case, then too it doesn't works then delete the server and configure it again.

tomcat unable to publish due to deleted java.orig file

I used a merge tool to merge my code with the upstream branch which created a .orig file for one of my java classes. After verifying that everything was working fine I saw not need to keep the .java.orig file around so I deleted it.
Now whenever I try to deploy to tomcat from eclipse I get the following error:
'Publishing to Tomcat v8.0 Server at localhost..' has encountered a problem.
Resource '.../MyClass.java.orig' does not exist.
I've tried removing all applications off the server and removing the server from eclipse and then recreating it but to no avail.
I'm running out of things to try and I'm not sure what dependency tomcat thinks my project has on the .orig file. Any help is appreciated.
Ok so rebooting my machine seemed to have fixed the issue I was able to start tomcat normally after that using the same eclipse workspace. I'm not sure what the underlying issue actually was but the restart seemed to fix it.

Eclipse Tomcat Port Change or Test in the Regular Tomcat Instance

This is a Windows 7 development environment where Tomcat 7 is set to autostart in c:\tomcat7 folder. That does work fine but I want to test my Java (.JSP) code right inside Eclipse Neon interface. So I configure Tomcat inside Eclipse by pointing to c:\tomcat7 folder but I get the port 8080 already in use error.
I know what's happening: Tomcat is trying to start but it is already running. So I duplicated the c:\tomcat7 folder to a c:\tomcat7_for_eclipse folder, pointed Eclipse to that, then changed the port to 8081 via Eclipse but I now get an error:
Tomcat couldn't start;
and doing that actually stops the port 8080 instance of Tomcat.
There must be a simpler way to quickly deploy to the actual Tomcat to test applications or to do the port route as I tried above?
I am very new to Java, Eclipse, and Tomcat. So please bear with me: I have looked at online solutions but nothing helping so far.
Thanks!
I think I got the two instances of Tomcat working simultaneously. Here is what I ended up doing:
1) Left the original instance of Tomcat on port 8080 as such
2) Inside Eclipse, added a new Server and this time downloaded to a c:\tomcat7_for_eclipse2 folder.
3) Inside Eclipse, changed the ports to 8081 etc for the newly downloaded instance of Tomcat
This seems to be working fine: Both the regular instance of Tomcat continues to run while I can now launch the new instance of Tomcat right from inside Eclipse and quickly view my .JSP file's dynamic code.
This is sort of like what Microsoft Visual Studio does. I know it's not some 'best practices' but it keeps my development environment simpler.
Thanks to all for their help!

eclipse can not start up my tomcat server, how to turn the server on

when i try to run the jsp-file using eclipse, eclipse shows me that my tomcat server is turned off although i turned it on from 'startup.bat' file which is located in the bin directory inside the tomcat installation folder.
I encounter the error shown in the image posted below.how to solve it?
When you configure Tomcat using Runtime configuration in eclipse, then you need NOT to run the tomcat manually. When you execute a server side program such as jsp/servlet, eclipse will first start the associated runtime(Tomcat) and then deploy your jsp/servlet on it.
In your case, as you have manually started the Tomcat, so when eclipse tries to launch the same tomcat, it throws and error saying port already in use.
It seems your sever is already in running state and you are trying to start again.
Any chance you started your server though comand prompt, before trying in eclipse.
If exsist try kiiling the java process of the server in task manager and try again
Let Eclipse handle the Tomcat instance. Run shutdown.bat, then start Tomcat from Eclipse by clicking Windows->Show view->Servers, right click and Start.

Categories

Resources