SSS
SSS

Reputation: 303

Integrate Activiti to JHipster Project

I am trying to integrate Activiti to the JHipster Project following the instruction here : getting started with activiti and spring boot.

a few exception I am facing:

  1. conflict in 'userResource' class:

    Annotation-specified bean name 'userResource' for bean class [org.activiti.rest.service.api.identity.UserResource] conflicts with existing, non-compatible bean definition of same name and class [com.activiti.demo3.web.rest.UserResource]

For now I have renamed the userResource class that comes from jhipster, but I am not able to figure out the exception below.

  1. @Order on WebSecurityConfigurers must be unique:

Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: @Order on WebSecurityConfigurers must be unique. Order of 100 was already used, so it cannot be used on org.activiti.spring.boot.RestApiAutoConfiguration$SecurityConfiguration$$EnhancerBySpringCGLIB$$320e2174@6b277aed too.

Any suggestion or pointers would be really helpful. Thanks in advance.

Upvotes: 3

Views: 1511

Answers (5)

Ognjen Miletic
Ognjen Miletic

Reputation: 51

Hi I had same issue and I resolved it by just renaming Jhipster genarated class at /web/rest/UserResource.java to /web/rest/UserResourceSomethingElse.java

Upvotes: 1

Kumar Abhishek
Kumar Abhishek

Reputation: 3124

Had the same problem, Add @Order(99) on your websecurity class.

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableAutoConfiguration(exclude = {
        org.activiti.spring.boot.RestApiAutoConfiguration.class,
        org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.activiti.spring.boot.SecurityAutoConfiguration.class})
@ComponentScan(basePackages = {"com.onlineBankingApplication"})
@Order(99)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

Upvotes: 0

garfieldy
garfieldy

Reputation: 1

1)

@RestController("JhipsterUserResource")
@RequestMapping("/api")
public class UserResource {

2) JhcommApp.java

import org.activiti.spring.boot.SecurityAutoConfiguration;
@EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class })

It'll prevent Activiti from adding its own IdentityService to Spring Security.

Upvotes: -1

Augustin Ghauratto
Augustin Ghauratto

Reputation: 1520

Make sure you don't have dependencies that may collide. In my case the org.activity:spring-boot-starter-rest-api collide with application. After commenting out:

<dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-spring-boot-starter-rest-api</artifactId>
    <version>${activiti.version}</version>
</dependency>

I managed to build my application.

Upvotes: 0

Ga&#235;l Marziou
Ga&#235;l Marziou

Reputation: 16294

Add @Order(99) to the WebConfigurer class that JHipster generated, 99 or any number < 100.

Upvotes: 2

Related Questions