Error on upgrade to 2.3

After upgrading to 2.3, i am getting error preventing application to run in ‘FlowuiSecurityConfiguration’ used to show pdf in iframe. (that it is marked for removal

Error is -

`

2024-06-30T11:19:12.178+05:30 WARN 14920 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration’: Unsatisfied dependency expressed through field ‘httpSecurity’: Error creating bean with name ‘org.springframework.security.config.annotation.web.configuration.HttpSecurityConfiguration.httpSecurity’ defined in org.springframework.security.config.annotation.web.configuration.HttpSecurityConfiguration: Failed to instantiate [org.springframework.security.config.annotation.web.builders.HttpSecurity]: Factory method ‘httpSecurity’ threw exception with message: Error creating bean with name ‘com.sheel.knowledgebase.KnowledgebaseApplication$DefaultFlowuiSecurityConfiguration’: Unsatisfied dependency expressed through method ‘setViewAccessChecker’ parameter 0: No qualifying bean of type ‘io.jmix.securityflowui.access.UiViewAccessChecker’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

`

Application runs if i remove this code -

 @EnableWebSecurity
    public static class DefaultFlowuiSecurityConfiguration extends FlowuiSecurityConfiguration {

        @Override
        protected void configure(HttpSecurity http) throws Exception {
            super.configure(http);
            http.headers(headers ->
                    headers.contentSecurityPolicy(secPolicy ->
                     
                            secPolicy.policyDirectives("frame-ancestors http://gggggg.ggggg.net/")
                    )
            );
        }
    }

Problem solved by replacing it with FlowuiVaadinWebSecurity.
Is it ok.

1 Like

Hi,

Thank you for reporting the problem. We will mention this in the Breaking changes section in Jmix documentation.