--
OK, I see that your code refers to the ECS packages (org.apache.ecs and
org.apache.ecs.html) as well as the O'Reilly classes (com.oreilly.servlet).
Are these packages declared in a repository in your zone properties? It
appears not from the text below, unless they are unpacked in your "servlets"
subdirectory.
Two things to remember:
* The "class not found" error can be either the servlet itself
that is not found, or a class it is trying to load being not found.
* The system class path is used by servletrunner, but is totally
ignored by Apache JServ. Everything you refer to in servlets
needs to be declared in a zone properties "repositories" line or a
"wrapper.classpath" line in jserv.properties.
Craig
Garry Thuna wrote:
> --
>
> Craig,
>
> >There are not enough details here to know precisely what the
> >problem is, so I will describe the most common thing users
> >don't understand about classes in packages
>
> Thank you for responding. I believe that I understand how the packages
> should be organized and how the repositories should be set-up. I also
> had read the faq(s) and double checked the permission issues prior
> to posting my question; but ....
>
> I am continuing to test and am still very bewildered. I have greatly
> simplified my example to better demonstrate the
> problem -- removed most of the code from the NavigationBar class;
> removed all package statments; removed all init stuff entirely;
> moved the classes into the root directory of the zone ( in my
> case this is /home/webSites/netNaturals/servlets)
>
> jserv.conf:
> ApJServMount /nnservlet /netNaturalsZone
> jserv.properties:
> zones=netNaturalsZone
>
> netNaturalsZone.properties=/home/webSites/netNaturals/servlets/zone.properti
> es
> /home/webSites/netNaturals/servlets/zone.properties:
> repositories=/home/webSites/netNaturals/servlets
> repositories=/usr/local/apache/jserv/lib/ApacheJSSI.jar
>
> I have included copy of (tiny) NavigationBar1.java source code below
>
> NavigationBar1.java: as shown
>
> NavigationBar2.java: is the same but with the call to
> getNavigationBar commented out
>
> NavigationBar3.java: same but with the call and the
> entire getNavigationBar routine commented out.
>
> Here is what happens:
>
> NavigationBar1: This loads and runs successfully from servlet runner, but
> jserv
> gives an error "The requested URL /nnservlet/NavigationBar was not found on
> this server." So it seems as though jserv won't load this class (why?)
>
> NavigationBar2: Same behaviour as 1
>
> NavigationBar3: Jserv will run this servlet properly.
>
> I am completely stumped because it makes no sense that jserv should fail due
> to some code that got compiled into my servlet. If my code caused a problem
> then I should get some sort of execution error, but the servlet isn't
> even getting loaded!
>
> Hope this gives you more info, because I still really need help.
>
> Thanks.
> Garry
>
> ==============================================================
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> import org.apache.ecs.*;
> import org.apache.ecs.html.*;
>
> import com.oreilly.servlet.*;
>
> public class NavigationBar1 extends HttpServlet
> {
> static String dataDir="/home/webSites/netNaturals/servletData";
> static String imgSpacer="images/spacer.gif";
>
> public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> res.setContentType("text/html");
> PrintWriter out = res.getWriter();
>
> //read the properties file
> Properties props = new Properties();
>
> //build the bar
> try {
> out.println(getNavigationBar(props).toString());
> out.println("Here I am");
> } catch (Exception e) {
> res.sendError(res.SC_INTERNAL_SERVER_ERROR,
> com.oreilly.servlet.ServletUtils.getStackTraceAsString(e));
> }
> }
>
> public void doPost(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> doGet(req, res);
> }
>
> public String getServletInfo()
> {
> return "com.netNaturals.NavigationBar Information";
> }
>
> private Element getNavigationBar(Properties props)
> {
> ElementContainer con = new ElementContainer();
> con.addElement(new H1("Here I am in an ecs container"));
> return con;
> }
> }
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]