Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Problem displaying tutorial snoop servlet in Tomcat
Problem displaying tutorial snoop servlet in Tomcat [message #142417] Wed, 05 October 2005 00:14 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
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
Re: Problem displaying tutorial snoop servlet in Tomcat [message #142505 is a reply to message #142467] Wed, 05 October 2005 21:52 Go to previous message
Eclipse UserFriend
Originally posted by: roderick_llewellyn.alum.mit.edu

Hello All! Thanks for your replies. The problem is solved; specifiying
"auto build" probably helped, the degenerate web.xml file eliminated the
complaints from both Tomcat and, seemingly, Eclipse. I think also part of
the problem is that it was not obvious to me that one must point the
browser at: http://localhost:8080/RodJsp/servlet/XXXServlet, not just:
http://localhost:8080/RodJsp/XXXServlet.
Thanks!
- Roderick Llewellyn
Previous Topic:Tomcat context attributes
Next Topic:Content Outline context menu
Goto Forum:
  


Current Time: Thu Apr 25 10:33:48 GMT 2024

Powered by FUDForum. Page generated in 0.03054 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top