2 Replies Latest reply on May 20, 2006 1:58 AM by notarysojac

    javax.servlet.* servlet not being found.

    dvaid_sternberg2

      OK, I've narrowed down the problem but I'm still at a brickwall. Something that should be working is not. I'm trying to compile a simple servlet class and it is complaining that it can't find the servlet library. Here is my code.

      import java.io.*;
      import java.util.*;
      import javax.servlet.*;
      import javax.servlet.http.*;

      public class ControllerServlet extends HttpServlet
      {

      }

      ------------------------------------------------------------------------------------
      D:\>javac ControllerServlet.java

      controllerservlet.java:12: package javax.servlet does not exist
      import javax.servlet.*;
      ^
      controllerservlet.java:13: package javax.servlet.http does not exist
      import javax.servlet.http.*;
      ^
      controllerservlet.java:15: cannot find symbol
      symbol: class HttpServlet
      public class ControllerServlet extends HttpServlet
      ^
      3 errors
      -------------------------------------------------------------------------------------
      This just does not make any sense.

      Here is the version I am running.

      D:\>java -version
      java version "1.4.2_10"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
      Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)

      Could these libraries not be installing. Does anyone know how to check if they are?

      Thanks
      Dave



        • 1. Re:  javax.servlet.* servlet not being found.
          notarysojac

          Hi David -

          Did you ever find out why the javax.servlet and javax.servlet.http; imports were not being accepted?

          Those files exist in my system - although not in the place where the eclipse IDE is looking for them. I have a BUNCH of books and access to the Eclipse docs - but have not stumbled on any indication of how to make those JAR files available to the system.

          Surely we are not the only two dudes out here trying to do this SIMPLE little exercise. If anyone would care to chime in with some info, in the words of 'Butthead, "THAT would be cooool... uh-huh-huh..."

          Thanks!

          • 2. Re:  javax.servlet.* servlet not being found.
            notarysojac

            Dave -

            By dropping the two javax JAR files from the JBOSS installation into the /System/Library/Java/Extensions folder in my system (MacOSX) - the error condition went away. I looked for 'vecmat.jar on my system and that's how I decided where the JAR files should go.

            HTH

            Lane