Solved

JasperException in netbanes n tomcat

Posted on 2009-07-15
24
552 Views
Last Modified: 2013-12-14
Hi all,
 i'm developing one struts application and uing Netbeans 6.1.
when i run the application i'm getting below error some times. som times its working.
what could be the problem? can any one help me out..

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

An error occurred at line: 22 in the generated java file
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

Stacktrace:
      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
      org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

0
Comment
Question by:websyn
  • 13
  • 9
  • 2
24 Comments
 
LVL 92

Expert Comment

by:objects
ID: 24866389
check you don't have any javaee jars in your project, they will conflict with tomcats classes
0
 

Author Comment

by:websyn
ID: 24866710
i did not get you, could you please explain me more clear since i'm new to java
0
 
LVL 92

Expert Comment

by:objects
ID: 24866717
what jars are currently in your projects build path?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:websyn
ID: 24866836
there are sevral files ,   activation.jar
commons-beanutils.jar
commons-collections.jar
commons-dbcp-1.2.1.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-validator.jar
cos.jar
jakarta-oro.jar
junit.jar
log4j-1.2.6.jar
mail.jar
ojdbc14.jar
struts.jar
unittest.jar
jxl-2.6.jar....
0
 
LVL 92

Expert Comment

by:objects
ID: 24866857
they all look ok, is that the lot?
0
 

Author Comment

by:websyn
ID: 24866868
then what could be the problem?
0
 
LVL 27

Expert Comment

by:rrz
ID: 24875374
>The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory  
Since the method getJspApplicationContext is new in  JavaServer Pages 2.1 , you must use Tomcat 6  
In NetBeans  go to Tools | Servers   and   add or select Tomcat 6
0
 

Author Comment

by:websyn
ID: 24876228
i'm using TOMCAT 6.0.16, its already set to to that version
0
 
LVL 27

Expert Comment

by:rrz
ID: 24880852
Maybe objects had the right idea. What jars are in your web app's /WEB-INF/lib   folder  ? Is there just one  jsp-api.jar in Tomcat's  lib folder ?  
0
 

Author Comment

by:websyn
ID: 25352235
priblem  solved
0
 
LVL 92

Expert Comment

by:objects
ID: 25352320
what was the problem?
0
 

Author Comment

by:websyn
ID: 25352343
dont know exactly but i cleared memoery and uninstall n installed the netbeans and created new project and copied src file to that project solved the problem
0
 
LVL 92

Expert Comment

by:objects
ID: 25352376
which would have reloaded the required jars
0
 

Author Comment

by:websyn
ID: 25354389
If i add any new lib to app again i'm getting this err.
so can u tell me how to add lib to web app in Netbeans 6.1.
0
 
LVL 92

Expert Comment

by:objects
ID: 25354399
how and what are you adding?
0
 

Author Comment

by:websyn
ID: 25354411
going to properties -> Select Libraries -> Add JAR/Folder and adding the jar file.
for example i need to add commons-fileupload-1.2.1.jar file. when i add this jar and run the application again i'm getting the error
0
 

Author Comment

by:websyn
ID: 25362481
objects, can u plz help me
0
 

Author Comment

by:websyn
ID: 25362482
objects, can u plz help me
0
 
LVL 92

Expert Comment

by:objects
ID: 25362556
I don't actually use NetBeans but will do my best

> going to properties -> Select Libraries -> Add JAR/Folder and adding the jar file.

properties of what exactly?
0
 

Author Comment

by:websyn
ID: 25362577
Properties of project
0
 
LVL 92

Expert Comment

by:objects
ID: 25362796
Does the jar appear in the Libraries folder of your project
0
 

Author Comment

by:websyn
ID: 25362802
s, its apperaing.
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 25362970
how are you running it on tomcat?
0
 

Author Closing Comment

by:websyn
ID: 31604096
no comments
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

749 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