JPA preventing load of Togglz in Spring Boot app

79 views
Skip to first unread message

Rich Ackroyd

unread,
Apr 10, 2020, 2:30:14 PM4/10/20
to togglz-users
Hi Folks,

I added JPA to my app and Togglz now errors when I start the app with:

'Error creating bean with name 'demoResource': Injection of autowired dependencies failed; nested exception is java.lang.IllegalStateException: Could not find the FeatureManager. For web applications please verify that the TogglzFilter starts up correctly. In other deployment scenarios you will typically have to implement a FeatureManagerProvider as described in the 'Advanced Configuration' chapter of the documentation.'

Seems to be some clash as Togglz config beans are not getting created before the feature manager triggers and the cache ends up with no classes, hence the null issue above - where before JPA all was good.

POM dependencies are below - anyone solved this or similar?

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.13.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.togglz</groupId>
<artifactId>togglz-spring-boot-starter</artifactId>
<version>2.5.0.Final</version>
</dependency>

I also tried Togglz 2.6.1.Final and Spring Boot 2.1.8.RELEASE.

Cheers,
Rich


Diego Viana Colorado

unread,
Mar 7, 2024, 6:03:10 PM3/7/24
to togglz-users
Hi,

I have the same issue, all worked well before adding the JPA dependency. Now I'm getting "Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: Could not find the FeatureManager. For web applications please verify that the TogglzFilter starts up correctly. In other deployment scenarios you will typically have to implement a FeatureManagerProvider as described in the 'Advanced Configuration' chapter of the documentation." and works well again if I removed JPA from build.gradle file.

I'm using org.togglz:togglz-spring-boot-starter:3.2.1 and JPA 2.7.12

Thanks in advance if someone could give me guidance about this issue.

Diego Viana Colorado

unread,
Mar 7, 2024, 6:40:40 PM3/7/24
to togglz-users
I'm trying to use FeatureProxyFactoryBean, but spring boot is not able to create the following bean:
@Bean
@Primary
public MyService someService(@Autowired FeatureProxyFactoryBean proxiedSomeService) throws Exception {
return (MyService) proxiedSomeService.getObject();
}

Reply all
Reply to author
Forward
0 new messages