aspose file tools*
The moose likes JSP and the fly likes wrong jar reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "wrong jar reference" Watch "wrong jar reference" New topic
Author

wrong jar reference

ashwin venkat
Greenhorn

Joined: Mar 03, 2012
Posts: 8
here's the error i have got....

javax.servlet.ServletException: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

but the javax.servlet.jar does'nt not contain getJspApplicationContext... this method exists in jsp-api.jar . why is the wrong reference occuring. please help.

if may be cos of anyother thing please let me know with possible solutions.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61053
    
  66

ashwin venkat wrote:but the javax.servlet.jar does'nt not contain getJspApplicationContext... this method exists in jsp-api.jar .


What does it matter which jar file it exists in? Have you removed the jsp-api.jar file from the Tomcat lib folder?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ashwin venkat
Greenhorn

Joined: Mar 03, 2012
Posts: 8
i will keep that in mind when im posting the next time .. thanks for letting me know " Bear Bibeault "

it is trying to access a method that is not there in javax.servlet.jar , but in jsp-api.jar .

no i have not removed jsp-api.jar from Tomcat lib folder !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61053
    
  66

ashwin venkat wrote:it is trying to access a method that is not there in javax.servlet.jar , but in jsp-api.jar .

That makes no sense. javax.servlet is a package, not a jar file. The servlet API is in servlet-api.jar.

Again, it makes no difference which jar file the class is in; both jar files are in Tomcat's class path.

Have you checked to make sure that both jar files are in Tomcat's lib folder? Are you sure you did not copy these jar files to your WEB-INF/lib folder? (which can cause all kinds of weird errors.)
ashwin venkat
Greenhorn

Joined: Mar 03, 2012
Posts: 8
Ya i checked ... both files are not in the WEB-INF/lib... its is present in the Tomcat lib folder !
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
ashwin venkat wrote:here's the error i have got....

javax.servlet.ServletException: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

but the javax.servlet.jar does'nt not contain getJspApplicationContext... this method exists in jsp-api.jar . why is the wrong reference occuring. please help.

if may be cos of anyother thing please let me know with possible solutions.



Every JSP translates into a Servlet eventually. The above stacktrace does not seem to be complete. Can you please post the complete stack trace.
The issue here is not with the jsp-api jar. Something is wrong with your jsp page itself.
ashwin venkat
Greenhorn

Joined: Mar 03, 2012
Posts: 8
Below is the jsp page that I have..

<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<html>
<head>
<title>ABC, Inc.</title>
</head>
<body>

<div id="mainHeader" align="center">
<font color="green">
<h2><u>ABC, Inc.</u></h2>
</font>
</div>
<br> </br>
<hr width="100%" noshade="true">
<font color="red"><html:errors/></font>
<html:form action="/login/Login">

<Table width="100%" align="center" border="0">
<tr>
<td width="30%"> </td>
<td width="70%" align="left"> </td>
</tr>
<tr>
<td colspan="2" align="center"><h5><u>Welcome to ABC, Inc. Admin Page.</u></h5></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><b>Please enter admin username and password to login</b>
</tr>
</table>
<br> </br>
<Table align="center">
<TBODY>
<TR>
<TD width="88" align="center">User Name</TD>
<TD width="224" align="center"><INPUT type="text" name="uid" size="36" maxlength="50"></TD>
</TR>
<TR>
<TD width="88" align="center">Password</TD>
<TD width="224" align="center"><INPUT type="password" name="pwd" size="36" maxlength="50"></TD>
</TR>
<TR>
<TD width="88" height="37"></TD>
<TD height="37" width="224">
<CENTER>
<TABLE>
<TBODY>
<TR>
<TD align="center"><html:submit/></TD>
<TD align="center" valign="middle" width="56"><INPUT type="reset" value="Cancel"></TD>
</TR>
</TBODY>
</TABLE>
</CENTER>
</TD>
</TR>
</TBODY>
</TABLE>


</html:form>
</body>
</html>

Can you please correct me if there are any issues?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19672
    
  18

Ashwin, can you please follow this advice:
Piyush Mangal wrote:The above stacktrace does not seem to be complete. Can you please post the complete stack trace.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ashwin venkat
Greenhorn

Joined: Mar 03, 2012
Posts: 8
as a last ditch effort i just started a new project and copied all the file from the previous project... and guess what.. no more error!!

guess this is resolved for now at least

thanks a bunch for all the help...

i am new to java and will be posting a lot as and when i get errors ... and will try and give more information about the errors i am getting ( like the full stack trace in this case :P)

again thank you guys
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: wrong jar reference