Warning:() ‘isEmpty(java.lang.Object)‘ is deprecated . StringUtils.isEmpty

文章讨论了Spring框架中StringUtils.isEmpty方法被废弃的情况,建议使用ObjectUtils.isEmpty替代,以避免可能的隐藏bug。ObjectUtils.isEmpty方法对多种数据类型进行了兼容,提供更安全的空值检查。开发者应该更新代码并进行测试以确保正确性。

使用springframe的 StringUtils 提示 Warning:() 'isEmpty(java.lang.Object)' is deprecated

isEmpty方法废弃了。

参考:

Deprecate `StringUtils.isEmpty(Object)` and replace remaining usage (e.g. with `ObjectUtils.isEmpty`) · Issue #25945 · spring-projects/spring-framework · GitHub

如下:可能会有隐藏bug:

With static imports code like this looks perfectly fine:

        List<String> data = ...

        if (isEmpty(data)) {

But if the import has StringUtils.isEmpty the condition above will not work correctly for empty List introducing a hidden, difficult to spot bug.

If you are really keen on keeping this method it would be better to rename it to isEmptyString to at least make the error more obvious. (I believe this name also matches the method intention better than generic isEmpty.)

But with the #17710 in place I do not think StringUtils.isEmpty(Object) is still needed. And should probably be deprecated and eventually removed.

  如上所示,StringUtils.isEmpty()可能会导致一个隐藏bug。

Replace deprecated StringUtils.isEmpty() by ObjectUtils.isEmpty() and cover its usage with tests jhipster/generator-jhipster#13369

可以使用ObjectUtils.isEmpty(Object) 方法替换StringUtils.isEmpty()就可以。

ObjectUtils.isEmpty 代码如下:兼容了各种场景使用比较方便

    public static boolean isEmpty(@Nullable Object obj) {
        if (obj == null) {
            return true;
        } else if (obj instanceof Optional) {
            return !((Optional)obj).isPresent();
        } else if (obj instanceof CharSequence) {
            return ((CharSequence)obj).length() == 0;
        } else if (obj.getClass().isArray()) {
            return Array.getLength(obj) == 0;
        } else if (obj instanceof Collection) {
            return ((Collection)obj).isEmpty();
        } else {
            return obj instanceof Map ? ((Map)obj).isEmpty() : false;
        }
    }

参考:

Deprecate `StringUtils.isEmpty(Object)` and replace remaining usage (e.g. with `ObjectUtils.isEmpty`) · Issue #25945 · spring-projects/spring-framework · GitHub

. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.18) 2025-06-20 16:28:46.079 INFO 25272 --- [ restartedMain] com.zdww.tpgg.auth.AuthApplication : Starting AuthApplication using Java 1.8.0_361 on Bone with PID 25272 (D:\idea-workplace\hnszxc-service\tpgg-auth\target\classes started by jyouj in D:\idea-workplace\hnszxc-service) 2025-06-20 16:28:46.080 INFO 25272 --- [ restartedMain] com.zdww.tpgg.auth.AuthApplication : The following 1 profile is active: "dev" 2025-06-20 16:28:46.120 INFO 25272 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2025-06-20 16:28:46.121 INFO 25272 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2025-06-20 16:28:47.377 INFO 25272 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode 2025-06-20 16:28:47.379 INFO 25272 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2025-06-20 16:28:47.399 INFO 25272 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 Redis repository interfaces. 2025-06-20 16:28:47.512 WARN 25272 --- [ restartedMain] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.zdww.tpgg.auth]' package. Please check your configuration. 2025-06-20 16:28:47.628 INFO 25272 --- [ restartedMain] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances 2025-06-20 16:28:47.656 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource Config resource 'class path resource [application-dev.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource Config resource 'class path resource [application.yml]' via location 'optional:classpath:/' [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 2025-06-20 16:28:47.657 INFO 25272 --- [ restartedMain] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource devtools [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper 2025-06-20 16:28:47.670 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [com.gsww.jzfp.security.common.shiro.config.ShiroConfig$$EnhancerBySpringCGLIB$$db63f5bd] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:47.686 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'shiroSessionConfiguration' of type [com.gsww.jzfp.security.common.shiro.config.ShiroSessionConfiguration$$EnhancerBySpringCGLIB$$6f9ccbbb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:47.693 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'defaultSessionManager' 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) 2025-06-20 16:28:47.708 INFO 25272 --- [ restartedMain] c.u.j.r.DefaultLazyPropertyResolver : Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver 2025-06-20 16:28:47.709 INFO 25272 --- [ restartedMain] c.u.j.d.DefaultLazyPropertyDetector : Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector 2025-06-20 16:28:47.712 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'jdpSecurityProperties' of type [com.gsww.jzfp.security.common.shiro.config.JdpSecurityProperties$$EnhancerBySpringCGLIB$$d7740153] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:47.729 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'authServerLoginRealm' of type [com.gsww.jzfp.security.common.shiro.loginAuth.AuthServerLoginRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:47.746 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'authServerTokenRealm' of type [com.gsww.jzfp.security.common.shiro.tokenAuth.AuthServerTokenRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:47.746 INFO 25272 --- [ restartedMain] c.g.j.s.common.shiro.config.ShiroConfig : -------shiro securityManager 初始化 shiroCacheType=redis 2025-06-20 16:28:48.430 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'rememberMeCookie' of type [org.apache.shiro.web.servlet.SimpleCookie] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.432 INFO 25272 --- [ restartedMain] 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) 2025-06-20 16:28:48.433 INFO 25272 --- [ restartedMain] 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) 2025-06-20 16:28:48.437 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'redisConfiguration' of type [com.zdww.tpgg.auth.config.RedisConfiguration$$EnhancerBySpringCGLIB$$bf92ec21] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.443 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'spring.redis-org.springframework.boot.autoconfigure.data.redis.RedisProperties' of type [org.springframework.boot.autoconfigure.data.redis.RedisProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.446 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration' of type [org.springframework.boot.autoconfigure.data.redis.LettuceConnectionConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.457 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.actuate.autoconfigure.metrics.redis.LettuceMetricsAutoConfiguration' of type [org.springframework.boot.actuate.autoconfigure.metrics.redis.LettuceMetricsAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.457 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration' of type [org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.458 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'management.metrics.export.simple-org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleProperties' of type [org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.462 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'simpleConfig' of type [org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimplePropertiesConfigAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.462 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration' of type [org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.463 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'micrometerClock' of type [io.micrometer.core.instrument.Clock$1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.477 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'simpleMeterRegistry' of type [io.micrometer.core.instrument.simple.SimpleMeterRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.479 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'micrometerOptions' of type [io.lettuce.core.metrics.MicrometerOptions] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.480 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'lettuceMetrics' of type [org.springframework.boot.actuate.autoconfigure.metrics.redis.LettuceMetricsAutoConfiguration$$Lambda$450/1519720651] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.541 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'lettuceClientResources' of type [io.lettuce.core.resource.DefaultClientResources] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.627 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'redisConnectionFactory' of type [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.646 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'cacheManager' of type [org.springframework.data.redis.cache.RedisCacheManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.647 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'loginFailLimitService' of type [com.gsww.jzfp.security.server.modules.sys.service.LoginFailLimitService] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.649 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'com.gsww.jdp.boot.encrypt.JdpEncryptAutoConfiguration' of type [com.gsww.jdp.boot.encrypt.JdpEncryptAutoConfiguration$$EnhancerBySpringCGLIB$$dd4e14e5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.653 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'jdp.encrypt-com.gsww.jdp.boot.encrypt.properties.EncryptProperties' of type [com.gsww.jdp.boot.encrypt.properties.EncryptProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.656 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'encryptHandle' of type [com.gsww.jdp.core.crypto.aes.AesEncryptHandleImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.657 INFO 25272 --- [ restartedMain] c.g.j.s.common.shiro.config.ShiroConfig : -------shiro ShiroFilterFactoryBean 初始化 2025-06-20 16:28:48.665 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'fixedSecretKeyProvider' of type [com.gsww.jdp.boot.encrypt.core.FixedSecretKeyProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.668 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'secretKeyStore' of type [com.gsww.jdp.boot.encrypt.core.SecretKeyStoreDefaultImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.669 INFO 25272 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'headerSecretKeyProvider' of type [com.gsww.jdp.boot.encrypt.core.HeaderSecretKeyProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-06-20 16:28:48.670 INFO 25272 --- [ restartedMain] c.g.j.s.c.s.t.AuthServerTokenFilter : 注意:重写AuthServerTokenFilter,依赖jzfp-security:1.2.5 2025-06-20 16:28:48.699 INFO 25272 --- [ restartedMain] 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) 2025-06-20 16:28:49.076 INFO 25272 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9300 (http) 2025-06-20 16:28:49.083 INFO 25272 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-06-20 16:28:49.083 INFO 25272 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83] 2025-06-20 16:28:49.171 INFO 25272 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-06-20 16:28:49.171 INFO 25272 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3050 ms 2025-06-20 16:28:49.522 INFO 25272 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2025-06-20 16:28:49.606 INFO 25272 --- [ restartedMain] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource 2025-06-20 16:28:49.635 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWithMD5AndDES 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.poolSize, using default value: 1 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerName, using default value: null 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator 2025-06-20 16:28:49.637 INFO 25272 --- [ restartedMain] c.u.j.encryptor.DefaultLazyEncryptor : Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64 2025-06-20 16:28:49.692 WARN 25272 --- [ restartedMain] c.a.druid.pool.DruidAbstractDataSource : oracle.jdbc.driver.OracleDriver is deprecated.Having use oracle.jdbc.OracleDriver. 2025-06-20 16:28:49.732 WARN 25272 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : removeAbandoned is true, not use in production. 2025-06-20 16:28:49.737 INFO 25272 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2025-06-20 16:28:50.070 WARN 25272 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/E:/Program%20Files/apache-maven-3.9.1/rep/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/E:/Program%20Files/apache-maven-3.9.1/rep/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid mapping on handler class [com.gsww.jzfp.security.server.modules.sys.controller.RestLoginController]: public java.lang.String com.gsww.jzfp.security.common.base.BaseController.bindException() 2025-06-20 16:28:50.072 INFO 25272 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closing ... 2025-06-20 16:28:50.082 INFO 25272 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed 2025-06-20 16:28:50.102 INFO 25272 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2025-06-20 16:28:50.105 INFO 25272 --- [eate-1297110671] com.alibaba.druid.pool.DruidDataSource : put physical connection to pool failed. 2025-06-20 16:28:50.117 INFO 25272 --- [ restartedMain] ConditionEvaluationReportLoggingListener : Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-06-20 16:28:50.137 ERROR 25272 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/E:/Program%20Files/apache-maven-3.9.1/rep/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/E:/Program%20Files/apache-maven-3.9.1/rep/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid mapping on handler class [com.gsww.jzfp.security.server.modules.sys.controller.RestLoginController]: public java.lang.String com.gsww.jzfp.security.common.base.BaseController.bindException() at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:929) ~[spring-context-5.3.31.jar:5.3.31] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591) ~[spring-context-5.3.31.jar:5.3.31] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) [spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409) [spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) [spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289) [spring-boot-2.7.18.jar:2.7.18] at com.zdww.tpgg.auth.AuthApplication.main(AuthApplication.java:16) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_361] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_361] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_361] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_361] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) [spring-boot-devtools-2.7.18.jar:2.7.18] Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/E:/Program%20Files/apache-maven-3.9.1/rep/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid mapping on handler class [com.gsww.jzfp.security.server.modules.sys.controller.RestLoginController]: public java.lang.String com.gsww.jzfp.security.common.base.BaseController.bindException() at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:224) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1462) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-5.3.31.jar:5.3.31] ... 24 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Invalid mapping on handler class [com.gsww.jzfp.security.server.modules.sys.controller.RestLoginController]: public java.lang.String com.gsww.jzfp.security.common.base.BaseController.bindException() at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1462) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-5.3.31.jar:5.3.31] ... 41 common frames omitted Caused by: java.lang.IllegalStateException: Invalid mapping on handler class [com.gsww.jzfp.security.server.modules.sys.controller.RestLoginController]: public java.lang.String com.gsww.jzfp.security.common.base.BaseController.bindException() at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$1(AbstractHandlerMethodMapping.java:288) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.core.MethodIntrospector.lambda$selectMethods$0(MethodIntrospector.java:74) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:367) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:375) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.MethodIntrospector.selectMethods(MethodIntrospector.java:72) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:281) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.processCandidateBean(AbstractHandlerMethodMapping.java:266) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:225) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:213) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:205) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.31.jar:5.3.31] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.31.jar:5.3.31] ... 55 common frames omitted Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) ~[na:1.8.0_361] at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) ~[na:1.8.0_361] at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) ~[na:1.8.0_361] at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) ~[na:1.8.0_361] at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_361] at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_361] at java.lang.reflect.Executable.declaredAnnotations(Executable.java:599) ~[na:1.8.0_361] at java.lang.reflect.Executable.declaredAnnotations(Executable.java:597) ~[na:1.8.0_361] at java.lang.reflect.Executable.getDeclaredAnnotations(Executable.java:588) ~[na:1.8.0_361] at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:630) ~[na:1.8.0_361] at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:454) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.AnnotationsScanner.isKnownEmpty(AnnotationsScanner.java:492) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.TypeMappedAnnotations.from(TypeMappedAnnotations.java:251) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.MergedAnnotations.from(MergedAnnotations.java:351) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.MergedAnnotations.from(MergedAnnotations.java:330) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.AnnotatedElementUtils.findAnnotations(AnnotatedElementUtils.java:800) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation(AnnotatedElementUtils.java:642) ~[spring-core-5.3.31.jar:5.3.31] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.createRequestMappingInfo(RequestMappingHandlerMapping.java:321) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.getMappingForMethod(RequestMappingHandlerMapping.java:284) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.getMappingForMethod(RequestMappingHandlerMapping.java:76) ~[spring-webmvc-5.3.31.jar:5.3.31] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$1(AbstractHandlerMethodMapping.java:284) ~[spring-webmvc-5.3.31.jar:5.3.31] ... 66 common frames omitted
06-22
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值