THIS IS NOT CORRECT.  Tomcat was looking for the class
jsp.dates.DBWriter in its classpath - WEB-INF/classes, one of the JAR files
in WEB-INF/lib, one of the JAR files in TOMCAT_HOME/lib, or somewhere in the
classpath Tomcat was started with.  TOMCAT WILL NEVER LOOK FOR CLASSES
RELATIVE TO THE JSP FILE.

        His actual problem was that he didn't import the class because he
assumes that all JSP files have the default package, which is incorrect.
Their package is based upon their location in the webapp (i.e. /jsp/date
becomes the jsp.date package).

        Randy

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 14, 2001 6:33 PM
> To: [EMAIL PROTECTED]
> Subject: RE: org.apache.jasper.JasperException: Unable to 
> compile class
> fo r JSP
> 
> 
> Since you didn't provide a fully qualified class name, Tomcat 
> defaulted to
> looking in the current directory, relative to /examples.  So 
> it was looking
> for jsp/dates/DbWriter.class.  Where are you keeping your 
> class?  Is it in
> the classpath?
> 
> -----Original Message-----
> From: Mandar Joshi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 12, 2001 8:28 PM
> To: [EMAIL PROTECTED]
> Subject: org.apache.jasper.JasperException: Unable to compile 
> class for
> JSP
> 
> 
> Hi,
> 
>  I have a simple server-side java class named DBWriter (with 
> no package
> name)
> I am using it in a jsp file like this
> 
>  <%DBWriter dbwrt = new DBWriter()%>
> 
>  I get following exception on browser page while browsing the 
> above jsp
> 
> 
> ______________________________________________________________
> ______________
>  _________________
>  Error: 500
>  Location: /examples/jsp/dates/mydate.jsp
>  Internal Servlet Error:
> 
>  org.apache.jasper.JasperException: Unable to compile class for
> 
> JSPD:\tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fdat
> es_0002fmydate
>  _0002ejspmydate_jsp_0.java:87: Class jsp.dates.DBWriter not found.
>                  DBWriter w = new DBWriter();
>                  ^
> 
> D:\tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fdates_
> 0002fmydate_00
>  02ejspmydate_jsp_0.java:87: Class jsp.dates.DBWriter not found.
>                  DBWriter w = new DBWriter();
>                                   ^
>  2 errors
> 
>   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
>   at 
> org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
>   at
>  
> org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader1
> 2.java:146)
>   at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
>   at
> 
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfN
> ecessary(JspSe
>  rvlet.java:152)
>   at
> 
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
> (JspServlet.ja
>  va:164)
>   at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:318)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper
> .java:404)
>   at org.apache.tomcat.core.Handler.service(Handler.java:286)
>   at 
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>   at
> 
> org.apache.tomcat.core.ContextManager.internalService(ContextM
> anager.java:79
>  7)
>   at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>   at
> 
> org.apache.tomcat.service.http.HttpConnectionHandler.processCo
> nnection(HttpC
>  onnectionHandler.java:210)
>   at
>  
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin
> t.java:416)
>   at
>  
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo
> ol.java:498)
>   at java.lang.Thread.run(Thread.java:484)
> 
> ______________________________________________________________
> ______________
>  __________________________
> 
> 
>  as I told earlier the class I am using is not residing in 
> any package,
> while
>  tomcat is trying to find it in jsp.dates package.
> 
>  How do I get around this problem ? Is this a bug since I see 
> similar kinds
>  of problems reported on the mailing list archieve
> 
>  your help is appriciated,
>  Mandar
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 

Reply via email to