Hi All i'm trying to run a servlet using Tomcat. what i did: 1-i put this code in server.xml <Context path="/mytest" docBase="webapps/mytest" defaultSessionTimeOut="30" isWARExpanded="true" isWARValidated="false" isInvokerEnabled="true" isWorkDirPersistent="false"/> 2- i create mytest directory under jakarta-tomkat/webapps 3- i create WEB-INF directory under mytest. 4- i create web.xml file and i save it in WEB-INF directory ,web.xml has: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> <web-app> <servlet> <servlet-name> HelloBrowser </servlet-name> <servlet-class> HelloBrowser </servlet-class> </servlet> </web-app> 5-i put HelloBrowser.java and HelloBrowser.class in directory i called (classes ) under WEB-INF 6- i restart tomcat 7- i point my browser to: http://localhost:8080/mytest/servlet/HelloBrowser i got this message: server error the proxy has encountered an internal error..... i do appreciate your time and your help,it is really hard for me to figureout what is the problem,but soon i run the first servlet it will be easy for me. thanks alot.
Joined: Nov 22, 2008
Hi, I think it is better to use the default Directories of Tomcat instead of creating the Dir again. Just make sure you set the JAVA_HOME & TOMCAT_HOME dir. You may also look into the doc of Tomcat for setting this. Also make sure the servlet.jar files are in your classpath. The java source file should be saved under the JDK bin directory. After compiling the program the Class should be made available in the Tomcat. Also for invoking the servlet you should use http://localhost:8080/servlet/HelloBrowser. Dadi