| Author |
Jsp failed to execute in Netbeans
|
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
Hi all!!!
i am facing this execution problem in jsp. i am using netbeans for development. I am getting the following 500 status error.
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
root cause
java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
please help me with this..
thanks in advance
|
OCP JP 6
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
What is your application flow? What are the content of the JSP you are trying to access? Please TellTheDetails.
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
i am writing just simple jsp code using expressions and scriptlets. i am beginning with jsp and didn't had this JasperException in servlets. I do think that this problem is related to apache tomcat but don't know to configure it..
please help..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
If you are a novice to JSP you should not be dealing with scriptlets at all. They are a poor practice that have been discredited for almost ten years now.
You should be spending your time learning proper techniques with the JSTL and EL.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
well i am also learning EL currently but my problem is not with the coding. i do think it is related to configuration of APACHE TOMCAT or may be with the deployment descriptor web.xml
I am using NetBeans 6.5 and apache tomcat 6.0.18
please help me regarding this..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
|
As you are using Netbeans, I have moved this to the IDEs forum.
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
What do you have in the JSP? And do you have any additional jar files in your WEB-INF/jar directory?
|
 |
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
i am having all required jar files in Libraries which include all from the tomcat/lib folder and some commons.jar. None of them is having a broken reference.
One basic thing i didn't understand is that what is this org.apache.jasper.JasperException all about and how to rectify the line below
java.lang.ClassCastException:
org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
|
 |
Ashish Kataria
Greenhorn
Joined: Aug 06, 2011
Posts: 14
|
|
@Ank rai, you are probably correct. I think the problem is in the configuration of the server.
Things you could check for:
1. There is no other instance of Apache Tomcat Server running
2. Your Environment/System variables are set correctly depending upon your OS.
Best of luck
|
Everything's tough until you try your best
-Ashish Kataria,
Software Engineer
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
Welcome to CodeRanch, Ashish Kataria!
i am having all required jar files in Libraries which include all from the tomcat/lib folder and some commons.jar.
What I meant was what do you have inside your application lib folder (<Appcontext>/WEB-INF/lib), not the Tomcat lib? This may have something to do with Catalina.jar, but it's just a guess.
|
 |
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
I have only displaytag.tld and web.xml in the WEB-INF. In NetBeans there is separate folder named lib within the project in which all the jar files are kept. Until now when i was coding servlets in NetBeans i used to keep all jar files in the lib folder and everything worked fine. Following are the jar files in lib:
annotations-api
catalina
catalina-ant
catalina-ha
catalina-tribes
el-api
jasper
jasper-el
jasper-jdt
jsp-api
servlet-api
tomcat-coyote
tomcat-dbcp
tomcat-i18n-es
tomcat-i18n-fr
tomcat-i18n-ja
commons-beanutils
commons-beanutils-1.7.0
commons-collections-3.1
commons-digester
commons-fileupload-1.0
commons-fileupload-1.1.1
commons-fileupload-1.2.2
commons-io-1.3.2
commons-lang-2.3
commons-logging
commons-validator
displaytag-1.2
displaytag-export-poi-1.2
displaytag-portlet-1.2
itext-1.3
jakarta-oro
javaee
jstl
log4j-1.2.13
mysql-connector-java-5.0.7-bin
saxpath
servlet
standard
standard-1.1.2
uploadbean
xalan
xercesImpl
xml-apis
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
I'm not sure about the Netbean's configuration for server here that how it uses these jar files. But inside your project folder you shouldn't be keeping jar files which are used by the server like catalina.jar, tomcat-coyote.jar etc... Have you checked how these being used by the Netbeans or the Tomcat instance it runs?
|
 |
Ank Rai
Greenhorn
Joined: Jul 03, 2011
Posts: 9
|
|
Hi all!!!
My Jsp code is now working and executing. I uninstalled jdk and NetBeans and installed jdk 7 and NetBeans 7. Now its working perfectly.But I still don't understand what was that JasperException all about.
A lot of thanks to all java ranchers for helping through this..
|
 |
Muhammad Saifuddin
Ranch Hand
Joined: Dec 06, 2005
Posts: 1318
|
|
|
Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
|
 |
Ashish Kataria
Greenhorn
Joined: Aug 06, 2011
Posts: 14
|
|
I wish i could've helped you out earlier, but now that the problem is resolved, i would advice you not to get into the details of the problem now.
But if you are still curious, whatever i could figure out from all your given information.. the problem must be compatibility between jdk and netbeans. It is advised that you download and install the jdk+netbeans+apache pack from http://netbeans.org/downloads/
Another reason could be that jdk was already installed on your system and you installed netbeans+jdk pack.
|
 |
 |
|
|
subject: Jsp failed to execute in Netbeans
|
|
|