Solved

JasperException in netbanes n tomcat

Posted on 2009-07-15
24
539 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
Comment Utility
check you don't have any javaee jars in your project, they will conflict with tomcats classes
0
 

Author Comment

by:websyn
Comment Utility
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
Comment Utility
what jars are currently in your projects build path?
0
 

Author Comment

by:websyn
Comment Utility
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
Comment Utility
they all look ok, is that the lot?
0
 

Author Comment

by:websyn
Comment Utility
then what could be the problem?
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>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
Comment Utility
i'm using TOMCAT 6.0.16, its already set to to that version
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
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
Comment Utility
priblem  solved
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
what was the problem?
0
 

Author Comment

by:websyn
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 92

Expert Comment

by:objects
Comment Utility
which would have reloaded the required jars
0
 

Author Comment

by:websyn
Comment Utility
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
Comment Utility
how and what are you adding?
0
 

Author Comment

by:websyn
Comment Utility
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
Comment Utility
objects, can u plz help me
0
 

Author Comment

by:websyn
Comment Utility
objects, can u plz help me
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
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
Comment Utility
Properties of project
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
Does the jar appear in the Libraries folder of your project
0
 

Author Comment

by:websyn
Comment Utility
s, its apperaing.
0
 
LVL 92

Accepted Solution

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

Author Closing Comment

by:websyn
Comment Utility
no comments
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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

762 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

11 Experts available now in Live!

Get 1:1 Help Now