zoukankan      html  css  js  c++  java
  • Spring部署报错:Could not open ServletContext resource [/jdbc.properties]

     1 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
     2 org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc:properties]
     3     at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:87)
     4     at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
     5     at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:656)
     6     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
     7     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
     8     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
     9     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    10     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
    11     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5162)
    12     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    13     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    14     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    15     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    16     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1069)
    17     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1719)
    18     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    19     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    20     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    21     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    22     at java.lang.Thread.run(Thread.java:745)
    23 Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc:properties]
    24     at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:140)
    25     at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181)
    26     at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
    27     at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
    28     ... 19 more
    复制代码

    解决方法:

    1
    2
    3
    在spring配置中加载文件的配置修改为
        <context:property-placeholder location="classpath:jdbc.properties">
    </context:property-placeholder>
  • 相关阅读:
    I firmly believe
    深度学习常见的专业术语
    阿里、网易和腾讯面试题 C/C++
    Winfrom中关于toolStrip工具栏中按钮背景的设置
    非常完善的Log4net详细说明
    C#中 Var关键字
    C#中Dynamic关键字
    Python中threading的join和setDaemon的区别[带例子]
    pycharm常用快捷键
    ABP发布到iis
  • 原文地址:https://www.cnblogs.com/Lawsky/p/6515760.html
Copyright © 2011-2022 走看看