zoukankan      html  css  js  c++  java
  • startup failed due to previous errors

    IDEA搭建SSM项目服务器报:startup failed due to previous errors

    第一次遇到这种问题,Tomcat打印出的信息极少,网上搜索了下,在WEB-INF目录下添加classes目录,在classes目录创建logging.properties,如下

    logging.properties内容:

    handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  
    
    ############################################################
    # Handler specific properties.
    # Describes specific configuration info for Handlers.
    ############################################################
    
    org.apache.juli.FileHandler.level = FINE  
    org.apache.juli.FileHandler.directory = ${catalina.base}/logs  
    org.apache.juli.FileHandler.prefix = error-debug.  
    
    java.util.logging.ConsoleHandler.level = FINE  
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 

    得到了报错信息:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    执行后,在WEB-INF在增加了lib目录,里面是项目引用的jar包,点击OK。

    实际在Idea中这样配置:

    File > Project Structure > Artifacts > 在右侧Output Layout右击项目名,选择Put into Output Root,见下面截图:

    重启Tomcat,java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener这个错误不报了。

    但是,又报了一个错误:

    Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file[D:code
    ewstartoutartifacts
    ewstart_war_explodedWEB-INFclassesspringapplicationContext-mybatis.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/context/event/EventListenerFactory

    Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/EventListenerFactory

    查看spring-context-3.2.4.RELEASE.jar  org/springframework/context/event/* 并不存在EventListenerFactory

    spring-context-3.2.4.RELEASE.jar 换成spring-context-4.3.9.RELEASE.jar

    问题解决

  • 相关阅读:
    JS文本框下拉提示效果
    JS动态添加删除表格行
    JS验证 数字 电话号码 传真 邮箱 手机号码 邮编 日期
    TreeView 中CheckBox级联选中问题
    HashTable Dictionary
    JS操作Frame对象
    Winfrom 中怎样在回车时设置焦点
    Word 操作(未完待续)
    HTML5特性——prefetching预加载功能
    10个实用的 jQuery Mobile 插件推荐
  • 原文地址:https://www.cnblogs.com/againn/p/7441622.html
Copyright © 2011-2022 走看看