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

标签 java spring maven tomcat tomcat8

我正在尝试在 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 之后,我再也没有遇到过这个问题。与 VERSION 8.0.21 一样的问题

关于java - Tomcat错误信息 : java. lang.ClassNotFoundException : listeners. ContextListener/SessionListener/websocket.drawboard.DrawboardContextListener,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31659129/

相关文章:

java - 检查类型是否为接口(interface)

java - AnnotationAwareAspectJAutoProxyCreator 仅适用于 Java 1.5 及更高版本

maven - 无法在 maven-pmd-plugin 5.0.2 中使用自定义规则集

node.js - 如何将 nodejs 和 npm 可执行文件上传到 artifactory

maven-2 - 在 Github 中托管我的 jars,并依赖于 Maven 存储库

java - android 文件下载在pie版本中不起作用

java - 在不使用表单数据的情况下在 Spring 中上传文件

java.lang.ClassFormatError : Invalid method Code length 75567 in class file

Spring Security (3.2.5) HTTP POST 认证后不转发到原始请求

java - 保存从 Spring Cloud Config Server 下载的属性