Advertisement

java.lang.IllegalStateException is an instance of IllegalStateException, indicating that the BeanFactory is either not initialized or already closed.

阅读量:

问题解决

在进行一次ssm小规模测试过程中,遇到了相关问题。

出现此类问题的潜在因素可能是配置文件未被正确加载

复制代码
    ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
    
    
      
    

ClassPathXmlApplicationContext的使用必须配合相应的配置文件
配置文件内容:

复制代码
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    <bean id="springDao" class="nuc.ss.demo1.dao

全部评论 (0)

还没有任何评论哟~