Hi, Thanks for the help,The HelloServlet.java file is as follows
/*****************HelloServlet.java*******************/ import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Simple servlet used to test server. * <P> * Taken from Core Servlets and JavaServer Pages 2nd Edition * from Prentice Hall and Sun Microsystems Press, * http://www.coreservlets.com/. * © 2003 Marty Hall; may be freely used or adapted. */ public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n"; out.println(docType + "<HTML>\n" + "<HEAD><TITLE>Hello</TITLE></HEAD>\n" + "<BODY BGCOLOR=\"#FDF5E6\">\n" + "<H1>Hello</H1>\n" + "</BODY></HTML>"); } } /*****************HelloServlet.java*******************/ Hoping to get going with it. Thanks AS On Mon, 02 Feb 2004 Doug Parsons wrote : >Post your HelloServlet code or attach it. > > >----- Original Message ----- > From: "Avinash Sridhar" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Sunday, February 01, 2004 10:21 PM >Subject: TOmcat 5.0.16 console error,Pls help > > >Hi, > I was told that the .class files must be put into a package in order for >the tomcat to run it. > >My directory structure is as follows, > >%TOMCAT HOME %/webapps/sampleapp/WEB-INF/classes > /WEB-INF/lib > /WEB-INF/sourcefiles > /WEB-INF/web.xml >In the classes directory I have make something like this.... >/classes/package/structure/HelloServlet.class(This is my servlet file), > >Now I have changed/made the web.xml in MY WEB-INF directory and have added >this > >/******************** Contents of web.xml file *****************/ > ><?xml version="1.0" encoding="ISO-8859-1"?> > ><!DOCTYPE web-app > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd"> > ><web-app> > <display-name>Servlet 2.4 Examples</display-name> > <description> Servlet 2.4 Examples </description> > ><!-- Servlet mapping start --> ><!-- Define servlets. i.e. bind a servlet name to a class --> > ><servlet> > <servlet-name>HelloServlet</servlet-name> > /** This is the prominent change **/ > <servlet-class>package.structure.HelloServlet</servlt-class> > /** This is the prominent change **/ > ></servlet> > ><!-- bind a servlet name to a URL (pattern) --> ><servlet-mapping> > <servlet-name>HelloServlet</servlet-name> > <url-pattern>/sampleapp</url-pattern> ></servlet-mapping> > ><!-- Servlet mapping end --> > ></web-app> > >/******************** Contents of web.xml file *****************/ > > >Hope that it is right so far, > >I dont know how to change the %TOMCAT_HOME%/conf/server.xml,do we have to >change anything here??, this is what I have written in the server.xml file. > >/********************* Contents of server.xml file ***************/ > ><Context path="/sampleapp" docBase="sampleapp" debug="0" reloadable="true"> ></Context> > >/********************* Contents of server.xml file ***************/ > > >And finally I am getting theses errors in the tomcat console > > >/******************* Errors in Tomcat console *********************/ > >Feb 1, 2004 10:04:22 PM org.apache.commons.digester.Digester fatalError >SEVERE: Parse Fatal Error at line 3 column 6: The processing instruction >target >matching "[xX][mM][lL]" is not allowed. >org.xml.sax.SAXParseException: The processing instruction target matching >"[xX] >mM][lL]" is not allowed. > at >org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(U >known Source) > at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown >Source > > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >Source) > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >Source) > at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown >Source) > at org.apache.xerces.impl.XMLScanner.scanPIData(Unknown Source) > at >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unk >own Source) > at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source) > at >org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispa >ch(Unknown Source) > at >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(U >known Source) > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) > at org.apache.commons.digester.Digester.parse(Digester.java:1548) > at >org.apache.catalina.startup.ContextConfig.applicationConfig(ContextC >nfig.java:302) > at >org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:6 >4) > at >org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConf >g.java:254) > at >org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc >eSupport.java:166) > at >org.apache.catalina.core.StandardContext.start(StandardContext.java: >212) > at >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125 > > at >org.apache.catalina.core.StandardHost.start(StandardHost.java:816) > at >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125 > > at >org.apache.catalina.core.StandardEngine.start(StandardEngine.java:51 >) > at >org.apache.catalina.core.StandardService.start(StandardService.java: >19) > at >org.apache.catalina.core.StandardServer.start(StandardServer.java:23 >3) > at org.apache.catalina.startup.Catalina.start(Catalina.java:581) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl >java:39) > at >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce >sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) >Feb 1, 2004 10:04:22 PM org.apache.catalina.startup.ContextConfig >applicationCo >fig >SEVERE: Parse error in application web.xml >org.xml.sax.SAXParseException: The processing instruction target matching >"[xX] >mM][lL]" is not allowed. > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) > at org.apache.commons.digester.Digester.parse(Digester.java:1548) > at >org.apache.catalina.startup.ContextConfig.applicationConfig(ContextC >nfig.java:302) > at >org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:6 >4) > at >org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConf >g.java:254) > at >org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc >eSupport.java:166) > at >org.apache.catalina.core.StandardContext.start(StandardContext.java: >212) > at >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125 > > at >org.apache.catalina.core.StandardHost.start(StandardHost.java:816) > at >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125 > > at >org.apache.catalina.core.StandardEngine.start(StandardEngine.java:51 >) > at >org.apache.catalina.core.StandardService.start(StandardService.java: >19) > at >org.apache.catalina.core.StandardServer.start(StandardServer.java:23 >3) > at org.apache.catalina.startup.Catalina.start(Catalina.java:581) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at >sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl >java:39) > at >sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce >sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) >Feb 1, 2004 10:04:22 PM org.apache.catalina.startup.ContextConfig >applicationCo >fig >SEVERE: Occurred at line 3 column 6 > >/******************* Errors in Tomcat console *********************/ > > >Hoping that I could get this question answered at the earliest. > >Thanking you in advance > >AS > > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >