Tomcat启动时报错:“ Error starting static Resources”问题解决

本文介绍了一种常见的Tomcat启动失败问题及其解决方法。通过清理work目录、调整server.xml配置和移除无用的部署文件,可以有效解决该问题。

对于这个问题,我纠结了好几天,后来才明白是由于什么原因引起的,下面将我的解决办法分享下来。
一般来说出现这种错误是由于你在MyEclipse或Eclipse中删除了某个项目后,没有将Tomcat-6.x\conf\server.xml相关修改完全,才影起了这个问题,那么要怎么解决了?
解决办法:
第一步 清空Tomcat-6.x目录下的work目录;
第二步 再把server.xml的没有用的连接配置都删除或者注释掉;
第三步 最后再将conf目录下的Catalina目录下的localhost内的所有文件都删除。
然后再重新启动tomcat服务器便可以正常工作了,也不会再出现开始的问题了。

都加上之后2025-07-02 10:58:09.442 ERROR 9572 --- [ restartedMain] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'h2Console' defined in class path resource [org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'h2Console' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException: Property spring.datasource.schema with value 'class path resource [schema.sql]' is invalid: The specified resource does not exist. 2025-07-02 10:58:09.458 INFO 9572 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-07-02 10:58:09.458 WARN 9572 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat 2025-07-02 10:58:09.474 INFO 9572 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-07-02 10:58:09.489 ERROR 9572 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Invalid value 'classpath:schema.sql' for configuration property 'spring.datasource.schema' (originating from 'class path resource [application.properties] - 32:26'). Validation failed for the following reason: The specified resource does not exist. Action: Review the value of the property with the provided reason.
最新发布
07-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值