Problem displaying tutorial snoop servlet in Tomcat [message #142417] |
Wed, 05 October 2005 00:14 |
Eclipse User |
|
|
|
Originally posted by: roderick_llewellyn.alum.mit.edu
Hello All! I have installed WTP, and went thru the tutorial "WTP Tutorials
Building and Running a Web Application" that leads one to create Snoop
Servlet and showBrowser.jsp. I am using Tomcat 5.5 on linux. Everything
starts correctly when I use the RunAs.. menu, EXCEPT that I notice in the
console display from Tomcat I see the error:
INFO: Missing application web.xml, using defaults only
StandardEngine[Catalina].StandardHost[localhost].StandardCon text[]
But Tomcat itself comes up. When I try to access thru a browser either the
servlet, or the JSP, neither come up, instead I get a 404 error
(presumably because the web.xml file is not being found).
One possible clue (or red herring?) is that displaying the project's
web.xml file in the editor window shows an error on the root element:
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
the error being:
Unexpected element ... more complaining here.
It seems to think this is an Ant file; it even displays the Ant icon in
front of the web.xml file in the project explorer view (under
WebContent/WEB-INF). This is the default web.xml file created when I
create the project following exactly the guidelines in the tutorial. (I
have modified the web.xml file according to the tutorial for its sample
project, but the error was displayed upon creation of the project before I
had done anything to it, or created any JSPs/servlets.)
Any ideas out there? Thanks! - Roderick Llewellyn
|
|
|
Re: Problem displaying tutorial snoop servlet in Tomcat [message #142447 is a reply to message #142417] |
Wed, 05 October 2005 05:49 |
|
Roderick Llewellyn wrote:
> Hello All! I have installed WTP, and went thru the tutorial "WTP
> Tutorials � Building and Running a Web Application" that leads one to
> create Snoop Servlet and showBrowser.jsp. I am using Tomcat 5.5 on
> linux. Everything starts correctly when I use the RunAs.. menu, EXCEPT
> that I notice in the console display from Tomcat I see the error:
> INFO: Missing application web.xml, using defaults only
> StandardEngine[Catalina].StandardHost[localhost].StandardCon text[]
> But Tomcat itself comes up. When I try to access thru a browser either
> the servlet, or the JSP, neither come up, instead I get a 404 error
> (presumably because the web.xml file is not being found).
> One possible clue (or red herring?) is that displaying the project's
> web.xml file in the editor window shows an error on the root element:
> <web-app id="WebApp_ID" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> the error being:
> Unexpected element ... more complaining here.
It really sounds like Tomcat missing the web.xml and the validation
error in your web.xml might be related. What was the rest of the
exception--it sounds like you might have some of the elements out of
order and failing validation.
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Problem displaying tutorial snoop servlet in Tomcat [message #142467 is a reply to message #142447] |
Wed, 05 October 2005 13:15 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
Nitin Dahyabhai wrote:
> Roderick Llewellyn wrote:
>
>> Hello All! I have installed WTP, and went thru the tutorial "WTP
>> Tutorials � Building and Running a Web Application" that leads one to
>> create Snoop Servlet and showBrowser.jsp. I am using Tomcat 5.5 on
>> linux. Everything starts correctly when I use the RunAs.. menu, EXCEPT
>> that I notice in the console display from Tomcat I see the error:
>> INFO: Missing application web.xml, using defaults only
>> StandardEngine[Catalina].StandardHost[localhost].StandardCon text[]
>> But Tomcat itself comes up. When I try to access thru a browser either
>> the servlet, or the JSP, neither come up, instead I get a 404 error
>> (presumably because the web.xml file is not being found).
>> One possible clue (or red herring?) is that displaying the project's
>> web.xml file in the editor window shows an error on the root element:
>> <web-app id="WebApp_ID" version="2.4"
>> xmlns="http://java.sun.com/xml/ns/j2ee"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>> the error being:
>> Unexpected element ... more complaining here.
>
>
> It really sounds like Tomcat missing the web.xml and the validation
> error in your web.xml might be related. What was the rest of the
> exception--it sounds like you might have some of the elements out of
> order and failing validation.
>
The "INFO: Missing application web.xml, using defaults only" may be
ignored as it's not referring to your project's web.xml. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=110954 if you are curious.
If the project's web.xml has error's enough to cause problems, I would
expect you to see other complaints in the log. As long as Tomcat
doesn't reject your project's webapp, you should get some response for
the JSP even if problems in the web.xml prevent you from accessing the
servlet. Make sure you have Project -> Build Automatically checked to
ensure the project's ".deployables" directory, where the webapp image is
built, remains up to date.
Cheers,
Larry
|
|
|
|
Powered by
FUDForum. Page generated in 0.03054 seconds