tomcat启动出现 One or more listeners failed to start. Full details will be found in the appropriate cont

最近把spring框架也学的差不多了 最近就打算整合下SSH框架之后做一个项目


## bug描述:在写spring代码时 启动tomcat报错 ## bug信息:![在这里插入图片描述](https://img-blog.csdnimg.cn/20191101154020101.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ0MDI4NDY0,size_16,color_FFFFFF,t_70) ## bug解决 : 这个bug有点恶心,恶心到idea的报错信息就一句话 ***One or more listeners failed to start. Full details will be found in the appropriate cont***只是说要你去看那个日志 之后去idea日志文件里面去看 然后发现是空的 都是些老旧的日志 ### (1)找到错误日志 百度之后 发现要是idea下面没有日志记录的话 得去c盘下的.IntelliJIdea2019.2 的system/tomcat目录下的 找到本工程的名字 进入log目录 就可以看到对应的错误日志了 我自己是到localhost.2019-11-01.log中找到错误原因的 错误信息如下
01-Nov-2019 15:30:54.418 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
01-Nov-2019 15:30:54.584 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
01-Nov-2019 15:30:54.996 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
	org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.properties]
		at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:89)

解决问题

原因是在载入properties配置文件路径不对 但因为我是把它放在resource目录下面了的 导致文件无法加载 最后直接将其重构之后放到src目录下才能访问并加载到

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值