0
votes

For some reason Apache Tomcat 7.0 doesn't run my main servlet(PlaceListServlet) that should list a bunch of database items on place-list.jsp page.

I keep getting 404 everywhere, and Eclipse doesn't report any errors in the source.

What seems to be the problem?

PlaceListServlet.java (main servlet that should load place-list.jsp):

package com.myproject.crud;

import java.io.IOException;

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

@SuppressWarnings("serial")
@WebServlet({"/place/", "index.jsp"})
public class PlaceListServlet extends HttpServlet {

    @Inject
    private PlaceRepositoryImpl placeRepo = new PlaceRepositoryImpl();

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setAttribute("places", placeRepo.listPlaces());
        getServletContext().getRequestDispatcher("/WEB-INF/pages/place-list.jsp").forward(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }

}

EDIT:

I just looked at the console and saw this error:

SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Oct 19, 2012 11:34:45 AM org.apache.catalina.core.StandardContext listenerStart SEVERE: Skipped installing application listeners due to previous error(s) Oct 19, 2012 11:34:45 AM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart Oct 19, 2012 11:34:45 AM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/GBCPlacesCRUD] startup failed due to previous errors Oct 19, 2012 11:34:45 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Oct 19, 2012 11:34:45 AM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Oct 19, 2012 11:34:45 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 1096 ms

1
Could you please send you web.xml and let us know what is the URL that you tried in the browser.Sreedhar
Did you make sure that the application is successfully started? Check it using the manager app.toniedzwiedz
@Tom Yes. I right click on the project and select Run As...>Run on Server.user1701467
Clicking doesn't really seal the deal. Many things happen between the click and the actual deployment. Tomcat has a manager webapp that lets you manage the applications deployed. Among other things, their current status is displayed. Have you checked it?toniedzwiedz
A small piece of advice here, that I've given many times for similar situations - get rid of the Eclipse Tomcat plugin, and deploy your app to a stand-alone Tomcat instance. All of your weird deployment issues will likely be resolved.GreyBeardedGeek

1 Answers

0
votes

Adding javax.faces-2.1.13.jar to the project fixed the issue.

http://javaserverfaces.java.net/