No puedo acceder a mi aplicación web usando eclipse, apache2 y tomcat7 (Ubuntu)
Frecuentes
Visto 364 equipos
0
I'm quite a rookie about servlets, but I should deploy an Eclipse web project running on a Tomcat server (only localhost). The whole process worked fine on Windows but recently I had to move to Ubuntu 12.04 and I have this problem when I want to access the app:
If I start apache2 and tomcat7 first, the output of
sudo netstat -lpn |grep :80
Se ve como esto:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12231/apache2
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 12848/java
tcp6 0 0 :::8080 :::* ESCUCHAR 12848/java
then I try to start the server in eclipse and face this error:
Several ports (8005, 8080) required by cdrserver 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).
Alright, let's kill these processes (although it seems that Tomcat uses them since when i stop tomcat, the 2 tcp6 processes disappear).
Now I'm able to start the Eclipse server, without a single warning:
Nov 27, 2013 10:59:24 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.Catalina load
INFO: Inicialización procesada en 869 ms
Nov 27, 2013 10:59:24 AM org.apache.catalina.core.StandardService startInternal
INFO: Servicio de inicio Catalina
Nov 27, 2013 10:59:24 AM org.apache.catalina.core.StandardEngine startInternal
INFORMACIÓN: Inicio del motor de servlet: Apache Tomcat / 7.0.26
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Text_manipulator
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/.metadata
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Servers
Nov 27, 2013 10:59:26 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.Catalina start
INFORMACIÓN: Inicio del servidor en 2101 ms
Now, if I type the usual (like on Windows) URL to the browser: localhost/cdr I get this:
Extraviado
The requested URL /cdr was not found on this server.
Servidor Apache / 2.2.22 (Ubuntu) en el puerto localhost 80
Same happens with localhost/manager (I got this tip lately).
Moreover, using localhost:8080/cdr results in a totally blank page.
Here are my Eclipse server settings: http://i.imgur.com/lV6FwTm.png
I also checked the web.xml file in the project, it has the following servlet classes and related mappings:
Caras Servlet
Trinidad Resource Servlet
Servlet de recursos
Spring MVC Dispatcher Servlet
¿Me estoy perdiendo algo obvio?
1 Respuestas
0
The requested URL /cdr was not found on this server.
Servidor Apache / 2.2.22 (Ubuntu) en el puerto localhost 80
Firstly your URL should be something like localhost:8080
, No localhost
since this defaults to localhost:80
and you have apache2 running on your system thats why you get the 404 message of the apache server.
Secondly , I am concerned about the resources being deployed as shown by your logs
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Text_manipulator
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
**INFO: Deploying web application directory /home/aron/workspace/.metadata** --> ?
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
**INFO: Deploying web application directory /home/aron/workspace/Servers** --> ?
Nov 27, 2013 10:59:26 AM org.apache.coyote.AbstractProtocol start
Que es .metadatos ? Isn't this one of the hidden folders created by eclipse to manage workspace. This shouldn't be deployed.
También lo que es Servidores ? This looks like the server project from eclipse.
I don't see any resource namely cdr
being deployed from the logs. So first you need to verify that this particular resource is deployed at all. Secondly, I would advise you to do some reading on how Tomcat works aquí.
Respondido el 20 de junio de 20 a las 10:06
Thanks for the answer, beginning from the tutorial you sent I managed to grab a hold on the app finally! - user2870283
Me alegro de haber podido ayudar - saif asif
I can't see any project/directory named
cdr
deployed in the logs. Can you verify that this particular resource is present in the deployment folder webapps/wtpwebapps ? - Saif AsifNo, the wtpwebapps folder only contains a ROOT/WEB.INF/web.xml structure, xml content is 3 lines with a detailed web-app tag. Is there a possible way to make up for the missing resource? - user2870283