当前位置: 代码迷 >> java >> Tomcat错误消息:java.lang.ClassNotFoundException:listeners.ContextListener / SessionListener / websocket.drawboard.DrawboardContextListener
  详细解决方案

Tomcat错误消息:java.lang.ClassNotFoundException:listeners.ContextListener / SessionListener / websocket.drawboard.DrawboardContextListener

热度:37   发布时间:2023-08-02 11:17:23.0

我正在尝试在TOMCAT中部署应用程序,但遇到此异常错误(我的意思是以前从未遇到过)。

27-Jul-2015 12:41:49.870 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class websocket.drawboard.DrawboardContextListener
 java.lang.ClassNotFoundException: websocket.drawboard.DrawboardContextListener

27-Jul-2015 12:41:49.870 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Skipped installing application listeners due to previous error(s)
27-Jul-2015 12:45:35.141 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class listeners.ContextListener
 java.lang.ClassNotFoundException: listeners.ContextListener

27-Jul-2015 12:45:35.146 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class listeners.SessionListener
 java.lang.ClassNotFoundException: listeners.SessionListener

该应用程序基于Spring。 web.xml看起来像这样:

<!--Application Context-->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!--Dispatcher Servlet-->
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

pom.xml文件如下所示:

<!--Spring Dependencies-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-dao</artifactId>
                <version>2.0.8</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jpa</artifactId>
                <version>2.0.8</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>4.1.5.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-jpa</artifactId>
                <version>1.8.0.RELEASE</version>
            </dependency>

            <!--Hibernate Dependencies-->
            <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.1-api</artifactId>
                <version>1.0.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>4.3.10.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.3.10.Final</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons</artifactId>
                <version>1.10.0.RELEASE</version>
                <type>jar</type>
            </dependency>

            <!--JUnit Test Dependency-->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
                <type>jar</type>
            </dependency>

            <!--Log4J-->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>

            <!--MySQL Dependencies-->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.35</version>
            </dependency>

            <!--JSON Conversion Dependency-->
            <dependency>  
                <groupId>org.codehaus.jackson</groupId>  
                <artifactId>jackson-mapper-asl</artifactId>  
                <version>1.9.12</version>  
            </dependency>

            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-web-api</artifactId>
                <version>7.0</version>
                <type>jar</type>
            </dependency>

            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-servlet-api</artifactId>
                <version>8.0.21</version>
                <scope>provided</scope>
            </dependency>

我想知道这里是什么问题。 我以前已经在TOMCAT中部署了该应用程序,但未收到任何错误消息。 我已经看过其他帖子和论坛,但无法解决。

提前致谢!

我不知道问题出在什么地方,但是下载Tomcat VERSION 8.0.24之后,我再也没有遇到问题了。 与版本8.0.21一样的问题

  相关解决方案