The project (JSF 2.0.6!) executes fine, some pages load with no problem, others don't.
This is the full stack trace. If there is any code needed, ask for.

org.apache.el.parser.ParseException: Encountered " "}" "} "" at line 1, column 9.
Was expecting:
<IDENTIFIER> ...

at org.apache.el.parser.ELParser.generateParseException(ELParser.java:2215)
at _consume_token(ELParser.java:2097)
at org.apache.el.parser.ELParser.DotSuffix(ELParser.java:1064)
at org.apache.el.parser.ELParser.ValueSuffix(ELParser.java:1033)
at org.apache.el.parser.ELParser.Value(ELParser.java:978)
at org.apache.el.parser.ELParser.Unary(ELParser.java:948)
at org.apache.el.parser.ELParser.Multiplication(ELParser.java:712)
at org.apache.el.parser.ELParser.Math(ELParser.java:632)
at org.apache.el.parser.ELParser.Compare(ELParser.java:444)
at org.apache.el.parser.ELParser.Equality(ELParser.java:338)
at org.apache.el.parser.ELParser.And(ELParser.java:282)
at org.apache.el.parser.ELParser.Or(ELParser.java:226)
at org.apache.el.parser.ELParser.Choice(ELParser.java:183)
at org.apache.el.parser.ELParser.Expression(ELParser.java:175)
at org.apache.el.parser.ELParser.DeferredExpression(ELParser.java:113)
at org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:41)
at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:116)
at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:172)
at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:217)
at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:67)
at com.sun.faces.facelets.el.ELText$ELTextVariable.apply(ELText.java:201)
at com.sun.faces.facelets.el.ELText$ELTextComposite.apply(ELText.java:182)
at com.sun.faces.facelets.compiler.CommentInstruction.apply(CommentInstruction.java:81)
at com.sun.faces.facelets.compiler.UIInstructionHandler.apply(UIInstructionHandler.java:141)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:166)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:113)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:769)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Dani AI

Generated

Short summary and root cause (what happened)
An EL parse error like this generally means Facelets tried to evaluate an invalid Expression Language fragment that was present in the page source—often an empty or incomplete EL (for example: a bean name followed by a dot but no property). That happens even when the fragment is inside an HTML comment: Facelets still scans template text for EL and the EL parser will choke on malformed expressions. ’s diagnosis (the commented listener containing an incomplete EL) is exactly the usual trigger for this exception. (stackoverflow.com)

Safe fixes and workarounds

  • Fix or remove the incomplete EL (best and simplest option).

  • Prevent Facelets from ever seeing the fragment by wrapping it in ui:remove so it’s removed from the component tree entirely:

    <ui:remove>
      <!-- markup or JSF tags to hide during rendering -->
    </ui:remove>
  • Escape the EL so Facelets will not evaluate it, e.g. prefix the opening delimiter with a backslash: \#{bean.some} (this leaves the text in the template but stops evaluation).

  • If the component should remain in the view but be disabled, use a valid rendered="false" or similar attribute rather than commenting it out. (stackoverflow.com)

Global option (affects every page) and a caution
To make Facelets skip processing HTML comments globally, add a context-param in web.xml. Parameter name varies by JSF version (example for JSF 2.x / older and Jakarta Faces):

<context-param>
  <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
  <param-value>true</param-value>
</context-param>

<!-- or for modern Jakarta Faces -->
<context-param>
  <param-name>jakarta.faces.FACELETS_SKIP_COMMENTS</param-name>
  <param-value>true</param-value>
</context-param>

Be careful: this removes all comments from Facelets processing and can break things that rely on raw comments (IE conditional comments, etc.). Use this only if the project-wide behaviour is acceptable. (stackoverflow.com)

Practical troubleshooting steps
Search the view files for #{ occurrences or grep for suspicious patterns (empty braces, trailing dots). Facelets stack traces include file, line and column—use those to pinpoint the offending template. If multiple includes or composite components are used, check each included fragment for stray/unfinished EL. The simplest immediate remedy is to remove or correct the offending EL or wrap it in <ui:remove> while investigating. (stackoverflow.com)

Recommended Answers

All 2 Replies

Alex you will need to post code

I found out the problem! It is a bug in JSF 2.0. The whole problem is in a commented line... <!-- <f:actionListener binding="#{books.}"/> --> Without it everything works like a charm!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
<h:head></h:head>
<h:body>

	<ui:composition>
		<h:form>
				<h:commandLink  actionListener="#{nav.setSelected('Books')}" 
					styleClass="#{nav.getCSSStyle('Books')}">
				<!-- 	<f:actionListener binding="#{books.}"/> -->
				Books
				</h:commandLink> 
		<br/>
				<h:commandLink actionListener="#{nav.setSelected('Electronics')}" 
				styleClass="#{nav.getCSSStyle('Electronics')}">Electronics</h:commandLink>
		<br/>	
				<h:commandLink actionListener="#{nav.setSelected('Tools')}" 
				styleClass="#{nav.getCSSStyle('Tools')}">Tools</h:commandLink>
		</h:form>
	</ui:composition>
	
</h:body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.