Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BeanPostProcessorChecker] WARN o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker #1236

Open
1 task done
welloncn opened this issue Dec 19, 2023 · 31 comments · May be fixed by #1266
Open
1 task done
Labels
help-wanted Help Wanted shiro-2.0.0 spring Spring and SpringBoot
Milestone

Comments

@welloncn
Copy link

welloncn commented Dec 19, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Question

2023-12-19 10:40:12,218 [main] INFO  com.bibleofprogrammer.authentication.AuthenticationApplication - [ -  - ] - No active profile set, falling back to 1 default profile: "default"
2023-12-19 10:40:14,261 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - [ -  - ] - Multiple Spring Data modules found, entering strict repository configuration mode
2023-12-19 10:40:14,265 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - [ -  - ] - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-12-19 10:40:14,358 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - [ -  - ] - Finished Spring Data repository scanning in 73 ms. Found 0 Redis repository interfaces.
2023-12-19 10:40:14,774 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration' of type [org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,778 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'eventBus' of type [org.apache.shiro.event.support.DefaultEventBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,815 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'authenticationAutoConfiguration' of type [com.bibleofprogrammer.authentication.shiro.AuthenticationAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,847 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'userRealm' of type [com.bibleofprogrammer.authentication.shiro.UserRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,850 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'statelessRealm' of type [com.bibleofprogrammer.authentication.shiro.stateless.StatelessRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,912 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'subjectDAO' of type [com.bibleofprogrammer.authentication.shiro.stateless.StatelessSubjectDaoImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,914 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'subjectFactory' of type [com.bibleofprogrammer.authentication.shiro.stateless.StatelessSubjectFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,917 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'rememberMeCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,919 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'rememberMeManager' of type [org.apache.shiro.web.mgt.CookieRememberMeManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,921 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'authenticationStrategy' of type [com.bibleofprogrammer.authentication.shiro.stateless.StatelessAtLeastOneSuccessfulStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,921 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'authenticator' of type [org.apache.shiro.authc.pam.ModularRealmAuthenticator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,922 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'authorizer' of type [org.apache.shiro.authz.ModularRealmAuthorizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,923 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'sessionCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,924 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'sessionFactory' of type [org.apache.shiro.session.mgt.SimpleSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,924 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'sessionDAO' of type [org.apache.shiro.session.mgt.eis.MemorySessionDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,926 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'sessionManager' of type [org.apache.shiro.web.session.mgt.DefaultWebSessionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,928 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,956 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'shiroPathDefinitionConfig' of type [com.bibleofprogrammer.authentication.config.ShiroPathDefinitionConfig$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:14,959 [main] WARN  o.s.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - [ -  - ] - Bean 'shiroFilterChainDefinition' of type [org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [persistenceExceptionTranslationPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19 10:40:15,429 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - [ -  - ] - Tomcat initialized with port 9999 (http)
2023-12-19 10:40:15,439 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - [ -  - ] - Initializing ProtocolHandler ["http-nio-9999"]

my pom:


4.0.0

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.0</version>
    <relativePath/>
</parent>

<groupId>com.bibleofprogrammer</groupId>
<artifactId>pilot</artifactId>
<version>1.0.0</version>
<name>pilot</name>
<description>pilot 管理</description>

<properties>
    <java.version>17</java.version>
    <shiro.version>2.0.0-alpha-4</shiro.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-autoconfigure</artifactId>
    </dependency>

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

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>31.0.1-jre</version>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.83</version>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-starter</artifactId>
        <version>1.2.8</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.33</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-spring-boot-web-starter</artifactId>
        <classifier>jakarta</classifier>
        <version>${shiro.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-spring-boot-starter</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-spring-boot-starter</artifactId>
        <classifier>jakarta</classifier>
        <version>${shiro.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-spring</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-spring</artifactId>
        <classifier>jakarta</classifier>
        <version>${shiro.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-web</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-core</artifactId>
        <classifier>jakarta</classifier>
        <version>${shiro.version}</version>
        <exclusions>
            <exclusion>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.4</version>
    </dependency>

    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-web</artifactId>
        <classifier>jakarta</classifier>
        <version>${shiro.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>

    <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt</artifactId>
        <version>0.12.3</version>
    </dependency>

    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.5.4.1</version>
        <exclusions>
            <exclusion>
                <artifactId>mybatis-spring</artifactId>
                <groupId>org.mybatis</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>3.0.3</version>
    </dependency>

    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>2.0.1.Final</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
@lprimak
Copy link
Contributor

lprimak commented Dec 19, 2023

Hi,

Can you please follow what's in https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web sample?
I believe you have too many exclusions and missing dependencyManagement section

@welloncn
Copy link
Author

welloncn commented Dec 19, 2023

Hi,

Can you please follow what's in https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web sample? I believe you have too many exclusions and missing dependencyManagement section

run the sample/spring-boot-3-web,Warning still exists

chang to spring boot 3.2.0

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v3.2.0)

2023-12-19T13:42:29.694+08:00 INFO 14357 --- [ main] org.apache.shiro.samples.WebApp : No active profile set, falling back to 1 default profile: "default"
2023-12-19T13:42:30.651+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration' of type [org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [lifecycleBeanPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.
2023-12-19T13:42:30.659+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration' of type [org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [defaultAdvisorAutoProxyCreator] is declared through a non-static factory method on that class; consider declaring it as static instead.
2023-12-19T13:42:30.677+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'eventBus' of type [org.apache.shiro.event.support.DefaultEventBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.759+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration' of type [org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.761+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'webApp' of type [org.apache.shiro.samples.WebApp$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.782+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'realm' of type [org.apache.shiro.realm.text.TextConfigurationRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.821+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionStorageEvaluator' of type [org.apache.shiro.web.mgt.DefaultWebSessionStorageEvaluator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.822+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'subjectDAO' of type [org.apache.shiro.mgt.DefaultSubjectDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.822+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'subjectFactory' of type [org.apache.shiro.web.mgt.DefaultWebSubjectFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.824+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'rememberMeCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.825+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'rememberMeManager' of type [org.apache.shiro.web.mgt.CookieRememberMeManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.826+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authenticationStrategy' of type [org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.827+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authenticator' of type [org.apache.shiro.authc.pam.ModularRealmAuthenticator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.828+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authorizer' of type [org.apache.shiro.authz.ModularRealmAuthorizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.829+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.830+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionFactory' of type [org.apache.shiro.session.mgt.SimpleSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.830+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionDAO' of type [org.apache.shiro.session.mgt.eis.MemorySessionDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.832+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [org.apache.shiro.web.session.mgt.DefaultWebSessionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.834+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.841+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'authorizationAttributeSourceAdvisor' of type [org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [shiroEventBusAwareBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.846+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroFilterChainDefinition' of type [org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.851+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'requestContextFilter' of type [org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.859+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration' of type [org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.862+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'formContentFilter' of type [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.896+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'server-org.springframework.boot.autoconfigure.web.ServerProperties' of type [org.springframework.boot.autoconfigure.web.ServerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.899+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration' of type [org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.901+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'characterEncodingFilter' of type [org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.908+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration' of type [org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:30.916+08:00 WARN 14357 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'globalFilters' of type [java.util.Collections$SingletonList] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor []? Check the corresponding BeanPostProcessor declaration and its dependencies.
2023-12-19T13:42:31.225+08:00 INFO 14357 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http)
2023-12-19T13:42:31.238+08:00 INFO 14357 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-12-19T13:42:31.239+08:00 INFO 14357 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.16]
2023-12-19T13:42:31.347+08:00 INFO 14357 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-12-19T13:42:31.349+08:00 INFO 14357 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1567 ms
2023-12-19T13:42:31.972+08:00 INFO 14357 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path ''
2023-12-19T13:42:31.980+08:00 INFO 14357 --- [ main] org.apache.shiro.samples.WebApp : Started WebApp in 2.876 seconds (process running for 3.683)

the pom is:
pom.txt

@welloncn
Copy link
Author

welloncn commented Dec 19, 2023

use spring boot 3.1.5 also show the message info:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.1.5)

2023-12-19T19:28:17.942+08:00  INFO 50225 --- [           main] org.apache.shiro.samples.WebApp          : No active profile set, falling back to 1 default profile: "default"
2023-12-19T19:28:18.859+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration' of type [org.apache.shiro.spring.boot.autoconfigure.ShiroBeanAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:18.865+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration' of type [org.apache.shiro.spring.boot.autoconfigure.ShiroAnnotationProcessorAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:18.881+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'eventBus' of type [org.apache.shiro.event.support.DefaultEventBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:18.949+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration' of type [org.apache.shiro.spring.config.web.autoconfigure.ShiroWebAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:18.952+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'webApp' of type [org.apache.shiro.samples.WebApp$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:18.973+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'realm' of type [org.apache.shiro.realm.text.TextConfigurationRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.048+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionStorageEvaluator' of type [org.apache.shiro.web.mgt.DefaultWebSessionStorageEvaluator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.049+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'subjectDAO' of type [org.apache.shiro.mgt.DefaultSubjectDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.050+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'subjectFactory' of type [org.apache.shiro.web.mgt.DefaultWebSubjectFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.051+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'rememberMeCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.053+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'rememberMeManager' of type [org.apache.shiro.web.mgt.CookieRememberMeManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.054+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'authenticationStrategy' of type [org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.055+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'authenticator' of type [org.apache.shiro.authc.pam.ModularRealmAuthenticator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.056+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'authorizer' of type [org.apache.shiro.authz.ModularRealmAuthorizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.057+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionCookieTemplate' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.058+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionFactory' of type [org.apache.shiro.session.mgt.SimpleSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.058+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionDAO' of type [org.apache.shiro.session.mgt.eis.MemorySessionDAO] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.060+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [org.apache.shiro.web.session.mgt.DefaultWebSessionManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.061+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.069+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'authorizationAttributeSourceAdvisor' of type [org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.075+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroFilterChainDefinition' of type [org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.080+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'requestContextFilter' of type [org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.090+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration' of type [org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.093+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'formContentFilter' of type [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.127+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'server-org.springframework.boot.autoconfigure.web.ServerProperties' of type [org.springframework.boot.autoconfigure.web.ServerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.130+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration' of type [org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.132+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'characterEncodingFilter' of type [org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.139+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration' of type [org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.148+08:00  INFO 50225 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'globalFilters' of type [java.util.Collections$SingletonList] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-12-19T19:28:19.450+08:00  INFO 50225 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-12-19T19:28:19.463+08:00  INFO 50225 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-12-19T19:28:19.464+08:00  INFO 50225 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.15]
2023-12-19T19:28:19.594+08:00  INFO 50225 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-12-19T19:28:19.596+08:00  INFO 50225 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1568 ms
2023-12-19T19:28:20.132+08:00  INFO 50225 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2023-12-19T19:28:20.141+08:00  INFO 50225 --- [           main] org.apache.shiro.samples.WebApp          : Started WebApp in 2.625 seconds (process running for 8.433)

@lprimak lprimak added shiro-2.0.0 spring Spring and SpringBoot help-wanted Help Wanted and removed question labels Dec 19, 2023
@lprimak
Copy link
Contributor

lprimak commented Dec 19, 2023

Thank you for your detailed explanation. There is something indeed new in how SpringBoot 3 initializes beans.
However, I am not a Spring expert, or even Spring user. Do you have any ideas on how to fix this?
We are open to ideas from people who know SpringBoot better :)

Thank you!

@lprimak
Copy link
Contributor

lprimak commented Dec 20, 2023

Found some prior discussions about this https://issues.apache.org/jira/browse/SHIRO-743 and spring-projects/spring-boot#16097

Looks like this is a long-standing issue, if any Spring experts want to take it on... please do!

@welloncn
Copy link
Author

Thank you for your reply, shiro hava a Improvement, have plan to fix?
SHIRO-434
image

@lprimak
Copy link
Contributor

lprimak commented Dec 20, 2023

No plan, we need help with this from the community.

@welloncn
Copy link
Author

No plan, we need help with this from the community.

ok, thanks

@lprimak
Copy link
Contributor

lprimak commented Dec 22, 2023

Reopened since this is a real issue

@lprimak lprimak reopened this Dec 22, 2023
@lprimak
Copy link
Contributor

lprimak commented Dec 22, 2023

@joshlong Would you know of someone who can help Shiro with this issue?

@rasa-app
Copy link

rasa-app commented Jan 6, 2024

I'm not sure what @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
annotation does but when you add it to the class and bean level all warnings gone.

Capture

@rasa-app
Copy link

rasa-app commented Jan 6, 2024

It's based on this issue:
spring-projects/spring-security#8407

@lprimak lprimak linked a pull request Jan 6, 2024 that will close this issue
10 tasks
@lprimak
Copy link
Contributor

lprimak commented Jan 6, 2024

Thanks @rasa-app

I have tried to create a PR, but still I cannot get rid of the warnings unfortunately.

@github-actions github-actions bot added the Stale label Apr 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
@lprimak lprimak removed the Stale label Apr 14, 2024
@lprimak
Copy link
Contributor

lprimak commented Apr 14, 2024

Not stale

@lprimak lprimak reopened this Apr 14, 2024
@SilenceLurker
Copy link

I recently attempted to integrate Shiro in Spring-Boot 3.2.5 and it seemed to run normally at the time so I didn't pay much attention, but I noticed these warnings too. If you want to reproduce it, you might check out the demo I originally wrote:https://github.com/SilenceLurker/shiro-test
I believe having a demo might make it easier to identify and fix the problem.

@lprimak
Copy link
Contributor

lprimak commented May 15, 2024

Shiro team needs help on this. None of us are Spring experts that can deduce what's going on here.

@SilenceLurker
Copy link

I will spend some time trying to resolve this, but I cannot guarantee a solution. These warnings don't seem to have caused any project failures or functional abnormalities during my testing, so I think many others might have this issue but don't pay much attention to it. That demo might provide some ideas or something else to others, so let's just leave it there.

@lprimak
Copy link
Contributor

lprimak commented May 15, 2024

Thank you! We appreciate any help we get here.
The issue is that the warnings will turn into errors sometime in the future, I will bet on that :)

@lprimak
Copy link
Contributor

lprimak commented May 15, 2024

@SilenceLurker Shiro no longer uses JIRA for issue tracking so you don’t need to create the JIRA account

@SilenceLurker
Copy link

Got it, and, based on my recent attempts, I suspect that the issue might be related to Spring-Boot3 using the Spring6 framework, whereas Spring-Boot2 uses the Spring5 framework. It seems that the RMI functionality has been removed (I noticed that the content is relatively simple and could potentially be manually added back in to temporarily resolve this issue). Additionally, the compatibility of Spring-Boot3 with Spring-Boot2 doesn't seem to be ideal, especially for parts that rely on the Spring5 framework. My current approach is to create a version of Shiro for Spring-Boot3 and replace the internal javax dependencies with jakarta dependencies (Spring-Boot2 uses javax, while in Spring-Boot3, it has been changed to Jakarta). This might solve the issue. I'm still trying and not sure if it will work, but adding a version specifically for Spring-Boot3 would be more user-friendly for those developing with Spring-Boot3 (so they don't have to manually exclude javax dependencies one by one). I believe that creating an additional version to support Spring-Boot3 is simpler than trying to make the existing shiro-spring-boot support both Spring-Boot2 and 3.(Translated by GPT4o)

@lprimak
Copy link
Contributor

lprimak commented May 21, 2024

Shiro uses maven-shade-plugin to produce artifacts with jakarta classifier that solve compatibility with Spring 6.
See https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web for an example.
The warnings specified in this issue has nothing to do with Boot 2 vs 3 or Framework 5 vs. 6 compatibility as that problem is already solved there.

@SilenceLurker
Copy link

It seems that I initially found a tutorial that wasn't very good, which involved manually removing javax related dependencies one by one when importing dependencies. I will look further to find the source of the issue.(Translated by GPT4o)

@lprimak
Copy link
Contributor

lprimak commented May 22, 2024

Thank you. See https://shiro.apache.org/jakarta-ee.html especially the BOM section. That automatically removes javax dependencies

@lprimak lprimak added this to the Backlog milestone May 22, 2024
@SilenceLurker
Copy link

I am not sure if this is the issue, but I noticed that ShiroFilterFactoryBean implements both FactoryBean and BeanPostProcessor interfaces. This could be the cause. However, I have not tried separating them into two classes, each implementing one of the interfaces. In terms of the Spring lifecycle, the order seems to be FactoryBean -> Bean -> BeanPostProcessor. Implementing both might cause issues. The FactoryBean documentation suggests that the implementation class should not be used as a normal bean ("NB: A bean that implements this interface cannot be used as a normal bean. A FactoryBean is defined in a bean style, but the object exposed for bean references (getObject()) is always the object that it creates."). This suggests that users should not manually create beans for its implementing class.

While debugging in the Spring-Boot 2 environment, I noticed similar issues in the call stack, but Spring-Boot 2 seems less strict in its checks compared to Spring-Boot 3, hence no warnings. However, customizing a ShiroFilterFactoryBean or AuthorizationAttributeSourceAdvisor may still trigger these warnings in Spring-Boot 2 (with the former being more severe).(Translated by GPT4o)

@lprimak
Copy link
Contributor

lprimak commented May 23, 2024

Maybe... can you see if separating it has any effect?
Thank you!

@SilenceLurker
Copy link

I have already started trying to do this, but it seems to be more complex than I initially thought. I might need two to three days, or even longer, to handle it to ensure compatibility with the existing content as much as possible.(Translated by GPT4o)

@SilenceLurker
Copy link

I haven't successfully completely separated them yet. I'm stuck on some tests, but I wrote another example to try it out and confirmed that the issue is indeed caused by simultaneously implementing both the FactoryBean and BeanPostProcessor interfaces and registering them as Beans in the Configuration(Try running this minimal reproduction project, and you will see similar warnings, just in a smaller number: https://github.com/SilenceLurker/BeanWarningExample). I believe the simplest solution to resolve these warnings is to split the original ShiroFilterFactoryBean class. I will try to separate them simply for a while longer, but if it takes too long, I will consider redesigning this part based on the original functionality.(Translated by GPT4o)

@SilenceLurker
Copy link

Good news and bad news: The good news is that by separating the implementation of ShiroFilterFactoryBean for FactoryBean and BeanPostProcessor, and injecting a shared instance of an additional entity class into both, we can eliminate these warnings without changing the original functionality. This approach requires resetting the test cases by configuring the original Map into the newly created entity class for storing corresponding information and injecting this entity into the FactoryBean (ShiroFilterFactoryBean) and the BeanPostProcessor implementations. This issue took me a considerable amount of time to resolve. However, the downside is that when users configure ShiroFilterFactoryBean, the Bean created in the Configuration will no longer be ShiroFilterFactoryBean but the newly created entity class (which will be automatically injected into the FactoryBean and BeanPostProcessor implementations via @Autowired). In my tests, this setup appears to function correctly without generating warnings (though I haven't conducted exhaustive testing because I am busy with my graduation project). Unfortunately, if users try to create a Bean of AuthorizationAttributeSourceAdvisor in the Configuration class, warnings still appear. I haven't found the cause of this issue yet. Does anyone have any ideas?(Translated by GPT4o)

@SilenceLurker
Copy link

It seems that the implementation class of BeanPostProcessor should not be instantiated as a bean in a Configuration class. If the BeanPostProcessor is annotated with Component and handled automatically by Spring Boot, the corresponding warnings tend not to appear. However, in a simple Spring Boot project containing only one Configuration class with a single BeanPostProcessor bean, similar warnings can still emerge, although they are relatively few in an empty project. Whether a similar issue exists in AuthorizationAttributeSourceAdvisor has not yet been explored.(Translated by GPT4)

@SilenceLurker
Copy link

Based on the content above, it may not be necessary to separate the original implementations. Instead, simply modifying them to be managed via the Component annotation might suffice. However, additional adjustments might be needed in the AutoConfigure settings to ensure these components are properly scanned and injected. Likely, an additional class will be required to store the relevant filter information. This way, users only need to use a Configuration class to configure and inject a new information class bean into ShiroFilterFactoryBean, without needing to configure ShiroFilterFactoryBean itself as a bean.(Translated by GPT4)

@github-actions github-actions bot added the Stale label Sep 5, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
@lprimak lprimak reopened this Sep 12, 2024
@github-actions github-actions bot removed the Stale label Sep 13, 2024
@Ai-010
Copy link

Ai-010 commented Oct 22, 2024

At present, the dependency has not been resolved, and I have also encountered this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted Help Wanted shiro-2.0.0 spring Spring and SpringBoot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants