Code Comments
Programming Forum and web based access to our favorite programming groups.my tomcat is broken now, as of last night, I turn it on & when I go to main page in browser (localhost) text is there but imgs are missing (but imgs ARE there, I can see them in ROOT dir..) and whatever I try to run I get a 404.. when I try to get to JSP or servlet examples that came w/tomcat simply get a blank page.. when I'm turning on tomcat in DOS shell (or is it tomcat shell?) one of the things I see that I think is weird is this: INFO: Missing application web.xml, using defaults only StandardEngine[Catalina] StandardHost[localhost].StandardContext[/cc] Oct 30, 2004 9:25:53 AM org.apache.catalina.core.StandardHostDeployer install 'Missing application web.xml'? I don't understand, it's there, everything still there where it should be.. would appreciate any suggestions.. tomcat is truly driving me up the wall.. (version 5.0.27) thank you very much.. Frances
Post Follow-up to this messageFrances Del Rio <fdr58@yahoo.com> said: >my tomcat is broken now, as of last night ... >INFO: Missing application web.xml, using defaults only 'application web.xml' would mean WEB-INF/web.xml for a single application -- and I think you mentioned removing web.xml in another of your posts (where you wondered about the path to invoke a servlet). So, could that still be missing? >StandardHost[localhost].StandardContext[/cc] And this might mean (no, Tomcat error messages definitely are not the top in readability) that the WEB-INF/web.xml is missing from an application whose application base directory is named 'cc'. >'Missing application web.xml'? I don't understand, it's there, >everything still there where it should be.. The other possibility might be that the application web.xml is not completely valid (f.ex. elements not in correct order); I seem to recall spending quite some time resolving an issue with an application web.xml file just to find out that the order of different elements within the file is critical. Also, I seem to recall having seen a case where Tomcat just wouldn't load an application that didn't have the application web.xml file. Here's a very minimal 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>Welcome to Tomcat</display-name> <description> Welcome to Tomcat </description> </web-app> ----- No servlet mappings, no nothing. But this is enough to allow running JSP pages and serving static resources (HTML, images). For servlets, add the appropriate mappings: ----- <?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>Welcome to Tomcat</display-name> <description> Welcome to Tomcat </description> <servlet> <servlet-name>JustANameForTheseMappings</servlet-name> <servlet-class>package.Class</servlet-class> </servlet> <servlet-mapping> <servlet-name>JustANameForTheseMappings</servlet-name> <url-pattern>/serv/let/url</url-pattern> </servlet-mapping> </web-app> ----- Note on the above: If you have multiple servlet classes in a single application, you must first write _all_ the <servlet> -elements, and only after all the <servlet> -elements, write the corresponding <servlet-mapping> -elements. You cannot interleave the two. Also, if you have any other elements than those listed above, find out the correct place for them. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.