Tomcat / Hibernate问题“SEVERE:Error listenerStart”

时间:2010-06-17 16:40:46

标签: hibernate tomcat servlets servlet-filters

我下载了hibernate的工作示例(使用maven)并将其安装在我的tomcat上,它工作正常。然后我在MyEclipse中创建了一个新的Web项目,添加了hibernate支持和 将所有源文件(无jar)移动到这个新项目,并在必要时修改了包/路径。我的servlet响应正确但是当我在web.xml中添加“Listener”时, tomcat在启动时返回错误“Error ListenerStart”,我的应用程序无法启动 我仔细检查了所有的包,路径和类,它们看起来很好。除了这两个单词之外,错误消息也没有说明任何其他内容 这是完整的tomcat启动日志:

17-Jun-2010 12:13:37 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8810
17-Jun-2010 12:13:37 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 293 ms
17-Jun-2010 12:13:37 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
17-Jun-2010 12:13:37 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
17-Jun-2010 12:13:37 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
17-Jun-2010 12:13:37 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/addressbook] startup failed due to previous errors
17-Jun-2010 12:13:37 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8810
17-Jun-2010 12:13:37 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
17-Jun-2010 12:13:37 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/22  config=null
17-Jun-2010 12:13:37 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 446 ms

我的web.xml是:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <listener>
        <listener-class>addressbook.util.SessionFactoryInitializer</listener-class>
    </listener>

    <filter>
        <filter-name>Session Interceptor</filter-name>
        <filter-class>addressbook.util.SessionInterceptor</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>Session Interceptor</filter-name>
        <servlet-name>Country Manager</servlet-name>
    </filter-mapping>

    <servlet>
        <servlet-name>Country Manager</servlet-name>
        <servlet-class>addressbook.managers.CountryManagerServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Country Manager</servlet-name>
        <url-pattern>/countrymanager</url-pattern>
    </servlet-mapping>

</web-app>

有人可以帮助我弄清楚我做错了什么吗?或指向一些资源,我可以得到一些精确的问题解决方案?

1 个答案:

答案 0 :(得分:2)

web.xml中的过滤器和servlet序列错误。我在过滤之前移动了servlet并解决了问题