• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jsp failed to execute in Netbeans

 
Greenhorn
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your application flow? What are the content of the JSP you are trying to access? Please TellTheDetails.
 
Ank Rai
Greenhorn
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ank Rai
Greenhorn
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you are using Netbeans, I have moved this to the IDEs forum.
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you have in the JSP? And do you have any additional jar files in your WEB-INF/jar directory?
 
Ank Rai
Greenhorn
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 14
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@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
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
Spring Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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..
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ashish Kataria
Greenhorn
Posts: 14
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic