tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Héritier <aherit...@sopragroup.com>
Subject RE: Class in org.apache.jsp not found - please help!!
Date Thu, 29 Nov 2001 12:09:11 GMT
Context, InitialContext, NamingException are classes from the package javax.naming.*

let's see :
http://java.sun.com/products/jndi/1.2/javadoc/index.html

So put <%@ page import="javax.naming.*" %> in your JSP page and all will work correctly
(normally ;-) )

Arno

> -----Message d'origine-----
> De:	Sunhild Copony [SMTP:sunny.copony@inovit.de]
> Date:	jeudi 29 novembre 2001 11:45
> À:	Tomcat Users List
> Objet:	Re: Class in org.apache.jsp not found - please help!!
> 
> Hi Arno,
> thanks a lot for your quick reply!
> 
> What do you mean exacly?
> 
> I tryed in the jsp
> <%@ page import="org.apache.jsp.*" %>
> but got the same error...
> Maybe you mean something else?
> 
> Here is my complete server.xml, web.xml, and jsp.
> I hope you find out whats wrong, I cann't see anything!
> 
> Tx, Sunny
> 
> WEB-INF/web.xml :
> ...
>     <env-entry>
>         <env-entry-name>inobase</env-entry-name>
>         <env-entry-value>"/home/inovit/inorms"</env-entry-value>
>         <env-entry-type>java.lang.String</env-entry-type>
>     </env-entry>
> 
> server.xml, in my context section :
> ...
>           <Environment name="inobase" type="java.lang.String"
>                       value="/home/inovit/inorms"/>
> 
> >From a jsp I want to read this variable and pass it to a class.
> 
> jsp:
> <%
> inovit.webadmin.InterimApp ia = new inovit.webadmin.InterimApp();
> org.apache.jsp.Context ctx = null;
> String value = "" ;
> try { ctx = new org.apache.jsp.InitialContext(); }
> catch (org.apache.jsp.NamingException e) {value = "no ctx";}
> if (!value.equals("no ctx"))
> try { value = ctx.lookup("java:/comp/env/inobase"); }
> catch (org.apache.jsp.NamingException e) {value = "no path";}
> %>
> 
> another try:
> <%
> inovit.webadmin.InterimApp ia = new inovit.webadmin.InterimApp();
> Context ctx = null;
> String value = "" ;
> try { ctx = new InitialContext(); }
> catch (NamingException e) {value = "no ctx";}
> if (!value.equals("no ctx"))
> try { value = ctx.lookup("java:/comp/env/inobase"); }
> catch (NamingException e) {value = "no path";}
> %>
> 
> I allways get the same error:
> 
> A Servlet Exception Has Occurred
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> An error occured between lines: 50 and 59 in the jsp file:
> /inopacs/statusrf.jsp
> Generated servlet error:
> /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:60:
> Class org.apache.jsp.Context not found.
>                 Context ctx = null;
>                 ^
> An error occured between lines: 50 and 59 in the jsp file:
> /inopacs/statusrf.jsp
> Generated servlet error:
> /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:62:
> Class org.apache.jsp.InitialContext not found.
>                 try { ctx = new InitialContext(); }
>                                 ^
> An error occured between lines: 50 and 59 in the jsp file:
> /inopacs/statusrf.jsp
> Generated servlet error:
> /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:63:
> Class org.apache.jsp.NamingException not found.
>                 catch (NamingException e) {value = "no ctx";}
>                        ^
> An error occured between lines: 50 and 59 in the jsp file:
> /inopacs/statusrf.jsp
> Generated servlet error:
> /mirror/tools/tomcat/work/localhost/webadmin/inopacs/statusrf$jsp.java:66:
> Class org.apache.jsp.NamingException not found.
>                 catch (NamingException e) {value = "no path";}
>                        ^
> 4 errors
> 
> 
> Arnaud Héritier schrieb:
> 
> > The package org.apache.jsp is a virtual package.
> > This package is used to generate servlet sources from JSP pages.
> > All classes generated under TC/work/.... belong by default to this package.
> > I think that you need to add the import of the Context class in the JSP page which
uses it.
> >
> > Arno
> >
> > > -----Message d'origine-----
> > > De:   Sunhild Copony [SMTP:sunny.copony@inovit.de]
> > > Date: jeudi 29 novembre 2001 10:27
> > > À:    tomcat-user@jakarta.apache.org
> > > Objet:        Class in org.apache.jsp not found - please help!!
> > >
> > > Hi,
> > >
> > > I'm using Tomcat 4.0b rc1 on Solaris and J2SDK 1.3.1.
> > >
> > > Where can I find org.apache.jsp? I searched the complete jars, but
> > > didn't found it...
> > > I want to use the environment settings in server.xml, and than  use the
> > > variable in my jsp, but get the error:
> > >
> > > Class org.apache.jsp.Context not found.
> > >                 Context ctx = null;
> > >                 ^
> > >
> > > Could you please help me!
> > > Thanks a lot,
> > > Sunny
> > >
> > >
> > > --
> > > To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > > For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> > > Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> >
> > --
> > To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> > Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
> 
> 
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message