Opening multiple servers on the same port - eclipse

I am really new to web development. I have installed tomcat v7.0 and jboss v4.2 on my windows7 64bit OS. The editor is Eclipse Juno. I start the Tomcat ( within eclipse ), and type the address
http://localhost:8080
It opens me the tomcat welcome page ( the one with the cat ) -- > In IE, Google Chrome.
But the same address opens the Jboss welcome page , when opened in Firefox.
Remember that Jboss is stopped during this whole time.Only tomcat is running

On the same TCP port only one server can listen. Could you write a bit more on your setup? Do you run both tomcat and jboss separately, or you deploy jboss into tomcat? From what you wrote I assume the latter.
Also, are you sure these two pages are on the same url?

Related

Tomcat can be started using startup.bat but not from eclipse

I have installed apache tomcat 7.0.47. I have used netbeans for a while, now i want to try eclipse. I've installed eclipse kepler. I have created my first struts application using it.
I have deployed few applications from netbeans which worked well. Now i cannot start up the tomcat server from eclipse. I'm getting message as
Several ports (8005, 8181, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I have checked that no javaws.exe running in process explorer. Also checked no processes using the port 8181 using netstat.
When i start the tomcat from bin using startup.bat it starts normally and i have checked in browser. It is showing the default page on localhost:8181 and listed in netstat.
Any way to start my first struts application in eclipse. Tried almost every thing but no improvement.

running java web projects using Eclipse and tomcat issue

I have installed tomcat 7.0.37 and Eclipse juno on ubuntu 12.10 and build my first jsp based web app. but when I hit run as -> run on server eclipse shuts down. one issue is that on restart tomcat does not start and pops the error:
Several ports (8005, 8081, 8009) required by Tomcat v7.0 Server at localhost (2) are already > in use. The server may already be running in another process, or a system process may be >using the port. To start this server you will need to stop the other process or change the >port number(s).
In Tomcat installation folder, you can find a folder called conf and in that you can find a XML file server.xml.
This file contains the ports Tomcat has to use. Update that file with different port numbers and try again.
Okay, at last I solved it. first I changed the default browser from internal to system default and it solved the eclipse shut down. second I moved the files into the Web Content folder under project structure. and now I have a running JSP application. thanks to all geeks on web.
:)
If You use eclipse then double click on servers and double click on tomcat server then one file will open. in that change HTTP port to some other port number and save(ctrl+s) then again start the server . it may be work fine

Apache Tomcat 7 and Eclipse Juno EE integration (Ubuntu 12.04)

I am currently setting up a Web Service environment for developing SOAP Web services in a linux box (Ubuntu 12.04). I want to use Eclipse EE Juno with Apache Tomcat 7. I successfully install tomcat (using the sudo apt-get install) and configure it as a Server runtime environment in Eclipse. When, I deploy a web service in order to test it, everything works fine. However, when I type the URL to my browser, nothing works. It seems that Apache tomcat is up and running, but no web services are deployed (in fact i receive an HTTP Status 404 from tomcat). Being curious, I go to "/var/lib/tomcat7/webapps/" directory in order to check if any web application is deployed, and there are no web applications.
What may be the matter? How can I configure correctly my tomcat in order to work with Eclipse and be able to deploy and test my web applications through the IDE?
Thank you.
Problem solved by configuring to IDE to have all the pribileges on the server.

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.

Why eclipse always complain that the tomcat server port is in use?

I have a eclipse web project source code, the name of the project is "My-Proj" .
I download Eclipse Java EE version (Indigo) , extract the achive, then I started the eclipse IDE. After I successfully installed tomcat7 server into the Eclpse IDE. I import my existing project to Eclipse IDE.
Then I run my imported project by choose "Run on server", but eclipse pop up the error message window like below:
I saw the port has been used, so I change the server running port by double click on tomcat server V7 under Eclipse "server" tab, and change the port to 8085 as below (see the right side of the image):
Please right click the image and view the image if you can not see clearly.
I run the project on server again , but I got the same error, port 8080 is in use, why? I have changed the port number to 8085, why it still complain the port 8080?
You need to change the one labeled "HTTP/1.1" not "Tomcat admin port" (in your image above on the right hand side where ports are).
Second you probably have an existing tomcat running that was not shutdown (unless you purposely have something else running on 8080). Shutdown eclipse and then look for any running java process that look like tomcat and kill them.
As Adam said, you'll need to change the HTTP/1.1 port if you want to have Eclipse's tomcat running on a different port to avoid the conflict.
However, this conflict is usually because your installed Tomcat is also running outside eclipse. You probably don't need two Tomcat instances running at the same time, so you might want to shut down the non-eclipse one. You can do this using the services panel in Windows, or using init.d on linux.
If you have multiple tomcat instances, try to change all ports in elipse - tomcat admin port, http/1.1, AJP. It works for me - I have eclipse from tomcat and netbeans on one machine.
Remember about firewall - it may be problem.