o.s.b.CachedIntrospectionResults-不强烈缓存类,因为它不是缓存安全的]

问题描述 投票:0回答:1

有人知道这个警告是什么意思吗?

o.s.b.CachedIntrospectionResults - Not strongly caching class because it is not cache-safe

这是我的游戏框架应用程序中记录的警告。似乎与春季的class有关,但我找不到更多信息...

java spring playframework javabeans
1个回答
0
投票

似乎是从org.springframework.beans.CachedIntrospectionResults#forClass库的spring-beans方法引发的消息,该方法使用org.springframework.util.ClassUtils#isCacheSafe库的spring-core方法检查类是否是缓存安全的。

CachedIntrospectionResults#forClass:


/**
* Create CachedIntrospectionResults for the given bean class.
* @param beanClass the bean class to analyze
* @return the corresponding CachedIntrospectionResults
* @throws BeansException in case of introspection failure
*/
static CachedIntrospectionResults forClass(Class<?> beanClass) {
...
if (ClassUtils.isCacheSafe(...)) {
    ...
        }
        else {
            ...
                logger.debug("Not strongly caching class [" + beanClass.getName() + "] because it is not cache-safe");
            }
            ...
        }

ClassUtils#isCacheSafe:

/**
* Check whether the given class is cache-safe in the given context,
* i.e. whether it is loaded by the given ClassLoader or a parent of it.
* @param clazz the class to analyze
* @param classLoader the ClassLoader to potentially cache metadata in
* (may be {@code null} which indicates the system class loader)
*/
public static boolean isCacheSafe(Class<?> clazz, @Nullable ClassLoader classLoader) {
...

也许CachedIntrospectionResultsClassUtils类的来源会有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.