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.
出于某种原因,Apache Tomcat 7.0不运行应该在place-list.jsp页面上列出一堆数据库项的主servlet(PlaceListServlet)。
I keep getting 404 everywhere, and Eclipse doesn't report any errors in the source.
我一直在到处获得404,Eclipse不会在源代码中报告任何错误。
What seems to be the problem?
什么似乎是问题?
PlaceListServlet.java (main servlet that should load place-list.jsp
):
PlaceListServlet.java(应该加载place-list.jsp的主servlet):
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)
严重:在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)中配置类com.sun.faces.config.ConfigureListener java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener的应用程序侦听器时出错)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)org.apache.catalina.core.DefaultInstanceManager。 org.apache上的org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)中的loadClassMaybePrivileged(DefaultInstanceManager.java:514)org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)中的.catalina.core.StandardContext.startInternal(StandardContext.java:5285)org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase) .java:1559)在org.apache.catalina.core.Contai在java.util.concurrent.ThreadPoolExecutor的java.util.concurrent.FutureTask.run(未知来源)java.util.concurrent.FutureTask $ Sync.innerRun(未知来源)的nerBase $ StartChild.call(ContainerBase.java:1549) .runWorker(未知来源)java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)java.lang.Thread.run(未知来源)
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
2012年10月19日上午11:34:45 org.apache.catalina.core.StandardContext listenerStart SEVERE:由于之前的错误而跳过安装的应用程序监听器2012年10月19日上午11:34:45 org.apache.catalina.core .StandardContext startInternal SEVERE:错误listenerStart 2012年10月19日上午11:34:45 org.apache.catalina.core.StandardContext startInternal SEVERE:由于之前的错误,上下文[/ GBCPlacesCRUD]启动失败2012年10月19日上午11:34:45 org.apache.coyote.AbstractProtocol start INFO:启动ProtocolHandler [“http-bio-8080”] 2012年10月19日上午11:34:45 org.apache.coyote.AbstractProtocol start INFO:启动ProtocolHandler [“ajp-bio-8009 “] 2012年10月19日上午11:34:45 org.apache.catalina.startup.Catalina启动信息:服务器启动时间为1096毫秒
1 个解决方案
#1
0
Adding javax.faces-2.1.13.jar to the project fixed the issue.
将javax.faces-2.1.13.jar添加到项目中修复了该问题。
http://javaserverfaces.java.net/
#1
0
Adding javax.faces-2.1.13.jar to the project fixed the issue.
将javax.faces-2.1.13.jar添加到项目中修复了该问题。
http://javaserverfaces.java.net/