我正在学习将activiti与spring boot结合使用,但我遇到了一些错误,并且搜索了太多关于使用spring boot和java的acitiviti稳定版本的信息
我正在使用java 8和tomcat 8.0.3
我更改了这么多版本的spring和jdk,检查了这么多样本,没有发现任何问题,我只有一个控制器类和spring主类,当我运行项目时,得到了以下错误:
Error creating bean with name 'runtimeServiceBean' defined in class path resource [org/activiti/spring/boot/JpaProcessEngineAutoConfiguration$JpaConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.activiti.engine.ProcessEngine]: : Error creating bean with name 'processEngine'defined in class path resource [org/activiti/spring/boot/JpaProcessEngineAutoConfiguration$JpaConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.activiti.spring.SpringProcessEngineConfiguration]
这是我的RestController,除了自动连线什么也不做
import org.activiti.engine.RuntimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MyRestController {
@Autowired
private RuntimeService runtimeService;
}
这是我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<activiti.version>5.19.0.2</activiti.version>
</properties>
<dependencies>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-basic</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-rest-api</artifactId>
<!--<artifactId>spring-boot-starter-rest-api</artifactId>-->
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter-jpa</artifactId>
<version>${activiti.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
带Spring靴2。你必须添加上面的依赖项,然后删除另一个`
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<version>7.0.0.SR1</version>
</dependency>`
经过多次搜索,我意识到spring boot 2与activiti存在问题,然后我将spring boot更改为1.5版,然后出现新错误:
'formDataResource': Unsatisfied dependency expressed through field 'formService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'formServiceBean' defined in class path resource [org/activiti/spring/boot/JpaProcessEngineAutoConfiguration$JpaConfiguration.class]: Unsatisfied dependency expressed through method 'formServiceBean' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'processEngine' defined in class path resource [org/activiti/spring/boot/JpaProcessEngineAutoConfiguration$JpaConfiguration.class]: Unsatisfied dependency expressed through method 'processEngine' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springProcessEngineConfiguration' defined in class path resource [org/activiti/spring/boot/JpaProcessEngineAutoConfiguration$JpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.spring.SpringProcessEngineConfiguration]
新错误的原因是:我在src/main/resources/processs中没有任何进程/
设置一些进程并删除目标文件夹
这对我有用!
如果你想在Spring Boot 2中使用Activiti。x我们建议使用Activiti Core 7的新版本,可在以下位置找到:https://search.maven.org/artifact/org.activiti/activiti-spring-boot-starter/7.0.0.SR1/jar
你可以在这里找到例子:https://github.com/activiti/activiti-examples
这是我的FileStorageProperties类: 这让我想到:未通过@enableconfigurationproperties注册或标记为spring组件。 这是我的文件存储服务: 这给了我一个错误:无法自动关联未找到类型的bean。 这是我的项目结构: 当我试图运行它时,它给了我: 申请无法启动 描述: com中构造函数的参数0。穆阿。cse616.服务。FileStorageServi
我正在使用java配置而不是XML迁移到spring Security4.0.1。当我自动操作时,它会给出以下错误: HTTP状态500-org.springframework.beans.factory.beanCreationException:创建名为“ScopedTarget.UsersComponent”的bean时出错:注入autowired依赖项失败;嵌套异常为org.springf
当我在spring boot中添加安全配置时,遇到了这个令人讨厌的错误: 这是SpringBootApplication: 最后,这是我的项目树:
这是我的当前设置:ProjectRepo: ProjectService: ProjectRestController:
我的类使用@service,而bean已经自动连线,所以我不明白为什么会出现这个错误。
我从spring-boot开始,我有一些配置问题。我无法自动操作某些服务。我得到一个BeanCreationException。 Hier是我自动执行服务的控制器: 控制台的错误: 当我从compenentscan中删除两个控制器时,我不会出现这个错误,但我需要扫描这些控制器来访问endpoint。