Tomcat 404 error until I apply this change to my web.xml mapping

What is the purpose of the /servlet/ portion of the url-pattern in the servlet mapping element below.
If I use the first few lines I get a 404 class not found error
If I include /servlet/ in the url-pattern element then my app works fine ?????
//Does not work
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>com.onjava.login</url-pattern>
</servlet-mapping>
//works !!
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/servlet/com.onjava.login</url-pattern>
</servlet-mapping>

If the first mapping doesn't work and the second mapping works then my guess is that neither mapping is working. What may be happening is the invoker servlet may be enabled and that would explain why the /servlet url works.
The invoker servlet is set up in the conf/web.xml file. This servlet will invoke a particular servlet using the class name and the /servlet url. In newer versions of tomcat the invoker servlet id disabled by default.
Now the question is why does the servlet mapping not work? What version of tomcat are you running? Can you post the entire web.xml?

Similar Messages

  • Tomcat 404 error while running jsp

    Hi all,
    I am trying to deploy a project on our intranet server. But when i give the url
    on the browser it gives the error " HTTP ERROR 404 resourse not available"
    It is not able to find the location o the index page.
    Rest other projects which are already there in webapps are working well.
    But now when i m trying to upload any new jsp or html , it gives the 404 error.
    I have stored the jsp file inside webapps folder. I m using Jakarta tomcat 4.1.18 version.

    as in "webapps/index.jsp"? You don't put files in webapps, you put files in an web app directory, which goes in webapps, e.g. "webapps/myapp/index.jsp"

  • How can I change application's web.xml in NetWeaver CE 7.1?

    Hello Experts,
    Please help me. I need to configure a J2EE application on NetWeaver 7.1, but I don't know how I can change the web.xml of the application.
    The web.xml of the app needs to be modified during the configuration. This can be achieved via single-file-update in VA in Netweaver 6.4 or 7.0. But I cannot figure out how to do that in NW 7.1.
    Please show me how to do that or at least give me some hints.
    Thank you!
    Jack

    Hi Jack,
    In SAP NetWeaver 7.1 and later, you use the SAP NetWeaver Administrator instead of Visual Administrator.
    To get some information on how to configure web applications, try [THIS|http://help.sap.com/saphelp_nwce10/helpdata/en/45/48a60a528608d1e10000000a11466f/frameset.htm] piece of documentation.
    I hope it helps.
    Best,
    Yordan

  • 404 errors with welcome file

    Here's a strange one.
    I've successfully deployed a test application
    with welcome-file-list directive as the only
    entry (besides required ?xml and DOCTYPE headers).
    When I attempt to access my page e.g., http://myMachine:port/testApp, the URL
    changes to read http://myMachine:port/testApp/welcome.htm as expected
    but I get 404 errors saying the page cannot be found.
    Web.xml successfully passes my XML parser so I don't think
    that is the problem.
    Any ideas?
    Thanks,
    TC Young

    Hi.
    What's the layout of your webapp directory structure? More to the point,
    your welcome.htm file should be in the root directory of your webapp. Can
    you confirm this is where you have it?
    Also, please post the relevant bits of your web.xml file here.
    Thanks,
    Michael
    TC Young wrote:
    My apologies.
    I'm running WL 6.1 on Solaris 2.6.
    The weblogic logs do not mention any 'Resource not found'
    exceptions.
    Thanks.
    "TC Young" <[email protected]> wrote:
    Here's a strange one.
    I've successfully deployed a test application
    with welcome-file-list directive as the only
    entry (besides required ?xml and DOCTYPE headers).
    When I attempt to access my page e.g., http://myMachine:port/testApp,
    the URL
    changes to read http://myMachine:port/testApp/welcome.htm as expected
    but I get 404 errors saying the page cannot be found.
    Web.xml successfully passes my XML parser so I don't think
    that is the problem.
    Any ideas?
    Thanks,
    TC Young
    Michael Young
    Developer Relations Engineer
    BEA Support

  • My Word for Mac 2011 repeatedly fails to display certain text boxes if I apply text changes. How can I view the invisible text?

    I have Mac OS X 10.6.8. I recently had to download Office for Mac 2011, as my company mandated this over my objections. On the first 20-page Word file I received, the file looked fine until I applied track changes and made the first edit. At that point, 2 pages of text disappeared (the entire file was Calibri 11 size). The disappearing text was all in a couple of text boxes separate from the rest of the file. If I did a search, it would point to the white screen, but I could not view it except in Web layout, which is unsuitable for track changes. Unfortunately, all my supervisors say they can see the text that I cannot see.
    I know that Word 2011 is notorious for not reading fonts, but this file is all in the same font/size. How can I see the hidden text before I lose my job?

    Have you tried Word for Mac?
    You will need to test if links survive export or printing to .pdf
    Peter

  • How to solve the 404 error

    Hi,
    How to catch or solve the 404 error in application.
    Some time we are giving some file name but that file is not avialable at that time it will give 404 error. how to avoid this error.
    If 404 error comes i want call some other file. Is it posible.
    Thanks Advance.

    Yes, this is because IE 5.5 (?) and higher have this wacky "Show friendly HTTP error messages" setting. You can disable this by going to tools -> internet options -> advanced and unchecking "Show friendly HTTP error messages". However as the default IE setting has "Show friendly HTTP error messages" enabled this isn't a good solution.
    I believe that if your error page is less than a certain size (in bytes) then IE defaults to it's own error page when "Show friendly HTTP error messages" are enabled. This size is something like 512 bytes or fewer in length.
    So basically try making your error page larger (more than 512 bytes in size) and see if that works.

  • Still getting 404 error. Again!

    clicking last post link gives me 404 error. Isn't this stuff ever going to be fixed?
    Is Adobe so complacent now that this is what we are to expect from Adobe software from now on?

    Buko. wrote:
    clicking last post link gives me 404 error.
    There used to be a rifle bore which was a .303 (still in use) and popularly referred to as just a 303..  Very efficacious (as rifles go) and very popular. Numerous soldiers, para-military forces and cops have shot themselves in the head, foot and other parts of their anatomy with this extremely versatile bore... Perhaps Adobe, with their 404 is sending us a signal? A message that they're now, no longer in version 3 of FUps but have progressed?
    PS: I know, i know, i know... that the 404 message is not an Adobe proprietary...

  • HTTp 404 error in servlet

    When ever i try to invoke a servlet it says HTTP 404 The page cannot be
    found.Allthe mappings in web.xml are perfect.I am using WAS6.1
    But HTML and JSP files work perfect.Even if I give a mapping for JSP it works fine.
    But servlets alone are not getting invoked.Please suggest a solution.

    My suggestion is that:
    1) your mappings are actually not perfect
    2) your classes are not stored properly or your packages are faulty
    Please provide some additional details, such as what packages you are using and where you are storing your classes. Also post a sample servlet mapping from your web.xml

  • Web.xml parsing error

    Hello,
    I am a newbie to servlet programming. I am using Tomcat4.1.24. When I
    am trying out some examples, I got a bunch of parsing errors. After double-checking my web.xml, I still do not see why it caused so many parsing errors. I am using NotePad to edit web.xml, does that affect this? These errors are always about the last line and the last column.
    Very weird. Please help.
    web.xml
    <?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>HelloWorld</servlet-name>
         <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet>
         <servlet-name>Primes</servlet-name>
         <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>
    [ERROR] Digester - -Parse Error at line 29 column 11: The content of element typ
    e "web-app" must match "(icon?,display-name?,description?,distributable?,context
    -param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-conf
    ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resou
    rce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e
    jb-local-ref*)". <org.xml.sax.SAXParseException: The content of element type "we
    b-app" must match "(icon?,display-name?,description?,distributable?,context-para
    m*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
    ime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-r
    ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-lo
    cal-ref*)".>

    Hi.
    The answer is rather simple. The file is not valid against the XML v.1.0 standard. That's because all <servlet> elements must come first before all <servlet-mapping> elements. If you change the order of the Primes <servlet> element, the file is valid and Tomcat should not throw an exception.
    This is the correct web deployment descriptor:
    <?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>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Primes</servlet-name>
    <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

  • [Problem] Define Error Codes in web.xml

    Hi everybody!
    What I want to do is very simple to explain:
    For our web-application I have designed a global error pages, that should appear, whenever an error occurs. Not matter if it is an 500 a 404 or a 202. Always the same page, that does the processing of the error in the background.
    In the web-xml if defined it like this: (for example for a 500 error)
    <error-page>
          <error-code>500</error-code>
          <location>/global_error_page.jsp</location>
    </error-page>Now I want to alter the web.xml in a way, that this error page is called for all possible error-codes, without writing a whole block for each error-code.
    For some reason <error-code>*</error-code> does not work.
    And ideas, suggestions?
    Thanks in Advance!
    Stef

    i have done it for collecting Database errors but not successful in doing it for Catch errors.
    The way to do it for DB errors is to return error through pragma and in try itself store it in a String and use requestDispatcher by setting attribute and getting the same in JSP. But this should be inside try to work.
    For Java errors i have defined error code in web.xml
    so the possible java errors shows the error page.

  • Web.xml in tomcat

    hi all,
    i'm using Tomcat as a server.i don't know how to use web.xml.i don't want to change values in my servlets.i want to change values thru web.xml.i don't know the procedure to read values from web.xml toservlets.if any body knows let me know.
    Thanks in advance

    All you have to do is add parameters to the <init-param> section for you servlet. Then you can read it in using the getInitParameter( name ) method in the servlet. For example I'm reading in a configuration file for my servlet so I added it to the web.xml. Then in my servlet I just do the following to get my configuration file location:
    String config = getInitParameter( "configFile" );
    This is my entry in web.xml file:
    <servlet>
    <servlet-name>
    MyServlet
    </servlet-name>
    <servlet-class>
    com.xxxx.controller.MyServlet
    </servlet-class>
    <init-param>
    <param-name>configFile</param-name>
    <param-value>
    /jakarta-tomcat-3.2.2/htdocs/WEB-INF/init.conf
    </param-value>
    </init-param>
    <load-on-startup>
    5
    </load-on-startup>
    </servlet>
    MyServlet
    Hope this helps

  • Bex iView does not show changes made in web templates

    Hello,
    I have a Bex iView that presents a web template which is exposed in two portals.
    I made a certain change in the web template in portal A and I can see the change through the Bex iView in this portal.
    I than transfered the change to portal B and I can see this change at the Web application designer's code when it is connected to portal B.
    The problem is that I can't see the change through the Bex iView in portal B, it keeps presenting the old version of the web template. Also, if I preview it from WAD, which opens it in the portal, it shows the old version as well.
    <b>I've already tried/verified the following:</b>
    1. It's not a client related issue as it happens to all clients.
    2. I have tried clearing both the client and the portal's pcd caches.
    3. No cache whatsoever is configured in this iView's properties (Cache Level: None, Cache Validity Period: 0,0,0,-1, Allow Client-Side Caching: No).
    4. When I run the iView in debug mode in the application integrator I can't see anything unusual I can think of. Also, I can see there that it points to the correct web template.
    5. Retransported the web template from server A to server B.
    What else can be done here? Any ideas...?

    Hello,
    did you resolve your problem ?
    Best regards

  • Making changes in web.xml dynamically

    Hi all,
    I have a requirement in which i need to redirect request to com site if it is from desktop browser and to WAP site if request for wap site or from a mobile device
    Have servlet ready doing it but presently taking only to two harcoded URLS of .com and .mobile sites.in web.xml.
    Now i want dynamic changes in web.xml through a servlet to changes those URLs to respective request.
    Thanks in advance,
    dcosta_halo

    The web.xml file is only a data storage file. When a Java Web Server starts up, it read the web.xml file and creates the appropriate objects that live in the JVM and manage parts of the applications hosted by the server. Any changes to the web.xml data file while the server is running are lost once the server is turned off. You need to figure out another design, possibly having the servlet read a database table to get URL strings.

  • Can we change the web.xml file name???????

    can we change the name web.xml and struts-config.xml file to other name.....if yes, then how..........

    you can change the name of struts-congig.xml file
    and change the strut-config file name in web.xml also.
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>And you also try rename the file web.xml and run the application and check what is happening...

  • Got "HTTP - 404" error when apply change of report attributes

    Environment:
    Oracle 10g (not XE)
    APEX 3.1.2.00.02
    Oracle HTTP Server
    I tried to modify a page in "101 - Sample Application", changed the report attributes (changed the heading type from Column Names to Customer), and when I applied the change, I got a "HTTP - 404 Page not found" error.
    In error log file of Apach, the error message is "mod_plsql: /pls/apex/wwv_flow.accept HTTP-404 ORA-25402......"
    Anyone can help me? Thanks.

    Please tell us your first name and update your profile with it to help us. Thanks.
    changed the report attributes (changed the heading type from Column Names to Customer)I don't follow that.
    Can you install this application into your workspace on apex.oracle.com (request one if necessary) and reproduce this problem there?
    Scott

Maybe you are looking for