javax.faces.view.facelets.FaceletException: Error Parsing /: Error Traced[line: 1] Content is not allowed in prolog

927 Views Asked by At

Getting this kind of error.


2020-05-29 01:38:29,519 ERROR [stderr] (default task-20) javax.faces.view.facelets.FaceletException: Error Parsing /: Error Traced[line: 1] Content is not allowed in prolog.
2020-05-29 01:38:29,519 ERROR [stderr] (default task-20) at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:456)
2020-05-29 01:38:29,519 ERROR [stderr] (default task-20) at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:430)
2020-05-29 01:38:29,519 ERROR [stderr] (default task-20) at com.sun.faces.facelets.compiler.Compiler.compile(Compiler.java:124)

The below is what i have used..

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"     
                xmlns:p="http://primefaces.org/ui"            
                xmlns:f="http://java.sun.com/jsf/core" 
                xmlns:ui="http://java.sun.com/jsf/facelets"                    
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">....................</ui:composition>

Please help me to solve this out.!

1

There are 1 best solutions below

1
Birol Efe On

Be careful with the "<!-- -->"-Comments within your XHTML. May cause this problem.