  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | TOmcat 5.0.16 console error,Pls help | TOmcat 5.0.16 console error,Pls help 2004-02-02 - By Alvaro Seixas
Back Did you just added the <Context> in server.xml or did something else?? Looks like the server.xml is not validated.
-- -- Original Message -- -- From: "Avinash Sridhar" <smartnash78@(protected)> To: "Tomcat Users List" <tomcat-user@(protected)> Cc: "Doug Parsons" <parsonstechnical@(protected)> Sent: Monday, February 02, 2004 2:46 AM Subject: Re: Re: Re: TOmcat 5.0.16 console error,Pls help
Hi, This is an update to the previous HelloServlet.java file,forgot to add the lines package On Mon, 02 Feb 2004 Avinash Sridhar wrote : >Hi, > > Thanks for the help,The HelloServlet.java file is as follows > >/*****************HelloServlet.java*******************/ >package package.structure >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" <smartnash78@(protected)> > >To: <tomcat-user@(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 (See http://ISO-8859.ora-code.com)-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</servlet-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 (U > >known Source) > > at org.apache.xerces.util.ErrorHandlerWrapper (Unknown > >Source > > > > at org.apache.xerces.impl.XMLErrorReporter (Unknown > >Source) > > at org.apache.xerces.impl.XMLErrorReporter (Unknown > >Source) > > at org.apache.xerces.impl.XMLScanner (Unknown > >Source) > > at org.apache.xerces.impl.XMLScanner (Unknown Source) > > at > >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl (Unk > >own Source) > > at org.apache.xerces.impl.XMLScanner (Unknown Source) > > at > >org.apache.xerces.impl.XMLDocumentScannerImpl $PrologDispatcher.dispa > >ch(Unknown Source) > > at > >org.apache.xerces.impl.XMLDocumentFragmentScannerImpl (U > >known Source) > > at org.apache.xerces.parsers.XML11Configuration (Unknown > >Source) > > at org.apache.xerces.parsers.DTDConfiguration (Unknown Source) > > at org.apache.xerces.parsers.XMLParser (Unknown Source) > > at org.apache.xerces.parsers.AbstractSAXParser (Unknown Source) > > at org.apache.commons.digester.Digester (Digester.java:1548) > > at > >org.apache.catalina.startup.ContextConfig (ContextC > >nfig.java:302) > > at > >org.apache.catalina.startup.ContextConfig (ContextConfig.java:6 > >4) > > at > >org.apache.catalina.startup.ContextConfig (ContextConf > >g.java:254) > > at > >org.apache.catalina.util.LifecycleSupport (Lifecyc > >eSupport.java:166) > > at > >org.apache.catalina.core.StandardContext (StandardContext.java: > >212) > > at > >org.apache.catalina.core.ContainerBase (ContainerBase.java:1125 > > > > at > >org.apache.catalina.core.StandardHost (StandardHost.java:816) > > at > >org.apache.catalina.core.ContainerBase (ContainerBase.java:1125 > > > > at > >org.apache.catalina.core.StandardEngine (StandardEngine.java:51 > >) > > at > >org.apache.catalina.core.StandardService (StandardService.java: > >19) > > at > >org.apache.catalina.core.StandardServer (StandardServer.java:23 > >3) > > at org.apache.catalina.startup.Catalina (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 (Method.java:324) > > at org.apache.catalina.startup.Bootstrap (Bootstrap.java:297) > > at org.apache.catalina.startup.Bootstrap (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 (Unknown Source) > > at org.apache.commons.digester.Digester (Digester.java:1548) > > at > >org.apache.catalina.startup.ContextConfig (ContextC > >nfig.java:302) > > at > >org.apache.catalina.startup.ContextConfig (ContextConfig.java:6 > >4) > > at > >org.apache.catalina.startup.ContextConfig (ContextConf > >g.java:254) > > at > >org.apache.catalina.util.LifecycleSupport (Lifecyc > >eSupport.java:166) > > at > >org.apache.catalina.core.StandardContext (StandardContext.java: > >212) > > at > >org.apache.catalina.core.ContainerBase (ContainerBase.java:1125 > > > > at > >org.apache.catalina.core.StandardHost (StandardHost.java:816) > > at > >org.apache.catalina.core.ContainerBase (ContainerBase.java:1125 > > > > at > >org.apache.catalina.core.StandardEngine (StandardEngine.java:51 > >) > > at > >org.apache.catalina.core.StandardService (StandardService.java: > >19) > > at > >org.apache.catalina.core.StandardServer (StandardServer.java:23 > >3) > > at org.apache.catalina.startup.Catalina (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 (Method.java:324) > > at org.apache.catalina.startup.Bootstrap (Bootstrap.java:297) > > at org.apache.catalina.startup.Bootstrap (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: tomcat-user-unsubscribe@(protected) > >For additional commands, e-mail: tomcat-user-help@(protected) > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected) For additional commands, e-mail: tomcat-user-help@(protected)
|
|
 |