We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Servlet - Requested Resource is not available

monica73174
monica73174 asked
on
Medium Priority
902 Views
Last Modified: 2012-06-21
I have a servlet named ControllerServlet in this directory C:\Tomcat 6.0\webapps\burnaby\WEB-INF\classes\  
I have the following deployment descriptor.  I keep getting the error that the requested resource is not available.  I use this link on my local machine.  http://localhost:8081/burnaby/servlet/ControllerServlet

I am stuck and am not sure what I am doing wrong.  

<?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>
  <!-- Define the controller servlet -->
  <servlet>
    <servlet-name>ControllerServlet</servlet-name>
    <servlet-class>ControllerServlet</servlet-class>
    
    <servlet-mapping>
    <servlet-name>ControllerServlet</servlet-name>
    <url-pattern>/servlet/ControllerServlet</url-pattern>
    </servlet-mapping>
 
    <!-- Define initial parameters that will be loaded into 
       the ServletContext object in the controller servlet -->
    <init-param>
      <param-name>base</param-name>
      <param-value>http://localhost:8081/burnaby/servlet/ControllerServlet</param-value>
    </init-param>
    <init-param>
      <param-name>jdbcDriver</param-name>
      <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
    </init-param>
    <init-param>
      <param-name>imageUrl</param-name>
      <param-value>http://localhost:8081/burnaby/images/</param-value>
    </init-param>
    <init-param>
      <param-name>dbUrl</param-name>
      <param-value>jdbc:odbc:Burnaby</param-value>
    </init-param>
    <init-param>
      <param-name>dbUserName</param-name>
      <param-value></param-value>
    </init-param>
    <init-param>
      <param-name>dbPassword</param-name>
      <param-value></param-value>
    </init-param>
  </servlet>
</web-app>

Open in new window

Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
try moving ControllerServlet class into a package

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
eg. to move it into package controller you would

1. add package statement to ControllerServlet class

package controller;

public class ControllerServlet ....

2. The class will now be in WEB-INF/classes/controller

3.  change mapping to:

 
    ControllerServlet
    controller.ControllerServlet
   

Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
 
    ControllerServlet
    ControllerServlet


thats also missing a closing

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
I had the servlet-mapping inside the servlet tag.  Your last answer helped a lot.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.