404 error running basic servlet on cloudbees

157 views Asked by At

The reason I mentioned cloudbee's was to make sure there wasn't a special setting I had to change.

Here is my test code to make sure it is working...

package test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class testing
 */
@WebServlet("/testing")
public class testing extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**i
     * @see HttpServlet#HttpServlet()
     */
    public testing() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        out.println("test");
    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */`enter code here`
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
    }

}

It works on local tomcat7...But when I upload it to Cloudbees via .war file I get the 404 error.

Error

I tried exporting with Java 6, with/without optimizing for tomcat 7 (since cloudbees does tomcat6)...

Any ideas of another setting I am missing?

1

There are 1 answers

0
Bowhuntr11 On

Well I figured it out...

For some reason the default web.xml file was not created. Wasn't there at all. Weird.