This discussion is archived
9 Replies Latest reply: Aug 8, 2012 7:25 AM by 954110 RSS

318 Servlets work, 1 does not (404 error)

954110 Newbie
Currently Being Moderated
The web application I am working on has, at last count 319 servlets declared in the web.xml file, all of which work except for the last one I put in. When I try to access it, I receive a 404 error.

The class declaration is as follows:
package vw.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import vw.Constants;
import vw.VWPcInboundTrailer;
import vw.VWTransactor;
import vw.VWUtil;
import vw.ValidateException;

public class actProcessInboundTrailerDetail extends PageAction { 
The (highly edited) web xml is as follows:
<?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>
     <servlet>
          <servlet-name>actProcessInboundTrailerDetail</servlet-name>
          <servlet-class>vw.action.actProcessInboundTrailerDetail</servlet-class>
     </servlet>

     <servlet-mapping>
          <servlet-name>actProcessInboundTrailerDetail</servlet-name>
          <url-pattern>/actProcessInboundTrailerDetail/*</url-pattern>
     </servlet-mapping>
     
</web-app>
I have put the web.xml through an xml validator and it is well-formed.

And the url I attempt to access is:
http://localhost:7001/actProcessInboundTrailerDetail

I have to confess I'm rather stumped. Everything seems correct to me. Can anyone see what I'm missing?
  • 1. Re: 318 Servlets work, 1 does not (404 error)
    murali veligeti - oracle Expert
    Currently Being Moderated
    Hi,

    The url-pattern you mentioned is <url-pattern>/actProcessInboundTrailerDetail/*</url-pattern> instead of <url-pattern>/actProcessInboundTrailerDetail</url-pattern>. Remove "/*". Now it will work fine.

    Thanks & Regards,
    Murali.
    ===========
  • 2. Re: 318 Servlets work, 1 does not (404 error)
    Kalyan Pasupuleti-Oracle Expert
    Currently Being Moderated
    Hi,

    Your configuration are correct but make sure that your Servlet is properly compiled and its .class file is exists in specific package.

    Check your files again.

    Regards,
    Kal
  • 3. Re: 318 Servlets work, 1 does not (404 error)
    954110 Newbie
    Currently Being Moderated
    Murali Veligeti wrote:
    Hi,

    The url-pattern you mentioned is <url-pattern>/actProcessInboundTrailerDetail/*</url-pattern> instead of <url-pattern>/actProcessInboundTrailerDetail</url-pattern>. Remove "/*". Now it will work fine.

    Thanks & Regards,
    Murali.
    ===========
    No go. This did not work. For a lark I tried "<url-pattern>/actProcessInboundTrailerDetail*</url-pattern>" as well. Both still result in the same error.
  • 4. Re: 318 Servlets work, 1 does not (404 error)
    954110 Newbie
    Currently Being Moderated
    kalyan Pasupuleti wrote:
    Hi,

    Your configuration are correct but make sure that your Servlet is properly compiled and its .class file is exists in specific package.

    Check your files again.

    Regards,
    Kal
    The class file is in place.
  • 5. Re: 318 Servlets work, 1 does not (404 error)
    RenévanWijk Oracle ACE
    Currently Being Moderated
    Just a little recap on you situation. The application was deployed first with 318 servlet, then you added one and updated the deployment?

    What could be the case is that the web.xml in the $DOMAIN_HOME/server/servername/tmp directory is not updated. Note that WebLogic
    unpacks your application is this directory.

    What you can try is first delete the application (also check if it has been deleted in the tmp directory) and then install it again.

    Are there also no error in the logging, that are related to the servlet?
  • 6. Re: 318 Servlets work, 1 does not (404 error)
    954110 Newbie
    Currently Being Moderated
    René van Wijk wrote:
    Just a little recap on you situation. The application was deployed first with 318 servlet, then you added one and updated the deployment?

    What could be the case is that the web.xml in the $DOMAIN_HOME/server/servername/tmp directory is not updated. Note that WebLogic
    unpacks your application is this directory.

    What you can try is first delete the application (also check if it has been deleted in the tmp directory) and then install it again.

    Are there also no error in the logging, that are related to the servlet?
    I am currently working in a dev environment; the last actual deploy had 313 servlets. I have successfully added five. The sixth is not working for some reason that I cannot fathom.

    Since this is a dev environment, the deploy is exploded, not war-based; I do not find that tmp directory.

    Undeploying, deleting, and redeploying did not remedy the problem.

    Edit: I do not find any errors in the log corresponding to my attempts to access the servlet.

    Further edit: This is definitely the right track. I was able to remove the servlet-mapping for a different servlet without losing the ability to access that servlet. Clearly, the application server is paying attention to a cached copy of the web.xml. I just have to find it. The question now becomes where is it?

    Edited by: 951107 on Aug 7, 2012 7:32 AM

    Edited by: 951107 on Aug 7, 2012 9:02 AM
  • 7. Re: 318 Servlets work, 1 does not (404 error)
    954110 Newbie
    Currently Being Moderated
    Ok, I found what looked like a parallel application installation and removed it. The applicaiton now responds to changes to web.xml, but the original problem remains.

    I can find no other copies or caches.
  • 8. Re: 318 Servlets work, 1 does not (404 error)
    RenévanWijk Oracle ACE
    Currently Being Moderated
    You have the following in your code: public class actProcessInboundTrailerDetail extends PageAction

    The PageAction (or other class) extends the HttpServlet class, or is this not the case?

    Could you implement (maybe it is already done so) the three main lifecycle methods of the servlet (init, destroy, service),
    and in one of the three put some logging, for example, just a System.out.println, and see if this shows up in the logging.

    You can also add the JVM option -verbose:class (if you are on HotSpot), with JRockit you can use -Xverbose:class,codegen (http://docs.oracle.com/cd/E15289_01/doc.40/e15062/optionx.htm#i1020876)
    to see if the servlet gets loaded or not.
  • 9. Re: 318 Servlets work, 1 does not (404 error)
    954110 Newbie
    Currently Being Moderated
    Thank you, Rene.

    Adding debug statements in those methods shows that it is, in fact, invoking the service() method of the servlet. The problem must be somewhere in the workings of the class the itself. I will continue to add more debug statements until I corner the error.

    I also think an overhaul of the logging framework is in order, but that's hardly within the scope of this thread.

    Thanks again.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points