Erro TOMCAT HTTP Status 404

Pessoal,

Instalei recentemente o tomcat 7 com o eclipse indico e flex 4.5.

Apenas criei um projeto flex e tentei executa-lo, mas esta ocorrendo o erro HTTP Status 404 e já não sei mais o que fazer.

Pelo meu entender não é necessário realizar nenhuma configuração de ambiente. O meu tomcat 5.5 funcionava sem problemas.

Na tentativa de solucionar o problema já tomei as seguintes precauções:

  • A pasta do tomcat esta no raiz (c:).
  • Marquei a opção Use tomcat installation.
  • Marquei a opção Publish module context to separate XML files.

O nome de minha aplicação é TesteFlex e a única alteração que fiz no web.xml foi modificar a tag welcome-file. Ficou assim: TesteFlex.html

O que aparece no browser:

HTTP Status 404 - /TesteFlex/TesteFlex/bin-debug/TesteFlex.html

--------------------------------------------------------------------------------

type Status report

message /TesteFlex/TesteFlex/bin-debug/TesteFlex.html

description The requested resource (/TesteFlex/TesteFlex/bin-debug/TesteFlex.html) is not available.

Segue abaixo o start do tomcat:

18/09/2011 13:53:34 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre6/bin/client;C:/Program Files (x86)/Java/jre6/bin;C:/Program Files (x86)/Java/jre6/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;C:\Program Files (x86)\Windows Live\Shared;C:\eclipse;
18/09/2011 13:53:34 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
18/09/2011 13:53:34 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
18/09/2011 13:53:34 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 567 ms
18/09/2011 13:53:34 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
18/09/2011 13:53:34 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.21
18/09/2011 13:53:34 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor testeflex.xml from C:\apache-tomcat-7.0.21\conf\Catalina\localhost
18/09/2011 13:53:34 org.apache.catalina.startup.SetContextPropertiesRule begin
AVISO: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TesteFlex' did not find a matching property.
18/09/2011 13:53:36 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
18/09/2011 13:53:36 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
18/09/2011 13:53:36 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
18/09/2011 13:53:36 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
18/09/2011 13:53:36 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1bfbfb8')
18/09/2011 13:53:36 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
18/09/2011 13:53:36 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
18/09/2011 13:53:36 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
18/09/2011 13:53:36 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
18/09/2011 13:53:36 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
18/09/2011 13:53:36 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1862 ms

Post seu web.xml, axo q o problema está lá…

Segue meu web.xml, mas como falei a unica alteração que fiz foi adicionar TesteFlex.html

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>TesteFlex</display-name>

	<context-param>
		<param-name>flex.class.path</param-name>
		<param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
	</context-param>

	<!-- Http Flex Session attribute and binding listener support -->
	<listener>
		<listener-class>flex.messaging.HttpFlexSession</listener-class>
	</listener>

	<!-- MessageBroker Servlet -->
	<servlet>
		<servlet-name>MessageBrokerServlet</servlet-name>
		<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
		<init-param>
			<param-name>services.configuration.file</param-name>
			<param-value>/WEB-INF/flex/services-config.xml</param-value>
		</init-param>
		<init-param>
			<param-name>flex.write.path</param-name>
			<param-value>/WEB-INF/flex</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>MessageBrokerServlet</servlet-name>
		<url-pattern>/messagebroker/*</url-pattern>
	</servlet-mapping>
  <welcome-file-list>
    <welcome-file>TesteFlex.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

	<!-- for WebSphere deployment, please uncomment -->
	<!--
		<resource-ref>
		<description>Flex Messaging WorkManager</description>
		<res-ref-name>wm/MessagingWorkManager</res-ref-name>
		<res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
		<res-auth>Container</res-auth>
		<res-sharing-scope>Shareable</res-sharing-scope>
	</resource-ref>
	-->
</web-app>

Pode ser problema de versão ou incompabilidade entre diferentes versões do tomcat.