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\newstart\out\artifacts\newstart_war_exploded\WEB-INF\classes\spring\applicationContext-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

 

问题解决

转载于:https://www.cnblogs.com/againn/p/7441622.html

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值