Iniciante jsf

10 respostas
fabiobufalari

pessoal nao sei resolver isse problema, alguem pode me ajudar?

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html">
      
      <h:head>
      	<title>
      	
      	Vamos Ver Se esse Trem Funciona.
      		
      	</title>
      	
      </h:head>
      </html>

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error Parsing /olaMundo.xhtml: Error Traced[line: 2] The processing instruction target matching “[xX][mM][lL]” is not allowed.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)

root cause

javax.faces.view.facelets.FaceletException: Error Parsing /olaMundo.xhtml: Error Traced[line: 2] The processing instruction target matching [xX][mM][lL] is not allowed.

com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:425)

com.sun.faces.facelets.compiler.SAXCompiler.doMetadataCompile(SAXCompiler.java:408)

com.sun.faces.facelets.compiler.Compiler.metadataCompile(Compiler.java:130)

com.sun.faces.facelets.impl.DefaultFaceletFactory.createMetadataFacelet(DefaultFaceletFactory.java:327)

com.sun.faces.facelets.impl.DefaultFaceletFactory.access$200(DefaultFaceletFactory.java:93)

com.sun.faces.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:166)

com.sun.faces.facelets.impl.DefaultFaceletFactory$2.newInstance(DefaultFaceletFactory.java:164)

com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:94)

com.sun.faces.facelets.impl.DefaultFaceletCache$2.newInstance(DefaultFaceletCache.java:89)

com.sun.faces.util.ExpiringConcurrentCache$1.call(ExpiringConcurrentCache.java:99)

java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

java.util.concurrent.FutureTask.run(Unknown Source)

com.sun.faces.util.ExpiringConcurrentCache.get(ExpiringConcurrentCache.java:114)

com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:143)

com.sun.faces.facelets.impl.DefaultFaceletCache.getViewMetadataFacelet(DefaultFaceletCache.java:62)

com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:260)

com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)

com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)

com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:230)

com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113)

com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.26 logs.


Apache Tomcat/7.0.26

10 Respostas

L

try

&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"&gt;
fabiobufalari

Muito obrigado pela dica, procurei sim mas quando nao se sabe muito sobre o assunto, as vezes acaba procurando da forma errada.
fiz o que vc indicou, resolveu em partes, mas ainda continua dando o a seguinte mensagem.
–> The processing instruction target matching “[xX][mM][lL]” is not allowed.

rmendes08

Basta colocar a tag

<h:body></h:body>

logo após </h:head>, mas dentro de

fabiobufalari

puxa vida acho que nao estou com muita sorte.
agora acho que é o Apache.

se puder ajude me.
HTTP Status 404 - /PM/


type Status report

message /PM/

description The requested resource (/PM/) is not available.


Apache Tomcat/7.0.26

Console
08/03/2012 13:38:20 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\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Rockwell Software\RSCommon;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Dell\DW WLAN Card;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Internet Explorer;C:\Program Files (x86)\VDownloader;.
08/03/2012 13:38:21 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVISO: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:PM’ did not find a matching property.
08/03/2012 13:38:21 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“http-bio-8080”]
08/03/2012 13:38:21 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“ajp-bio-8009”]
08/03/2012 13:38:21 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1309 ms
08/03/2012 13:38:21 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
08/03/2012 13:38:21 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
08/03/2012 13:38:23 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Inicializando Mojarra 2.1.0 (FCS FCS) para o contexto ‘/PM’
08/03/2012 13:38:24 com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
08/03/2012 13:38:24 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“http-bio-8080”]
08/03/2012 13:38:24 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [“ajp-bio-8009”]
08/03/2012 13:38:24 org.apache.catalina.startup.Catalina start
INFO: Server startup in 3248 ms

fabiobufalari

pessoal o que será que tem de errrado com meu eclipse ou minha aplicação? sera que alguem pode me ajudar ?
obrigado

R

Mostra como vc mapeou o servlet do Faces no web.xml

fabiobufalari

TA NA MÃO.

<?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_2_5.xsd" 
		 id="WebApp_ID" 
		 version="2.5">
		 
		 
		 
		 
		 
  <display-name>PM</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  <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>
</web-app>
R

Existe um ‘hack’ que precisa ser feito

Uma vez que a página é index.jsp e o mapeamento é .jsf,vc tem q fazer um redirecionamento pra poder funcionar:
Ex:
index.jsp

&lt;jsp:formard page="/principal.jsf"&gt;
fabiobufalari

Ficaria assim? se nao for isso pode me explica um pouco mais? de onde e como devo fazer.
obrigado

<?xml version="1.0" encoding="UTF-8"?>
[b]<jsp:formard page="/principal.jsf">[/b] 
<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_2_5.xsd" 
		 id="WebApp_ID" 
		 version="2.5">
		 
		 
		 
		 
		 
  <display-name>PM</display-name>
  <welcome-file-list>
  
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  <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>
</web-app>
fabiobufalari

Meu problema foi resolvido da seguinte forma, botao direito no projeto, propiedades,project Facets, no canto direito parte superior Runtimes, selecione seu servidor que no meu caso era o “Apache Tomcat V7.0”.
pessoal muito obrigado.

Criado 8 de março de 2012
Ultima resposta 10 de mar. de 2012
Respostas 10
Participantes 4