logo       

Re: unable to add web application: msg#00091

java.jetty.general

Subject: Re: unable to add web application


There were multiple xml parsers in my classpath. When I removed all others except the default xerces supplied with Jetty 5, this problem went away.

thanks.


----Original Message Follows----
From: Jan Bartel <janb@xxxxxxxxxxx>
To: jetty-discuss@xxxxxxxxxxxxxxxxxxxxx, Tahura Chaudhry <tahura@xxxxxxxxxxx>
Subject: Re: [jetty-discuss] unable to add web application
Date: Wed, 22 Sep 2004 20:47:36 -0400

Tahura,

Jetty5 supports the Servlet 2.4 spec, which uses XML schema instead of DTDs to
specify web.xml descriptors. Have a look at the example in
demo/webapps/jetty/WEB-INF/web.xml to see how to specify the file header
correctly.

cheers,
Jan

> Hi, I added a web application that resides out of the folder webapps. I
> tried the following in the jetty's config.xml file:
>
> <Call name="addWebApplication">
> <Arg>/</Arg>
> <Arg>
> <SystemProperty default="." name="jetty.home" />
> /project/webadmin/delegated_admin
> </Arg>
> </Call>
>
> The exception on startup is:
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.util.FileResource <clinit>
> [java] INFO: Checking Resource aliases
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser <init>
> [java] WARNING: Schema validation may not be supported
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.http.HttpServer start
> [java] INFO: Starting Jetty/5.0.0
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.http.HttpServer start
> [java] INFO: Started org.mortbay.http.NCSARequestLog@17a29a1
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser <init>
> [java] WARNING: Schema validation may not be supported
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler
> warning
> [java] WARNING: WARNING@null line:22 col:-1 :
> org.xml.sax.SAXParseException: Valid documents mu
> st have a <!DOCTYPE declaration.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:22 col:-1 :
> org.xml.sax.SAXParseException: Element type "web-ap
> p" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:24 col:-1 :
> org.xml.sax.SAXParseException: Attribute "xmlns" is
> not declared for element "web-app".
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:25 col:-1 :
> org.xml.sax.SAXParseException: Attribute "xmlns:xsi
> " is not declared for element "web-app".
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:26 col:-1 :
> org.xml.sax.SAXParseException: Attribute "xsi:schem
> aLocation" is not declared for element "web-app".
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:26 col:-1 :
> org.xml.sax.SAXParseException: Attribute "version"
> is not declared for element "web-app".
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:28 col:-1 :
> org.xml.sax.SAXParseException: Element type "descri
> ption" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:85 col:-1 :
> org.xml.sax.SAXParseException: Element type "servle
> t" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:86 col:-1 :
> org.xml.sax.SAXParseException: Element type "servle
> t-name" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:87 col:-1 :
> org.xml.sax.SAXParseException: Element type "servle
> t-class" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:88 col:-1 :
> org.xml.sax.SAXParseException: Element type "init-p
> aram" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:89 col:-1 :
> org.xml.sax.SAXParseException: Element type "param-
> name" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:90 col:-1 :
> org.xml.sax.SAXParseException: Element type "param-
> value" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:112 col:-1 :
> org.xml.sax.SAXParseException: Element type "load-
> on-startup" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:254 col:-1 :
> org.xml.sax.SAXParseException: Element type "servl
> et-mapping" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:256 col:-1 :
> org.xml.sax.SAXParseException: Element type "url-p
> attern" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:284 col:-1 :
> org.xml.sax.SAXParseException: Element type "sessi
> on-config" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:285 col:-1 :
> org.xml.sax.SAXParseException: Element type "sessi
> on-timeout" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:302 col:-1 :
> org.xml.sax.SAXParseException: Element type "welco
> me-file-list" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:303 col:-1 :
> org.xml.sax.SAXParseException: Element type "welco
> me-file" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:309 col:-1 :
> org.xml.sax.SAXParseException: Element type "local
> e-encoding-mapping-list" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:310 col:-1 :
> org.xml.sax.SAXParseException: Element type "local
> e-encoding-mapping" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:310 col:-1 :
> org.xml.sax.SAXParseException: Element type "local
> e" is not declared.
> [java] Sep 22, 2004 12:04:56 PM org.mortbay.xml.XmlParser$Handler error
> [java] WARNING: ERROR@null line:310 col:-1 :
> org.xml.sax.SAXParseException: Element type "encod
> ing" is not declared.
> [java] Sep 22, 2004 12:04:56 PM
> org.mortbay.jetty.servlet.WebApplicationContext start
> [java] WARNING: Configuration error on
> C:\depot\\source\Java/jetty/project/webadmin/delegated_admin
> [java] org.xml.sax.SAXParseException: Element type "web-app" is not
> declared.
> [java] at
> org.apache.crimson.parser.Parser2.error(Parser2.java:3354)
> [java] at
> org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1502)
> [java] at
> org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
> [java] at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
> [java] at
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
> [java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> [java] at org.mortbay.xml.XmlParser.parse(XmlParser.java:206)
> [java] at org.mortbay.xml.XmlParser.parse(XmlParser.java:224)
> [java] at
>
org.mortbay.jetty.servlet.XMLConfiguration.configureDefaults(XMLConfiguration.jav
> a:93)
> [java] at
>
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:
> 395)
> [java] at org.mortbay.http.HttpServer.start(HttpServer.java:678)
>
>
> web.xml looks something like:
>
> <?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>
>
> <context-param>
> <param-name>MODE</param-name>
> <param-value>webadmin</param-value>
> </context-param>
>
> <filter>
> <filter-name>setCharacterEncodingFilter</filter-name>
> <filter-class>webadmin.SetCharacterEncodingFilter</filter-class>
> <init-param>
> <param-name>encoding</param-name>
> <param-value>UTF-8</param-value>
> </init-param>
> </filter>
> <filter-mapping>
> <filter-name>setCharacterEncodingFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <servlet>
> <servlet-name>webadmin.delegatedadmin.jsp.add_jsp</servlet-name>
> <servlet-class>webadmin.delegatedadmin.jsp.add_jsp</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>webadmin.delegatedadmin.jsp.add_jsp</servlet-name>
> <url-pattern>/add.jsp</url-pattern>
> </servlet-mapping>
> </web-app>
>
> _________________________________________________________________
> Scan and help eliminate destructive viruses from your inbound and outbound
> e-mail and attachments.
>
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
> Start enjoying all the benefits of MSN Premium right now and get the
> first two months FREE*.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> jetty-discuss mailing list
> jetty-discuss@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/jetty-discuss
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_________________________________________________________________
Scan and help eliminate destructive viruses from your inbound and outbound e-mail and attachments. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise