JBWEB004192: A literal value was specified for attribute ... that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case in JBoss EAP 6
Issue
- We are migrating a legacy application to JBOss EAP 6.x and it is failing on one of our JSF / JSP files with this error:
org.apache.jasper.JasperException: /index.jsp(7,4) JBWEB004192: A literal value was specified for attribute valueChangeListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:145)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:96)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1115)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:844)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:862)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:862)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2427)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2433)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2377)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1768)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:211)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:359)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:326)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:606)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
com.sun.faces.context.ExternalContextImpl.dispatch(Unknown Source)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(Unknown Source)
com.sun.faces.application.ViewHandlerImpl.renderView(Unknown Source)
com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
javax.faces.webapp.FacesServlet.service(Unknown Source)
The JSP is :
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<html>
<body>
<h:form>
<h:selectOneRadio id="radio" valueChangeListener="#{bean.handleValueChange}" value="#{bean.value}">
<f:selectItem itemLabel="One" itemValue="1"/>
</h:selectOneRadio>
</h:form>
</body>
</html>
</f:view>
The web.xml specifies 2.3 version :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
...
</web-app>
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
