2 Replies Latest reply on Jul 29, 2002 7:19 PM by Russ Ferriday

    silly servlet-mapping problem?

    Russ Ferriday Newbie

      Env:
      JBoss 3.0.1RC1 & jetty
      JBuilder 6

      Here's my application.xml...
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">

      ..<display-name>shopMain</display-name>
      ..
      ....shopMain.jar
      ..
      ..
      ....
      ......<web-uri>store.war</web-uri>
      ......<context-root>store</context-root>
      ....
      ..


      and my web.xml...
      <?xml version="1.0" encoding="UTF-8"?>
      <!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>
      ..
      ....<servlet-name>popdb</servlet-name>
      ....<servlet-class>com.topia.shopmain.web.PopDB</servlet-class>
      ....<load-on-startup>1</load-on-startup>
      ..
      ..
      ....<servlet-name>y</servlet-name>
      ....<jsp-file>/x.jsp</jsp-file>
      ....<load-on-startup>2</load-on-startup>
      ..
      ..<servlet-mapping>
      ....<servlet-name>popdb</servlet-name>
      ....<url-pattern>/popdbx</url-pattern>
      ..</servlet-mapping>
      ..<servlet-mapping>
      ....<servlet-name>y</servlet-name>
      ....<url-pattern>/yx</url-pattern>
      ..</servlet-mapping>
      </web-app>

      So why do I receive the following responses to the following URL's:

      http://localhost:8080/store/popdb OK
      http://localhost:8080/store/popdbx HTTP ERROR: 404 Could not find resource for /store/popdbx

      http://localhost:8080/store/x.jsp OK
      http://localhost:8080/store/y HTTP ERROR: 404 Could not find resource for /store/y

      The intention is that popdbx be an alias for popdb.
      Likewise y for x.
      Can anyone suggest an answer?

      It does not help if context-root is /store
      Jetty deploys fine, and I see popdb and y init messages. Not a class loading problem!

      TIA,
      --r.

        • 1. Re: silly servlet-mapping problem?
          chris perreault Newbie

          im having the exact same problem. have you figured anything out?

          • 2. Re: silly servlet-mapping problem?
            Russ Ferriday Newbie

            Well I'm glad that I'm not the only one.
            Have you found anything more in the meantime?

            Below is part of a message I received back from Brett Sealey on the Jetty-support list. He makes some good points , but you can see that he's surprised that popdb works. IF it works, I'd want "y" to work, too, of course it does not. I've moved onto other parts of the project hoping for some understanding of the problem to come from this list. But after much redeployment and work on other jsp and ejb issues, I still have the problem. This says that the issue is not being "out of sync" with DD.

            Can you post some data that we can refer people to?

            Let's collaborate on this.
            --r.
            mailto:russf@topia.com

            >So why do I receive the following responses to the following URL's:
            >
            > http://localhost:8080/store/popdb OK


            This should not be working based on the above config...


            > http://localhost:8080/store/popdbx HTTP ERROR: 404 Could not find
            > resource for /store/popdbx


            This should be OK. Are you sure that you are really running the above config?

            > http://localhost:8080/store/x.jsp OK
            > http://localhost:8080/store/y HTTP ERROR: 404 Could not find resource
            > for /store/y

            There is no mapping for /store/y, you've only got one for /yx


            > The intention is that popdbx be an alias for popdb.
            > Likewise y for x.
            > Can anyone suggest an answer?


            You've no mapping for /popdb. The servlet name is just a logical name - it
            is not used for match request URLs - that is what the url-pattern is for.

            > It does not help if context-root is /store
            > Jetty deploys fine, and I see popdb and y init messages. Not a class
            > loading problem!