Solved

Getting another JasperException! Maybe Struts Tag version problem?

Posted on 2008-06-11
13
640 Views
Last Modified: 2013-12-02
I get the following error message on accessing of my login.jsp:

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
The method _jspx_meth_html_text_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag, PageContext)

Generated servlet error:
The method _jspx_meth_html_password_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag, PageContext)

I'm attaching the Code snippet as part of the evidence.  Basically, I'm deploying an application on jboss 4.0.4GA that contains a login.jsp that in turn contains struts tags.  Hope somebody can help?

Herewith the stack trace:
=====================
13:25:40,192 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
The method _jspx_meth_html_text_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag, Pa
geContext)

Generated servlet error:
The method _jspx_meth_html_password_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag
, PageContext)


        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
        at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:534)
The Login.jsp:

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

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
 

<html>

<HEAD>

<META http-equiv="Content-Style-Type" content="text/css">

<LINK href="<%=com.fnb.p4p.service.constants.WebConstants.P4P_CONTEXT%>config/PFPStyle.css" rel="stylesheet" type="text/css">

<TITLE>Pay For Performance</TITLE>

<script language="JavaScript" type="text/JavaScript">
 

</HEAD>

<BODY>

	<table width="100%">

	<tr>

		<td>

		<table width="100%">

			<tr>

			<td class="headerlogo"width="20%" >

					<p>

						<img src="<%=com.fnb.p4p.service.constants.WebConstants.P4P_CONTEXT%>config/Header.gif"

						width="440px" height="85px">

						</p>

				</td>

				<TD width="68%" height="22%"><BR>

				<H1 class="p4pTitle" >Pay for Performance</H1>

				</TD>

				<td class="fnblogo" width="12%">

				<p>

					<img src="<%=com.fnb.p4p.service.constants.WebConstants.P4P_CONTEXT%>config/FNBLargeLogo.gif"

					width="280px" height="85px">

					</p>

					

				</td>				

			</tr>					

		</table>

	</td>

	</tr>

</table>

<table>

	<tr>

		<td >&nbsp;</td>

	</tr>

</table>
 

<html:form action="/login" method="post">

<%

	String error = (String)pageContext.getRequest().getParameter("error");

	if (error != null && error.equals("true")) {

%>

	<center><font color="red">Invalid Credentials Provided</font></center>

<%

	}

	String message = (String)pageContext.getRequest().getParameter("message");

	if (message != null) {

%>

	<center><font color="red"><%=message%></font></center>

<%	

	}

%>	

	<h2 class="SubNav0">Login</h2>

	<TABLE border="0" align="center">

		<TBODY>		

			<TR>

				<TH align="left">Employee Number</TH>

				<TH align="left">

					<html:text property="userName"/>

				</TH>

			</TR>
 

			<TR>

				<TH align="left">Password</TH>

				<TH align="left">

					<html:password property="password" />

				</TH>

			</TR>

			<TR>

				<TH colspan="2">

					<a href="login" onclick="javascript:document.forms['loginForm'].submit()">TEST</a>

				</TH>

			</TR>

		</TBODY>

	</TABLE>

</html:form>
 

<hr class="hr">

<p class="copyright">© Copyright First National Bank - A division of FirstRand Bank Limited.<br>

All rights reserved. 

</p>

</BODY>

</html>

Open in new window

0
Comment
Question by:sakkie6yster
  • 5
  • 5
13 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 21789738
You are passing the wrong parameters. Can you show us the code where the error occurs?
0
 

Author Comment

by:sakkie6yster
ID: 21800134
I am showing you the code where the error occurs in the snippet?  It occurs on the jsp, to be specific, it looks like it happens on these two lines:

<html:text property="userName"/>
 and
<html:password property="password" />


hence the error:

Generated servlet error:
The method _jspx_meth_html_text_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag, Pa
geContext)

Generated servlet error:
The method _jspx_meth_html_password_0(JspTag, PageContext) in the type login_jsp is not applicable for the arguments (FormTag
, PageContext)




0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 21801295
Not sure but if in doubt it's always a classpath problem. Can you check if you have duplicate jars in your classpath?
0
 

Author Comment

by:sakkie6yster
ID: 21801307
I will try and see, do you perhaps know which jars I should look out for?
0
 
LVL 35

Expert Comment

by:girionis
ID: 21801386
Check mainly for Struts jar or jar files that Struts is using.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:sakkie6yster
ID: 21802773
The servlet-api.jar was loaded twice.  Thank you very much!
0
 

Author Closing Comment

by:sakkie6yster
ID: 31466118
Thank you very much, I found that the servlet-api.jar was loaded twice, it was packaged into the ear by maven.  So I had to add a tag to the pom to ensure maven didn't include this jar into the ear package.
0
 
LVL 35

Expert Comment

by:girionis
ID: 21802876
Ahh... I see. Nice you got it working. Thanks for the points :)
0
 

Author Comment

by:sakkie6yster
ID: 21802910
you're welcome.  is there anyway of using you specifically next time I need help?
0
 
LVL 35

Expert Comment

by:girionis
ID: 21803811
If you post here I will see it, although it might take a bit of time. I usually look to a question when I get a reminder since I don't have enough time to go through all the questions posted daily. It might take some time but I will look into that and if I know I will try to help :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
fetching the full url inside controller 2 36
mergeTwo  challenge 13 72
wordcount challenge 11 76
HashMap Vs TreeMap 12 49
-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now