Dear, thank you David and Christopher for your replies,
the servlet is already packaged, I put my class in a jar file and put it in "tomcat_home/webapps/Servlet_HTML/WEB-INF/lib/"and i made the necessary modification to the web.xml file <servlet> <servlet-name>BrowseRegions</servlet-name> <servlet-class>edu.rice.rubis.servlets.BrowseRegions</servlet-class> </servlet> <servlet-mapping> <servlet-name>BrowseRegions</servlet-name> <url-pattern>/edu.rice.rubis.servlets.BrowseRegions</url-pattern> </servlet-mapping> and when I call the servlet from this address "http://localhost:8030/Servlet_HTML/edu.rice.rubis.servlets.BrowseRegions", I got this error: type Status report message Servlet BrowseRegions is not available I know I should not set any CLASSPATH variable, I just did it to test that the class exists in the jar file Regards Omar > The first exception below implies you didn't put the servlet in a > package. Packageless classes have been strongly discouraged since > tomcat 3 (/ancient/ history). You might want to fix that first and be > sure to drop any future attempt at setting CLASSPATH. > > --David > > Omar Chebaro wrote: > > > > > > > > Dear,I have an "Apache Tomcat/6.0.14" installed on the latest version of > > ubuntu osI am trying to add a servlet to the example application, I put my > > class in a jar file and put it in > > "tomcat_home/webapps/examples/WEB-INF/lib/"and i made the necessary > > modification to the web.xml fileand when I call the servlet I got this > > error: > > type Status report > > message Servlet BrowseRegions is not available > > description The requested resource (Servlet BrowseRegions is not available) > > is not available.so I made an " export > > CLASSPATH=/tmp/tomcat/webapps/examples/WEB-INF/lib/my-jar.jar"and after > > restarting tomcat The error message changed to this, > > type Exception report > > message > > description The server encountered an internal error () that prevented it > > from fulfilling this request. > > exception javax.servlet.ServletException: Error allocating a servlet > > instance > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) > > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) > > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) > > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > > java.lang.Thread.run(Thread.java:619) > > root cause java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet > > java.lang.ClassLoader.defineClass1(Native Method) > > java.lang.ClassLoader.defineClass(ClassLoader.java:620) > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) > > java.net.URLClassLoader.defineClass(URLClassLoader.java:260) > > java.net.URLClassLoader.access$000(URLClassLoader.java:56) > > java.net.URLClassLoader$1.run(URLClassLoader.java:195) > > java.security.AccessController.doPrivileged(Native Method) > > java.net.URLClassLoader.findClass(URLClassLoader.java:188) > > java.lang.ClassLoader.loadClass(ClassLoader.java:306) > > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > > java.lang.ClassLoader.loadClass(ClassLoader.java:251) > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > > java.lang.ClassLoader.defineClass1(Native Method) > > java.lang.ClassLoader.defineClass(ClassLoader.java:620) > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) > > java.net.URLClassLoader.defineClass(URLClassLoader.java:260) > > java.net.URLClassLoader.access$000(URLClassLoader.java:56) > > java.net.URLClassLoader$1.run(URLClassLoader.java:195) > > java.security.AccessController.doPrivileged(Native Method) > > java.net.URLClassLoader.findClass(URLClassLoader.java:188) > > java.lang.ClassLoader.loadClass(ClassLoader.java:306) > > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > > java.lang.ClassLoader.loadClass(ClassLoader.java:251) > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273) > > > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) > > > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) > > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) > > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) > > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) > > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > > java.lang.Thread.run(Thread.java:619)what could possibly be the reason that > > it was not loading the jar file at first, and why can't it find the > > httpServlet now although the example HelloWorldExample is working fineThank > > you for your timeRegardsOmar > > > > Windows Live Hotmail and Microsoft Office Outlook – together at last. Get > > it now! > > _________________________________________________________________ > > Climb to the top of the charts! Play Star Shuffle: the word scramble > > challenge with star power. > > http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct > > > > > -- > ======================================= > David Smith > Network Operations Supervisor > Department of Entomology > College of Agriculture & Life Sciences > Cornell University > 2132 Comstock Hall > Ithaca, NY 14853 > Phone: 607.255.9571 > Fax: 607.255.0939 > > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _________________________________________________________________ Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033