web.xml, jboss and xerxes

Discussion in 'Java' started by Juergen, Aug 10, 2004.

  1. Juergen

    Juergen Guest

    Hi all,

    I am trying to deploy my first war onto jboss when I get the following
    exception:

    09:48:41,791 ERROR [Digester] Parse Error at line 13 column 68:
    Attribute "url-pattern" must be declared for element type
    "servlet-mapping".
    org.xml.sax.SAXParseException: Attribute "url-pattern" must be
    declared for element type "servlet-mapping".
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
    at org.apache.xerces.impl.XMLErrorReporter.reportError
    ....

    The web.xml looks as follows:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <error-page>
    <error-code>404</error-code>
    <location>/notfound.jsp</location>
    </error-page>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
    </web-app>

    looks as if everything is in there. Any hints?

    Thanks in advance

    Juergen
    Juergen, Aug 10, 2004
    #1
    1. Advertising

  2. In article <>,
    (Juergen) wrote:

    > <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>


    Shouldn't those be elements rather than attributes?

    dtd: <!ELEMENT servlet-mapping (servlet-name, url-pattern)>

    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

    --
    Phillip Mills
    Multi-platform software development
    (416) 224-0714
    Phillip Mills, Aug 10, 2004
    #2
    1. Advertising

  3. Juergen

    Juergen Guest

    Many thanks Phillip,

    now I stumbled over another exception:

    org.xml.sax.SAXParseException: The content of element type "web-app"
    must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
    ....

    How do I have to interpret the question mark and asterisk in the
    element match list? I would guess it has something to do with optional
    and mandatory elements ?! Some web.xml's I looked into specifiy a
    servlet class others not. But I don't think I have to as my little web
    app I want to see running does just contain jsp's, what I learned will
    compile to a servlet within tomcat.

    By the way my little web app I got from "Java toole for XP" from R.
    Hightower in case someone is familair with it.

    Thanks

    Juergen

    Phillip Mills <> wrote in message news:<Lr3Sc.12961$>...
    > In article <>,
    > (Juergen) wrote:
    >
    > > <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>

    >
    > Shouldn't those be elements rather than attributes?
    >
    > dtd: <!ELEMENT servlet-mapping (servlet-name, url-pattern)>
    >
    > <servlet-mapping>
    > <servlet-name>invoker</servlet-name>
    > <url-pattern>/servlet/*</url-pattern>
    > </servlet-mapping>
    Juergen, Aug 11, 2004
    #3
  4. In article <>,
    (Juergen) wrote:

    > How do I have to interpret the question mark and asterisk in the
    > element match list? I would guess it has something to do with optional
    > and mandatory elements ?!


    Here's something to read. If you click on the 'DTD Elements' link it
    will give you answers to your specific questions, but you might find the
    whole thing useful.

    <http://www.w3schools.com/dtd/default.asp>

    --
    Phillip Mills
    Multi-platform software development
    (416) 224-0714
    Phillip Mills, Aug 11, 2004
    #4
  5. Juergen

    Juergen Guest

    looks usefull!

    Thanks

    Juergen
    Juergen, Aug 12, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. satish mn via JavaKB.com
    Replies:
    0
    Views:
    406
    satish mn via JavaKB.com
    Nov 25, 2004
  2. han
    Replies:
    0
    Views:
    464
  3. Jubz
    Replies:
    0
    Views:
    2,209
  4. LprzemekL
    Replies:
    0
    Views:
    512
    LprzemekL
    Apr 10, 2008
  5. eric
    Replies:
    1
    Views:
    281
    red floyd
    Aug 10, 2011
Loading...

Share This Page