• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.servlet.jsp.JspException: Not nested in a tag of proper type.

 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem Context:
Tomcat 6.0
JSF 1.2
JAVAHOME-->JDK 1.6
ECLIPSE: Helios

I follwed the tutorial "WTP Tutorials - JavaServer Faces Tools Tutorial"
When I runned as server Toncat 6 the login.jsp page I had the exception:
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.login_jsp._jspService(login_jsp.java:103)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:115)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:387)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:281)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:177)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:128)
org.apache.jsp.login_jsp._jspService(login_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

I went on the project properties-->Project Facets -->java and I noticed there are the choices 1.3 1.4 1.5 but there isn't 1.6

Could that be a jdk version problem?

Here is the login.jsp source code:
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%><%@taglib
uri="http://java.sun.com/jsf/core" prefix="f"%><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

</head>
<body>

<f:view><h:form>
<f:loadBundle basename="com.tutorial.messages" var="msg"/>
<h:messages></h:messages>
<h:panelGrid border="1" columns="2">
<hutputText value="#{msg.name}"></hutputText>
<h:inputText value="#{loginBean.name}"></h:inputText>
<hutputText value="#{msg.password}"></hutputText>
<f:validator validatorId="com.tutorial.validatePassword"></f:validator >
<h:inputSecret></h:inputSecret>

</h:panelGrid>
<h:commandButton value="Login" action="login"></h:commandButton>
</h:form></f:view></body>
</html>

And here the welcom.jsp source code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome</title>
<f:loadBundle basename="com.tutorial.messages" var="msg"/>
</head>
<body>
<f:view>
<h:form>
<hutputLabel value="#{msg.welcome} #{loginBean.name} "></hutputLabel>
</h:form>
</f:view>
</body>
</html>

I run on local Tomcat 6.0 server the login.jsp and had the exception I spoked above
Any suggestions?
Thanks
Menen
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the welcome.jsp page there is a line I don't know whether it's in the right place:

<f:loadBundle basename="com.tutorial.messages" var="msg"/>

It's within <head> tag, must it be within <body> tag?
 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eduardo,
I pasted the example on the source page, but I think you're right, so that I put the <f:loadBundle basename="com.tutorial.messages" var="msg"/> line within the body tag
Moreover I put the firt trhee line with the same order for both the jsp pages over that is
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

Now the exception is the following:
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.login_jsp._jspService(login_jsp.java:105)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.servlet.jsp.JspException: Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:115)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:389)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:283)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:179)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


Thanks Menen
 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moreover, why can't I put the project facets java to 1.6 ?
Thanks Menen
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, read the exception message...

Not nested in a tag of proper type. Error for tag with handler class:com.sun.faces.taglib.jsf_core.ValidatorTag


Look for a validator tag in the page and find out where it must be . The error says that a validator tag is not in the correct place.

 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Menen Zwerky wrote:Moreover, why can't I put the project facets java to 1.6 ?
Thanks Menen


I'm sorry, but I haven't worked with JSF.
 
Menen Zwerky
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again to all,
I changed the login.jsp page like that
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<f:view><h:form>
<f:loadBundle basename="com.tutorial.messages" var="msg"/>
<h:messages></h:messages>
<h:panelGrid border="1" columns="2">
<hutputText value="#{msg.name}"></hutputText>
<h:inputText value="#{loginBean.name}"></h:inputText>
<hutputText value="#{msg.password}"></hutputText>
<h:inputSecret value="#{loginBean.password}">
<f:validator validatorId="com.tutorial.validatePassword"></f:validator >
</h:inputSecret>

</h:panelGrid>
<h:commandButton value="Login" action="login"></h:commandButton>
</h:form></f:view></body>
</html>

I put validator tag inside inputSecret tag

Now the exception is changed like that:

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

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

exception

org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Bad version number in .class file (unable to load class com.tutorial.validatePassword)
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.faces.FacesException: javax.faces.FacesException: Bad version number in .class file (unable to load class com.tutorial.validatePassword)
com.sun.faces.taglib.jsf_core.AbstractValidatorTag.createValidator(AbstractValidatorTag.java:159)
com.sun.faces.taglib.jsf_core.ValidatorTag.createValidator(ValidatorTag.java:66)
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:119)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:429)
org.apache.jsp.login_jsp._jspx_meth_h_005finputSecret_005f0(login_jsp.java:397)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:283)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:179)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

javax.faces.FacesException: Bad version number in .class file (unable to load class com.tutorial.validatePassword)
com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1034)
com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:955)
com.sun.faces.taglib.jsf_core.AbstractValidatorTag.createValidator(AbstractValidatorTag.java:153)
com.sun.faces.taglib.jsf_core.ValidatorTag.createValidator(ValidatorTag.java:66)
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:119)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:429)
org.apache.jsp.login_jsp._jspx_meth_h_005finputSecret_005f0(login_jsp.java:397)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:283)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:179)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


root cause

java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class com.tutorial.validatePassword)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2737)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
com.sun.faces.util.Util.loadClass(Util.java:223)
com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1028)
com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:955)
com.sun.faces.taglib.jsf_core.AbstractValidatorTag.createValidator(AbstractValidatorTag.java:153)
com.sun.faces.taglib.jsf_core.ValidatorTag.createValidator(ValidatorTag.java:66)
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:119)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:429)
org.apache.jsp.login_jsp._jspx_meth_h_005finputSecret_005f0(login_jsp.java:397)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:283)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:179)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


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

Il that a problem of JDK?
Thanks Menen
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Menen Zwerky wrote:Hello again to all,
I changed the login.jsp page like that
java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class com.tutorial.validatePassword)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2737)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1124)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
com.sun.faces.util.Util.loadClass(Util.java:223)
com.sun.faces.application.ApplicationImpl.newThing(ApplicationImpl.java:1028)
com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:955)
com.sun.faces.taglib.jsf_core.AbstractValidatorTag.createValidator(AbstractValidatorTag.java:153)
com.sun.faces.taglib.jsf_core.ValidatorTag.createValidator(ValidatorTag.java:66)
javax.faces.webapp.ValidatorELTag.doStartTag(ValidatorELTag.java:119)
org.apache.jsp.login_jsp._jspx_meth_f_005fvalidator_005f0(login_jsp.java:429)
org.apache.jsp.login_jsp._jspx_meth_h_005finputSecret_005f0(login_jsp.java:397)
org.apache.jsp.login_jsp._jspx_meth_h_005fpanelGrid_005f0(login_jsp.java:283)
org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:179)
org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:130)
org.apache.jsp.login_jsp._jspService(login_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


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

Il that a problem of JDK?
Thanks Menen


Yes, your classes are compiled with a JDK incompatible with the JVM used by your Tomcat.
 
arif ansari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changed Login page to
<h:form>
<h:panelGrid border="1" columns="2">
<hutputText value="#{msg.name}"></hutputText>
<h:messages layout="table"></h:messages>
<h:inputText value="#{loginBean.name}"></h:inputText>

<hutputText value="Password"></hutputText>
<h:inputSecret value ="#{loginBean.password}">
<f:validator validatorId="com.tutorial.validatePassword" /> </h:inputSecret>

</h:panelGrid>
<h:commandButton value="Login" action="login"></h:commandButton>
</h:form></f:view></body>

Please note the space between validatePassword" and /> .THat space(or lack of it ) has been the issue .You would need to put the space
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!