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.
Related
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!
I am trying to run a glassfish local server from Intellij Idea and have some troubles. The server only wants to run from terminal via sudo command, and the Intellij runs by default without sudo, so how do I fix it? Do I have to make the file to always get executed as sudo(if yes, then how) or should I set in the Idea configs to run that specific file as sudo?
All information consists in this guide: "Run/Debug Configuration: GlassFish Server".
I solved this by unzipping this to my home directory and changed the location of glassfish inside idea to the new location.
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.
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.
I am working on an academic project using Eclipse 3.X , jsp's, servlet's etc. The server i chosed to deploy my application is "Tomcat 6.0".
when i change any of my code in the application, i am facing problem with running the application. the changes in the code are not showing any affect even though i restart the server. the changes only get affected, if i restart my eclipse. i tried lot of ways by googling about integration of eclipse with tomcat but nothing worked?. I always have to restart the eclipse, to see my changes.
Please help me with this issue.
thanks in advance.
You should simply be able to use the "republish" feature after saving/building.
1, If the development path and deployment path is the same dictionary, make sure that the "Build Automatically" is checked, it's in "Project->Build Automatically", it can help you deploy the files which are changed.
2, If the development path and deployment path is not the same dictionary, you can write an ant task to deploy project.
if u are running in eclipse it is running the tomcat server of eclipse so for changes to be affected it should be refresh so u have to restart eclipse better way is to use outside eclipse and use localhost and tomcat manager u can restart and can see the changes or use ajax