抛[activiti.cfg.xml] cannot be opened because it does not exist错误

这个[activiti.cfg.xml] cannot be opened because it does not exist错误信息是告诉我们,该项目缺少activiti.cfg.xml配置文件,activiti默认情况下会在classpath路径下面去寻找名为activiti.cfg.xml的配置文件,如果没有找到,则抛出该异常信息。

这个[activiti.cfg.xml] cannot be opened because it does not exist错误信息是告诉我们,该项目缺少activiti.cfg.xml配置文件,activiti默认情况下会在classpath路径下面去寻找名为activiti.cfg.xml的配置文件,如果没有找到,则抛出该异常信息。

问题信息:

2015-1-31 21:21:30 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [activiti.cfg.xml]

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activiti.cfg.xml]; nested exception is java.io.FileNotFoundException: class path resource [activiti.cfg.xml] cannot be opened because it does not exist

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)

at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfiguration(BeansConfigurationHelper.java:35)

at org.activiti.engine.impl.cfg.BeansConfigurationHelper.parseProcessEngineConfigurationFromResource(BeansConfigurationHelper.java:48)

at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(ProcessEngineConfiguration.java:185)

at org.activiti.engine.ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault(ProcessEngineConfiguration.java:177)

at com.bug315.ActivitiTest01.main(ActivitiTest01.java:10)

Caused by: java.io.FileNotFoundException: class path resource [activiti.cfg.xml] cannot be opened because it does not exist

at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:141)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)

... 6 more

解决办法:

在classpath目录下面缺少activiti.cfg.xml配置文件。创建activiti.cfg.xml配置文件。

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://www.springframework.org/schema/beans"
	xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="https://www.springframework.org/schema/beans
		https://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
	<bean id="processEngineConfiguration"  
            class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
        <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti" />
        <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
        <property name="jdbcUsername" value="root" />
        <property name="jdbcPassword" value="aaaaaa" />
        <property name="jobExecutorActivate" value="true" />
        <property name="databaseSchemaUpdate" value="true" />
    </bean> 
</beans>
我们一定要给自己提出这样的任务:第一,学习,第二是学习,第三还是学习。 —— 列宁
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站专注于 Java、数据库(MySQL、Oracle)、Linux、软件架构及大数据等多领域技术知识分享。涵盖丰富的原创与精选技术文章,助力技术传播与交流。无论是技术新手渴望入门,还是资深开发者寻求进阶,这里都能为您提供深度见解与实用经验,让复杂编码变得轻松易懂,携手共赴技术提升新高度。如有侵权,请来信告知:hxstrive@outlook.com
公众号