Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A Servlet Exception Has Occurred in a jsp file  RSS feed

 
rsubha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on the examples mentioned in the Book Writing Enterprise Applications with JAVA 2 SDK, Enterprise Edition..
My software is: J2EE 1.3;
JSDK 1.3;
Database:Cloudscape
In Chapter-5, going by the example, when I try to invoke the jsp from my desktop (localhost:8000/jspRoot/bonus.jsp) after deploying the application. I get the following error.
Could you please help me in resolving this scenarion..
Thanks in advance
Subhashree

type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 19 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:63: Class org.apache.jsp.JBonusBean not found.
JBonusBean jbonus = null;
^
An error occurred at line: 19 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:66: Class org.apache.jsp.JBonusBean not found.
jbonus= (JBonusBean)
^
An error occurred at line: 19 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:71: Class org.apache.jsp.JBonusBean not found.
jbonus = (JBonusBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JBonusBean");
^
An error occurred at line: 30 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:117: Class org.apache.jsp.JBonusBean not found.
out.print(JspRuntimeLibrary.toString((((JBonusBean)pageContext.findAttribute("jbonus")).getSocsec())));
^
An error occurred at line: 34 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:124: Class org.apache.jsp.JBonusBean not found.
out.print(JspRuntimeLibrary.toString((((JBonusBean)pageContext.findAttribute("jbonus")).getBonusAmt())));
^
An error occurred at line: 38 in the jsp file: /bonus.jsp
Generated servlet error:
c:\j2sdkee1.3.1\repository\Subha\web\jspRoot\bonus$jsp.java:131: Class org.apache.jsp.JBonusBean not found.
out.print(JspRuntimeLibrary.toString((((JBonusBean)pageContext.findAttribute("jbonus")).getMessage())));
^
6 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:551)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:479)
 
umar hathab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have not worked with J2EE server .Still I try to answer.
It looks like a generic error.Jsp engine is unable to fine the JBonusBean class.
U may have to import the bean class in yr jsp using page directive or u have to put the class file into the server class path(WEB_INF for Jrun and others-not sure abt J2EE)
Hope It could help,send me the code if u still have prbs.
A.Umar(Pune)
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looks like your servlet can't find a class: "Class org.apache.jsp.JBonusBean not found."
if you have your JSP configured in a WAR file... you need to put the class or jar file in the correct location so that your application server will load it in the classpath:
 
umar hathab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If u dont have jar 0r war files,put the class under root/WEB-INF/classes/org/apache/jsp/JBonusBean
If u use .jar file ,put it under
root/WEB-INF/lib/XXX.jar
if u have not imported,use the foll lines,
<%@ page import="org.apache.jsp.JBonusBean" %>
A.Umar(Hope it should work)
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't believe that JBonusBean is a part of org.apache.jsp package.
You should put JBonusBean in a package( ie myPackage) and import it using <%@ page import="myPackage.JBonusBean" %>
Beans need to be packaged.Put the package under
yourApplication/WEB-INF/classes/myPackage/JBonusBean
You will get this kind of error messages when you try to use beans, which are part of any package.
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please read our naming rules.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!