0

I have a remote tomcat 6.0.24 server on which there is a web-app. Now when I type in a specific url ( website/wordbank/xmldictionaryservice ) that is mapped on the server I get the following:

HTTP Status 404 - Servlet xmldictionaryserviceservlet is not available

type: Status report

message: Servlet xmldictionaryserviceservlet is not available

description: The requested resource (Servlet xmldictionaryserviceservlet is not available) is not available.

...where I'm expecting a tiny form with a file selector and a submit button.

The relevant part of the web.xml is here:

<web-app>
...
    <servlet>
        <servlet-name>xmldictionaryserviceservlet</servlet-name>
        <servlet-class>wordbank.servlets.XMLDictionaryServiceServlet</servlet-class>
    </servlet>
...
    <servlet-mapping>
        <servlet-name>xmldictionaryserviceservlet</servlet-name>
        <url-pattern>/xmldictionaryservice</url-pattern>
    </servlet-mapping>
...
</web-app>

The contents of the xmldictionaryservice.jsp:

<html>
<body>

<form action="xmldictionaryservice" method="post" enctype="multipart/form-data">
<input name="xmlfile" type="file">
<input name="send" type="submit">
</form>

</body>
</html>

The directory tree is:

webapps
 |
 ...
 +-wordbank
    |
    ...
    +-xmldictionaryservice.jsp
    +-WEB-INF
       |
       +-web.xml
       +-classes
          |
          +-wordbank
             |
             ...
             +-servlets
                |
                ...
                +-XMLDictionaryServiceServlet.class

I have checked the various similar threads, but they haven't helped me. Does anyone have an idea of what is wrong here?

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
Litir
  • 1
  • 1
  • 2
  • how are you accessing the jsp? what is the url? – Ramesh PVK Jun 21 '12 at 10:32
  • Could be *anything*. Did you check your logs? Are you actually including the context in your form's action and not showing it here? – Dave Newton Jun 21 '12 at 10:46
  • RameshPVK the url is websitename.TLD/wordbank/xmldictionaryservice @DaveNewton I'm not hiding anything in the form. The logs show this: Jun 19, 2012 1:42:48 PM org.apache.catalina.core.StandardWrapperValve invoke INFO: Servlet xmldictionaryserviceservlet is currently unavailable – Litir Jun 21 '12 at 11:31

3 Answers3

1

Servlet xmldictionaryserviceservlet is not available

This particular Tomcat-specific message means that the following has under Tomcat's covers failed during webapp's startup:

String servletClass = "wordbank.servlets.XMLDictionaryServiceServlet";
String servletUrlPattern = "/xmldictionaryservice";

Servlet servlet = (Servlet) Class.forName(servletClass).newInstance();
servlet.init(servletConfig);
servlets.put(servletUrlPattern, servlet);

So, the possible causes are at least that the servlet class cannot be found, or that the servlet's default constructor does not exist or threw an exception, or that the init() method threw an exception, or that the class does not implement Servlet (read: extend HttpServlet) at all.

Information about this problem should be available early in the server log, during the startup. Read your server log once again to find the real exception and stacktrace and fix the servlet class accordingly.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

Tomcat is recognizing the URL and hence trying to load the XMLDictionaryServiceServlet to create the instance. It seems that there is problem in loading the class XMLDictionaryServiceServlet double check whether the class(XMLDictionaryServiceServlet) is following servlet convention or not.

Can you please paste the source code of XMLDictionaryServiceServlet.java

Rais Alam
  • 6,970
  • 12
  • 53
  • 84
0

Restarting the environment would do the job. Its too frequent in eclipse

Ravi Teja
  • 21
  • 1
  • 6