TeiTei
Abril 2, 2008, 8:22am
#1
Galera eu to me matanda de tentar deixar o meu web.xml no esquema para rodar jsf e nao rola, o que eu tenho que fazer para conseguir? segue abaixo o meu web.xml, me ajudem ai por favor…valeu…
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>
Seu web.xml está certo… essa é a configuração básica pro JSF funcionar…
Você só precisa excluir essas linhas pois estão duplicadas:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
Mas… qual o erro que está ocorrendo?
TeiTei
Abril 2, 2008, 8:48am
#3
[code]
HTTP Status 404 - /teste/
type Status report
message /teste/
description The requested resource (/teste/) is not available.
JBossWeb/2.0.1.GA[/code]
Lao
Abril 2, 2008, 9:03am
#4
No teu web.xml não está mapeado o /teste/ para lugar nenhum. Tente acessar usando /faces/ …
Provavelmente houve alguma exception quando o JBoss foi iniciado.
Pode postar a exception para nós? fica mais fácil analisar pelo erro gerado
TeiTei
Abril 2, 2008, 9:13am
#6
MBeans waiting for other MBeans ---
ObjectName: jboss.web.deployment:war=AplicacaoTesteWeb.war,id=607815654
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/tmp/deploy/tmp40015AplicacaoTesteWeb-exp.war/ deployment failed
ObjectName: jboss.web.deployment:war=TesteJSF.war,id=-1893583921
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/deploy/TesteJSF.war/ deployment failed
ObjectName: jboss.web.deployment:war=WEB.war,id=1782017874
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/tmp/deploy/tmp40016WEB-exp.war/ deployment failed
ObjectName: jboss.web.deployment:war=teste.war,id=680978804
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/deploy/teste.war/ deployment failed
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.web.deployment:war=WEB.war,id=1782017874
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/tmp/deploy/tmp40016WEB-exp.war/ deployment failed
ObjectName: jboss.web.deployment:war=TesteJSF.war,id=-1893583921
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/deploy/TesteJSF.war/ deployment failed
ObjectName: jboss.web.deployment:war=AplicacaoTesteWeb.war,id=607815654
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/tmp/deploy/tmp40015AplicacaoTesteWeb-exp.war/ deployment failed
ObjectName: jboss.web.deployment:war=teste.war,id=680978804
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/deploy/teste.war/ deployment failed
10:11:52,270 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
10:11:52,339 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
10:11:52,382 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 1m:12s:381ms
Estou com o mesmo problema.
Abaixo meu web.xml
Tomcat não dá erro nenhum no deploy. Mas quanto tento acessar:
description The requested resource (/Imoveis/pages/principal.jsf) is not available.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<description>Facelets StarterKit</description>
<display-name>Imoveis</display-name>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
<param-value>classic</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
Como ficou esse post?
Conseguiram solucionar o problema?
O que fizeram?
Bem, a solução pra mim foi baixar as bibliotecas .jar equivalentes ao JSF.
Este site explica como configurar um projeto web jsf.