PostProcessorRegistrationDelegate

本文深入探讨Spring框架中BeanFactoryPostProcessor与BeanPostProcessor的工作原理。详细介绍了这两种后置处理器如何帮助定制Bean的初始化过程,并按优先级顺序执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

概述

PostProcessorRegistrationDelegateAbstractApplicationContext委托执行post processors任务的工具类
这里的postProcessor包括两类 :

  • BeanFactoryPostProcessor
  • BeanPostProcessor

实际上BeanFactoryPostProcessor又细分为两类:

1.BeanDefinitionRegistryPostProcessorBeanDefinitionRegistry后置处理器

2.BeanFactoryPostProcessorBeanFactory后置处理器

BeanDefinitionRegistryPostProcessor其实继承自BeanFactoryPostProcessor,是一种特殊的BeanFactoryPostProcessorBeanDefinitionRegistryPostProcessor的设计目的是在常规BeanFactoryPostProcessor处理BeanFactory(也就是容器)前先对bean注册做处理,比如注册更多的bean,实现此目的是通过BeanDefinitionRegistryPostProcessor定义的方法postProcessBeanDefinitionRegistry

如果一个实现类是BeanDefinitionRegistryPostProcessor,那么它的postProcessBeanDefinitionRegistry方法总是要早与它的postProcessBeanFactory方法被调用。

该工具类位于包

package org.springframework.context.support;

两个主要功能

功能一 : 执行 BeanFactoryPostProcessor

背景介绍 :

  1. ApplicationContext对象在构造函数执行时会创建一些BeanFactoryPostProcessor,比如
    AnnotationConfigEmbeddedWebApplicationContext构造函数中最终会通过
    AnnotationConfigUtils注册进来一些BeanFactoryPostProcessor/BeanPostProcessor

  2. ApplicationContextApplicationContextInitializer被执行时会创建特定功能的
    BeanFactoryPostProcessor记录在ApplicationContext中(注意:这里不是注册到容器中,
    而是记录为ApplicationContext的属性);

  3. ApplicationContext.refresh()中,BeanFactory preparepost process 之后,会
    调用 invokeBeanFactoryPostProcessors() 执行这些BeanFactoryPostProcessor
    完成指定的功能。

举例来看,一个缺省的Web SpringBootApplication 会被添加这几个 BeanFactoryPostProcessor

ConfigurationWarningsApplicationContextInitializer$ConfigurationWarningsPostProcessor

SharedMetadataReaderFactoryContextInitializer$CachingMetadataReaderFactoryPostProcessor

ConfigFileApplicationListener$PropertySourceOrderingPostProcessor

invokeBeanFactoryPostProcessors()的具体实现逻辑如下 :

/**
 * 调用BeanFactoryPostProcessor
 * 
 * @参数 beanFactory 应用上下文的 BeanFactory 实例
 * @参数 beanFactoryPostProcessors 应用上下文指定要执行的 BeanFactoryPostProcessor
**/
public static void invokeBeanFactoryPostProcessors(
		ConfigurableListableBeanFactory beanFactory, List<BeanFactoryPostProcessor> beanFactoryPostProcessors) {

	// Invoke BeanDefinitionRegistryPostProcessors first, if any.
	Set<String> processedBeans = new HashSet<String>();

	if (beanFactory instanceof BeanDefinitionRegistry) {
		BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
		
		// 用于记录常规 BeanFactoryPostProcessor
		List<BeanFactoryPostProcessor> regularPostProcessors = 
			new LinkedList<BeanFactoryPostProcessor>();
			
		// 用于记录 BeanDefinitionRegistryPostProcessor
		List<BeanDefinitionRegistryPostProcessor> registryProcessors = 
			new LinkedList<BeanDefinitionRegistryPostProcessor>();
		
		// 遍历所有参数传递进来的 BeanFactoryPostProcessor(它们并没有作为bean注册在容器中)
        // 将所有参数传入的 BeanFactoryPostProcessor 分成两组 : 
        // BeanDefinitionRegistryPostProcessor 和常规 BeanFactoryPostProcessor
        // 1.如果是BeanDefinitionRegistryPostProcessor,现在执行postProcessBeanDefinitionRegistry(),
        // 2.否则记录为一个常规 BeanFactoryPostProcessor,现在不执行处理
		for (BeanFactoryPostProcessor postProcessor : beanFactoryPostProcessors) {
			if (postProcessor instanceof BeanDefinitionRegistryPostProcessor) {
				BeanDefinitionRegistryPostProcessor registryProcessor =
						(BeanDefinitionRegistryPostProcessor) postProcessor;
				registryProcessor.postProcessBeanDefinitionRegistry(registry);
				registryProcessors.add(registryProcessor);
			}
			else {
				regularPostProcessors.add(postProcessor);
			}
		}

		// Do not initialize FactoryBeans here: We need to leave all regular beans
		// uninitialized to let the bean factory post-processors apply to them!
		// Separate between BeanDefinitionRegistryPostProcessors that implement
		// PriorityOrdered, Ordered, and the rest.
		// currentRegistryProcessors 用于记录当前正要被执行的BeanDefinitionRegistryPostProcessor
		List<BeanDefinitionRegistryPostProcessor> currentRegistryProcessors = 
			new ArrayList<BeanDefinitionRegistryPostProcessor>();

		// First, invoke the BeanDefinitionRegistryPostProcessors that implement PriorityOrdered.
		// 1. 对 Bean形式 BeanDefinitionRegistryPostProcessor + PriorityOrdered 的调用
		// 找出所有容器中注册为bean存在的BeanDefinitionRegistryPostProcessor
		String[] postProcessorNames =
				beanFactory.getBeanNamesForType(BeanDefinitionRegistryPostProcessor.class, true, false);
		for (String ppName : postProcessorNames) {
			if (beanFactory.isTypeMatch(ppName, PriorityOrdered.class)) {
				currentRegistryProcessors.add(beanFactory.getBean(ppName, 
										BeanDefinitionRegistryPostProcessor.class));
				processedBeans.add(ppName);
			}
		}
		sortPostProcessors(currentRegistryProcessors, beanFactory);
		// Bean形式存在的 BeanDefinitionRegistryPostProcessor 也添加到 registryProcessors 中
		registryProcessors.addAll(currentRegistryProcessors);
				
		// 对bean形式存在的 BeanDefinitionRegistryPostProcessor 执行其对		
		// BeanDefinitionRegistry的postProcessBeanDefinitionRegistry()
		invokeBeanDefinitionRegistryPostProcessors(currentRegistryProcessors, registry);
		currentRegistryProcessors.clear();//清空

		// Next, invoke the BeanDefinitionRegistryPostProcessors that implement Ordered.
		// 2. 对 Bean形式 BeanDefinitionRegistryPostProcessor + Ordered的调用
		postProcessorNames = beanFactory.getBeanNamesForType(
											BeanDefinitionRegistryPostProcessor.class, true, false);
		for (String ppName : postProcessorNames) {
			if (!processedBeans.contains(ppName) && beanFactory.isTypeMatch(ppName, Ordered.class)) {
				currentRegistryProcessors.add(beanFactory.getBean(ppName, 
											BeanDefinitionRegistryPostProcessor.class));
				processedBeans.add(ppName);
			}
		}
		sortPostProcessors(currentRegistryProcessors, beanFactory);
		// Bean形式存在的 BeanDefinitionRegistryPostProcessor 也添加到 registryProcessors 中
		registryProcessors.addAll(currentRegistryProcessors);
		// 对Bean形式存在的 BeanDefinitionRegistryPostProcessor 执行其对		
		// BeanDefinitionRegistry的postProcessBeanDefinitionRegistry()		
		invokeBeanDefinitionRegistryPostProcessors(currentRegistryProcessors, registry);
		currentRegistryProcessors.clear();//清空

		// Finally, invoke all other BeanDefinitionRegistryPostProcessors until no further ones appear.
		// 3. 对 Bean形式 BeanDefinitionRegistryPostProcessor , 并且未实现
		// PriorityOrdered或者Ordered接口进行处理,直到没有未被处理的
		boolean reiterate = true;
		while (reiterate) {
			reiterate = false;
			postProcessorNames = beanFactory.getBeanNamesForType(
					BeanDefinitionRegistryPostProcessor.class, true, false);
			for (String ppName : postProcessorNames) {
				if (!processedBeans.contains(ppName)) {
					// 发现了一个尚未被处理的 BeanDefinitionRegistryPostProcessor 
					currentRegistryProcessors.add(beanFactory.getBean(ppName, 
							BeanDefinitionRegistryPostProcessor.class));
					processedBeans.add(ppName);
					reiterate = true;
				}
			}
			sortPostProcessors(currentRegistryProcessors, beanFactory);
			registryProcessors.addAll(currentRegistryProcessors);
			invokeBeanDefinitionRegistryPostProcessors(currentRegistryProcessors, registry);
			currentRegistryProcessors.clear();//清空
		}

		// Now, invoke the postProcessBeanFactory callback of all processors handled so far.
		// 因为BeanDefinitionRegistryPostProcessor继承自BeanFactoryPostProcessor,所以这里
		// 也对所有 BeanDefinitionRegistryPostProcessor 调用其方法 postProcessBeanFactory()
		invokeBeanFactoryPostProcessors(registryProcessors, beanFactory);
		// 对所有常规 BeanFactoryPostProcessor 调用其方法 postProcessBeanFactory()
		invokeBeanFactoryPostProcessors(regularPostProcessors, beanFactory);
	}

	else {
		// Invoke factory processors registered with the context instance.
		invokeBeanFactoryPostProcessors(beanFactoryPostProcessors, beanFactory);
	}

	// 以上逻辑执行了所有参数传入的和以bean定义方式存在的BeanDefinitionRegistryPostProcessor,
	// 也执行了所有参数传入的BeanFactoryPostProcessor, 但是尚未处理所有以bean定义方式存在的
	// BeanFactoryPostProcessor, 下面的逻辑处理这部分 BeanFactoryPostProcessor.

	// Do not initialize FactoryBeans here: We need to leave all regular beans
	// uninitialized to let the bean factory post-processors apply to them!
	String[] postProcessorNames =
			beanFactory.getBeanNamesForType(BeanFactoryPostProcessor.class, true, false);

	// 将所有目前记录的所有BeanFactoryPostProcessor分成三部分 :
	// 1. 实现了 PriorityOrdered 接口的,
	// 2. 实现了 Ordered 接口的,
	// 3. 其他.
	// 接下来的逻辑会对这三种BeanFactoryPostProcessor分别处理
	// Separate between BeanFactoryPostProcessors that implement PriorityOrdered,
	// Ordered, and the rest.
	List<BeanFactoryPostProcessor> priorityOrderedPostProcessors = 
										new ArrayList<BeanFactoryPostProcessor>();
	List<String> orderedPostProcessorNames = new ArrayList<String>();
	List<String> nonOrderedPostProcessorNames = new ArrayList<String>();
	for (String ppName : postProcessorNames) {
		if (processedBeans.contains(ppName)) {
			// skip - already processed in first phase above
		}
		else if (beanFactory.isTypeMatch(ppName, PriorityOrdered.class)) {
			priorityOrderedPostProcessors.add(beanFactory.getBean(ppName, BeanFactoryPostProcessor.class));
		}
		else if (beanFactory.isTypeMatch(ppName, Ordered.class)) {
			orderedPostProcessorNames.add(ppName);
		}
		else {
			nonOrderedPostProcessorNames.add(ppName);
		}
	}

	// First, invoke the BeanFactoryPostProcessors that implement PriorityOrdered.
	// 1. 执行Bean形式 BeanFactoryPostProcessor + PriorityOrdered
	sortPostProcessors(priorityOrderedPostProcessors, beanFactory);
	invokeBeanFactoryPostProcessors(priorityOrderedPostProcessors, beanFactory);

	// Next, invoke the BeanFactoryPostProcessors that implement Ordered.
	// 2. 执行Bean形式 BeanFactoryPostProcessor + Ordered
	List<BeanFactoryPostProcessor> orderedPostProcessors = new ArrayList<BeanFactoryPostProcessor>();
	for (String postProcessorName : orderedPostProcessorNames) {
		orderedPostProcessors.add(beanFactory.getBean(postProcessorName, BeanFactoryPostProcessor.class));
	}
	sortPostProcessors(orderedPostProcessors, beanFactory);
	invokeBeanFactoryPostProcessors(orderedPostProcessors, beanFactory);

	// Finally, invoke all other BeanFactoryPostProcessors.
	// 3. 执行Bean形式 BeanFactoryPostProcessor , 没有实现 PriorityOrdered 或者 Ordered 接口
	List<BeanFactoryPostProcessor> nonOrderedPostProcessors = new ArrayList<BeanFactoryPostProcessor>();
	for (String postProcessorName : nonOrderedPostProcessorNames) {
		nonOrderedPostProcessors.add(beanFactory.getBean(postProcessorName, BeanFactoryPostProcessor.class));
	}
	invokeBeanFactoryPostProcessors(nonOrderedPostProcessors, beanFactory);

	// Clear cached merged bean definitions since the post-processors might have
	// modified the original metadata, e.g. replacing placeholders in values...
	beanFactory.clearMetadataCache();
}

功能二 : 注册 BeanPostProcessor

public static void registerBeanPostProcessors(
		ConfigurableListableBeanFactory beanFactory, AbstractApplicationContext applicationContext) {

	// 找到所有注册到容器的 BeanPostProcessor 的名字
	String[] postProcessorNames = beanFactory.getBeanNamesForType(BeanPostProcessor.class, true, false);

	// Register BeanPostProcessorChecker that logs an info message when
	// a bean is created during BeanPostProcessor instantiation, i.e. when
	// a bean is not eligible for getting processed by all BeanPostProcessors.
	int beanProcessorTargetCount = beanFactory.getBeanPostProcessorCount() + 1 + postProcessorNames.length;
	beanFactory.addBeanPostProcessor(new BeanPostProcessorChecker(beanFactory, beanProcessorTargetCount));

	// Separate between BeanPostProcessors that implement PriorityOrdered,
	// Ordered, and the rest.
	// 将 BeanPostProcessor 分成三类处理 : PriorityOrdered, Ordered 和 其它。
	List<BeanPostProcessor> priorityOrderedPostProcessors = new ArrayList<BeanPostProcessor>();
	List<BeanPostProcessor> internalPostProcessors = new ArrayList<BeanPostProcessor>();
	List<String> orderedPostProcessorNames = new ArrayList<String>();
	List<String> nonOrderedPostProcessorNames = new ArrayList<String>();
	for (String ppName : postProcessorNames) {
		if (beanFactory.isTypeMatch(ppName, PriorityOrdered.class)) {
			BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
			priorityOrderedPostProcessors.add(pp);
			if (pp instanceof MergedBeanDefinitionPostProcessor) {
				internalPostProcessors.add(pp);
			}
		}
		else if (beanFactory.isTypeMatch(ppName, Ordered.class)) {
			orderedPostProcessorNames.add(ppName);
		}
		else {
			nonOrderedPostProcessorNames.add(ppName);
		}
	}

	// First, register the BeanPostProcessors that implement PriorityOrdered.
	sortPostProcessors(priorityOrderedPostProcessors, beanFactory);
	registerBeanPostProcessors(beanFactory, priorityOrderedPostProcessors);

	// Next, register the BeanPostProcessors that implement Ordered.
	List<BeanPostProcessor> orderedPostProcessors = new ArrayList<BeanPostProcessor>();
	for (String ppName : orderedPostProcessorNames) {
		BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
		orderedPostProcessors.add(pp);
		if (pp instanceof MergedBeanDefinitionPostProcessor) {
			internalPostProcessors.add(pp);
		}
	}
	sortPostProcessors(orderedPostProcessors, beanFactory);
	registerBeanPostProcessors(beanFactory, orderedPostProcessors);

	// Now, register all regular BeanPostProcessors.
	List<BeanPostProcessor> nonOrderedPostProcessors = new ArrayList<BeanPostProcessor>();
	for (String ppName : nonOrderedPostProcessorNames) {
		BeanPostProcessor pp = beanFactory.getBean(ppName, BeanPostProcessor.class);
		nonOrderedPostProcessors.add(pp);
		if (pp instanceof MergedBeanDefinitionPostProcessor) {
			internalPostProcessors.add(pp);
		}
	}
	registerBeanPostProcessors(beanFactory, nonOrderedPostProcessors);

	// Finally, re-register all internal BeanPostProcessors.
	sortPostProcessors(internalPostProcessors, beanFactory);
	registerBeanPostProcessors(beanFactory, internalPostProcessors);

	// Re-register post-processor for detecting inner beans as ApplicationListeners,
	// moving it to the end of the processor chain (for picking up proxies etc).
	// 重新注册用于检测实现了ApplicationListener接口的内部bean的post processor,
	// 把它放到processor链的尾部
	beanFactory.addBeanPostProcessor(new ApplicationListenerDetector(applicationContext));
}

  
14:15:25.970 [main] ERROR o.s.b.SpringApplication - [reportFailure,857] - Application run failed org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'hjyCommunityMapper' defined in file [D:\idea-workspace\hejiayun_community\target\classes\com\mz\hejiayun_community\community\domain\mapper\HjyCommunityMapper.class]: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:864) at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:745) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAnnotationOnBean(DefaultListableBeanFactory.java:817) at org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector.detect(AnnotationDependsOnDatabaseInitializationDetector.java:36) at org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor.detectDependsOnInitializationBeanNames(DatabaseInitializationDependencyConfigurer.java:152) at org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor.postProcessBeanFactory(DatabaseInitializationDependencyConfigurer.java:115) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:363) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:197) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:609) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:144) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1461) at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:563) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:144) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:110) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:225) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:152) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:130) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:200) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:139) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:260) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:159) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:383) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:388) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:382) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:382) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:293) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:292) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:281) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:280) at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:27) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:112) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:111) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:69) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:128) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:128) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:160) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:146) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:144) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:100) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:160) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:146) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:144) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:100) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:201) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:170) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:94) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:59) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:142) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:58) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) at org.junit.platform.launcher.core.InterceptingLauncher.lambda$execute$1(InterceptingLauncher.java:39) at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25) at org.junit.platform.launcher.core.InterceptingLauncher.execute(InterceptingLauncher.java:38) at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:63) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) 14:15:25.976 [main] WARN o.s.t.c.TestContextManager - [prepareTestInstance,272] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] to prepare test instance [com.mz.hejiayun_community.HejiayunCommunityApplicationTests@7a2fce12] java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@2dafae61 testClass = com.mz.hejiayun_community.HejiayunCommunityApplicationTests, locations = [], classes = [com.mz.hejiayun_community.HejiayunCommunityApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@3a12c404, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2c1156a7, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@2e2ff723, org.springframework.boot.test.web.reactor.netty.DisableReactorResourceFactoryGlobalResourcesContextCustomizerFactory$DisableReactorResourceFactoryGlobalResourcesContextCustomizerCustomizer@2df6226d, org.springframework.boot.test.autoconfigure.OnFailureConditionReportContextCustomizerFactory$OnFailureConditionReportContextCustomizer@49cb9cb5, org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@495b0487, org.springframework.test.context.support.DynamicPropertiesContextCustomizer@0, org.springframework.boot.test.context.SpringBootTestAnnotation@a0c6845b], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:180) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:130) at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:200) at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:139) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:260) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:159) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:383) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:388) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:382) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:382) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:293) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:292) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:281) at java.base/java.util.Optional.orElseGet(Optional.java:364) at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:280) at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:27) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:112) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:111) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:69) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:128) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:128) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:160) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:146) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:144) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:100) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:160) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:146) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:144) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:143) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:100) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:201) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:170) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:94) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:59) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:142) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:58) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) at org.junit.platform.launcher.core.InterceptingLauncher.lambda$execute$1(InterceptingLauncher.java:39) at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25) at org.junit.platform.launcher.core.InterceptingLauncher.execute(InterceptingLauncher.java:38) at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:63) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'hjyCommunityMapper' defined in file [D:\idea-workspace\hejiayun_community\target\classes\com\mz\hejiayun_community\community\domain\mapper\HjyCommunityMapper.class]: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:864) at org.springframework.beans.factory.support.AbstractBeanFactory.getType(AbstractBeanFactory.java:745) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAnnotationOnBean(DefaultListableBeanFactory.java:817) at org.springframework.boot.sql.init.dependency.AnnotationDependsOnDatabaseInitializationDetector.detect(AnnotationDependsOnDatabaseInitializationDetector.java:36) at org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor.detectDependsOnInitializationBeanNames(DatabaseInitializationDependencyConfigurer.java:152) at org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor.postProcessBeanFactory(DatabaseInitializationDependencyConfigurer.java:115) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:363) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:197) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:791) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:609) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:144) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1461) at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:563) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:144) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:110) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:225) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:152) ... 78 common frames omitted
最新发布
07-27
解决报错[root@localhost docker]# docker logs -f tdm-jar LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@667346055 _____ _____ _____ /\ \ /\ \ /\ \ /::\ \ /::\ \ /::\____\ \:::\ \ /::::\ \ /::::| | \:::\ \ /::::::\ \ /:::::| | \:::\ \ /:::/\:::\ \ /::::::| | \:::\ \ /:::/ \:::\ \ /:::/|::| | /::::\ \ /:::/ \:::\ \ /:::/ |::| | /::::::\ \ /:::/ / \:::\ \ /:::/ |::|___|______ /:::/\:::\ \ /:::/ / \:::\ ___\ /:::/ |::::::::\ \ /:::/ \:::\____\/:::/____/ \:::| /:::/ |:::::::::\____\ /:::/ \::/ /\:::\ \ /:::|____\::/ / ~~~~~/:::/ / /:::/ / \/____/ \:::\ \ /:::/ / \/____/ /:::/ / /:::/ / \:::\ \ /:::/ / /:::/ / /:::/ / \:::\ /:::/ / /:::/ / \::/ / \:::\ /:::/ / /:::/ / \/____/ \:::\/:::/ / /:::/ / \::::::/ / /:::/ / \::::/ / /:::/ / \::/____/ \::/ / ~~ \/____/ 2025-07-25 07:37:16,287 INFO [main] - cn.serverx.sx.ServerXApplication:55 - Starting ServerXApplication on 974d7161bb6c with PID 1 (/app/sx-admin-1.0-SNAPSHOT.jar started by root in /app) 2025-07-25 07:37:16,300 INFO [main] - cn.serverx.sx.ServerXApplication:655 - The following profiles are active: p 2025-07-25 07:37:26,626 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:249 - Multiple Spring Data modules found, entering strict repository configuration mode! 2025-07-25 07:37:26,632 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:127 - Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2025-07-25 07:37:27,700 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data JPA - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.elasticsearch.EsLogDao. If you want this repository to be a JPA repository, consider annotating your entities with one of these annotations: javax.persistence.Entity, javax.persistence.MappedSuperclass (preferred), or consider extending one of the following types with your repository: org.springframework.data.jpa.repository.JpaRepository. 2025-07-25 07:37:28,073 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:187 - Finished Spring Data repository scanning in 1405ms. Found 27 JPA repository interfaces. 2025-07-25 07:37:28,223 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:249 - Multiple Spring Data modules found, entering strict repository configuration mode! 2025-07-25 07:37:28,227 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:127 - Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2025-07-25 07:37:28,307 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.base.dao.DictDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,322 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.base.dao.DictDataDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,323 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.ActBusinessDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,324 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.ActCategoryDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,327 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.ActModelDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,328 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.ActNodeDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,328 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.ActProcessDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,329 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.activiti.dao.business.LeaveDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,330 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.social.dao.GithubDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,330 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.social.dao.QQDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,330 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.social.dao.WechatDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,358 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.social.dao.WeiboDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,360 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.DepartmentDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,360 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.DepartmentHeaderDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,361 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.elasticsearch.EsLogDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,361 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.LogDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,367 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.MessageDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,367 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.MessageSendDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,368 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.PermissionDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,368 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.RoleDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,369 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.RoleDepartmentDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,378 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.RolePermissionDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,378 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.SettingDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,379 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.UserDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,379 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.core.dao.UserRoleDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,380 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.file.dao.FileDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,392 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.quartz.dao.QuartzJobDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,397 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport:348 - Spring Data Redis - Could not safely identify store assignment for repository candidate interface cn.serverx.sx.open.dao.ClientDao. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository. 2025-07-25 07:37:28,397 INFO [main] - org.springframework.data.repository.config.RepositoryConfigurationDelegate:187 - Finished Spring Data repository scanning in 149ms. Found 0 Redis repository interfaces. 2025-07-25 07:37:29,164 WARN [main] - org.mybatis.spring.mapper.ClassPathMapperScanner:44 - Skipping MapperFactoryBean with name 'permissionMapper' and 'cn.serverx.sx.core.dao.mapper.PermissionMapper' mapperInterface. Bean already defined with the same name! 2025-07-25 07:37:29,164 WARN [main] - org.mybatis.spring.mapper.ClassPathMapperScanner:44 - Skipping MapperFactoryBean with name 'userRoleMapper' and 'cn.serverx.sx.core.dao.mapper.UserRoleMapper' mapperInterface. Bean already defined with the same name! 2025-07-25 07:37:29,172 WARN [main] - org.mybatis.spring.mapper.ClassPathMapperScanner:44 - Skipping MapperFactoryBean with name 'actMapper' and 'cn.serverx.sx.activiti.dao.mapper.ActMapper' mapperInterface. Bean already defined with the same name! 2025-07-25 07:37:29,173 WARN [main] - org.mybatis.spring.mapper.ClassPathMapperScanner:44 - Skipping MapperFactoryBean with name 'historyIdentityMapper' and 'cn.serverx.sx.activiti.dao.mapper.HistoryIdentityMapper' mapperInterface. Bean already defined with the same name! 2025-07-25 07:37:29,173 WARN [main] - org.mybatis.spring.mapper.ClassPathMapperScanner:44 - Skipping MapperFactoryBean with name 'runIdentityMapper' and 'cn.serverx.sx.activiti.dao.mapper.RunIdentityMapper' mapperInterface. Bean already defined with the same name! 2025-07-25 07:37:30,140 INFO [main] - com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesBeanFactoryPostProcessor:48 - Post-processing PropertySource instances 2025-07-25 07:37:30,481 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy 2025-07-25 07:37:30,482 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource commandLineArgs [org.springframework.core.env.SimpleCommandLinePropertySource] to EncryptableEnumerablePropertySourceWrapper 2025-07-25 07:37:30,482 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper 2025-07-25 07:37:30,483 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper 2025-07-25 07:37:30,483 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper 2025-07-25 07:37:30,483 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper 2025-07-25 07:37:30,483 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper 2025-07-25 07:37:30,484 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource applicationConfig: [file:./application-p.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 2025-07-25 07:37:30,484 INFO [main] - com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter:44 - Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper 2025-07-25 07:37:32,773 INFO [main] - org.springframework.integration.config.DefaultConfiguringBeanFactoryPostProcessor:213 - No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created. 2025-07-25 07:37:32,785 INFO [main] - org.springframework.integration.config.DefaultConfiguringBeanFactoryPostProcessor:300 - No bean named 'taskScheduler' has been explicitly defined. Therefore, a default ThreadPoolTaskScheduler will be created. 2025-07-25 07:37:32,807 INFO [main] - org.springframework.integration.config.DefaultConfiguringBeanFactoryPostProcessor:460 - No bean named 'integrationHeaderChannelRegistry' has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created. 2025-07-25 07:37:33,452 INFO [main] - com.ulisesbocchio.jasyptspringboot.filter.DefaultLazyPropertyFilter:31 - Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter 2025-07-25 07:37:33,763 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,550 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'redisCacheConfig' of type [cn.serverx.sx.core.config.cache.RedisCacheConfig$$EnhancerBySpringCGLIB$$c82ebc37] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,849 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration' of type [org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,928 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'objectPostProcessor' of type [org.springframework.security.config.annotation.configuration.AutowireBeanFactoryObjectPostProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,944 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@44e3760b' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,948 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration' of type [org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:34,993 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:35,059 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:35,140 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'integrationChannelResolver' of type [org.springframework.integration.support.channel.BeanFactoryChannelResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:35,179 INFO [main] - org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker:330 - Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2025-07-25 07:37:36,005 INFO [main] - com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver:35 - Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver 2025-07-25 07:37:36,029 INFO [main] - com.ulisesbocchio.jasyptspringboot.detector.DefaultLazyPropertyDetector:35 - Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector 2025-07-25 07:37:37,980 INFO [main] - org.springframework.boot.web.embedded.tomcat.TomcatWebServer:92 - Tomcat initialized with port(s): 8862 (http) 2025-07-25 07:37:38,088 INFO [main] - org.apache.catalina.core.StandardService:173 - Starting service [Tomcat] 2025-07-25 07:37:38,089 INFO [main] - org.apache.catalina.core.StandardEngine:173 - Starting Servlet engine: [Apache Tomcat/9.0.29] 2025-07-25 07:37:38,484 INFO [main] - org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/]:173 - Initializing Spring embedded WebApplicationContext 2025-07-25 07:37:38,485 INFO [main] - org.springframework.web.context.ContextLoader:284 - Root WebApplicationContext: initialization completed in 21879 ms 2025-07-25 07:37:42,651 INFO [main] - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure:56 - Init DruidDataSource 2025-07-25 07:37:45,200 INFO [main] - com.alibaba.druid.pool.DruidDataSource:1010 - {dataSource-1} inited 2025-07-25 07:37:47,770 INFO [main] - org.hibernate.jpa.internal.util.LogHelper:31 - HHH000204: Processing PersistenceUnitInfo [name: default] 2025-07-25 07:37:48,017 INFO [main] - org.hibernate.Version:46 - HHH000412: Hibernate Core {5.4.9.Final} 2025-07-25 07:37:48,022 INFO [main] - org.hibernate.cfg.Environment:184 - HHH000205: Loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false, hibernate.dialect.storage_engine=innodb} 2025-07-25 07:37:48,995 INFO [main] - org.hibernate.annotations.common.Version:49 - HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2025-07-25 07:37:49,477 INFO [main] - org.hibernate.dialect.Dialect:172 - HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect 2025-07-25 07:37:56,804 INFO [main] - org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator:52 - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2025-07-25 07:37:57,007 INFO [main] - org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean:416 - Initialized JPA EntityManagerFactory for persistence unit 'default' 2025-07-25 07:37:59,055 WARN [main] - cn.serverx.sx.core.config.security.permission.MyFilterSecurityInterceptor:159 - Could not validate configuration attributes as the SecurityMetadataSource did not return any attributes from getAllConfigAttributes() 2025-07-25 07:38:00,730 INFO [main] - org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar:75 - Registered '/serverx/actuator/jolokia' to jolokia-actuator-endpoint _ _ |_ _ _|_. ___ _ | _ | | |\/|_)(_| | |_\ |_)||_|_\ / | 3.3.1 2025-07-25 07:38:12,093 INFO [main] - org.quartz.impl.StdSchedulerFactory:1220 - Using default implementation for ThreadExecutor 2025-07-25 07:38:12,235 INFO [main] - org.quartz.core.SchedulerSignalerImpl:61 - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 2025-07-25 07:38:12,235 INFO [main] - org.quartz.core.QuartzScheduler:229 - Quartz Scheduler v.2.3.2 created. 2025-07-25 07:38:12,275 INFO [main] - org.springframework.scheduling.quartz.LocalDataSourceJobStore:672 - Using db table-based data access locking (synchronization). 2025-07-25 07:38:12,281 INFO [main] - org.springframework.scheduling.quartz.LocalDataSourceJobStore:145 - JobStoreCMT initialized. 2025-07-25 07:38:12,283 INFO [main] - org.quartz.core.QuartzScheduler:294 - Scheduler meta-data: Quartz Scheduler (v2.3.2) 'quartzScheduler' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads. Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is not clustered. 2025-07-25 07:38:12,283 INFO [main] - org.quartz.impl.StdSchedulerFactory:1374 - Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance. 2025-07-25 07:38:12,284 INFO [main] - org.quartz.impl.StdSchedulerFactory:1378 - Quartz scheduler version: 2.3.2 2025-07-25 07:38:12,284 INFO [main] - org.quartz.core.QuartzScheduler:2293 - JobFactory set to: org.springframework.scheduling.quartz.SpringBeanJobFactory@3ea84e01 Hibernate: select quartzjob0_.id as id1_41_, quartzjob0_.create_by as create_b2_41_, quartzjob0_.create_time as create_t3_41_, quartzjob0_.del_flag as del_flag4_41_, quartzjob0_.update_by as update_b5_41_, quartzjob0_.update_time as update_t6_41_, quartzjob0_.cron_expression as cron_exp7_41_, quartzjob0_.description as descript8_41_, quartzjob0_.job_class_name as job_clas9_41_, quartzjob0_.parameter as paramet10_41_, quartzjob0_.status as status11_41_ from t_quartz_job quartzjob0_ where quartzjob0_.job_class_name=? 2025-07-25 07:38:27,622 ERROR [main] - cn.serverx.sx.job.init.JobInitConfig:122 - org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Table 'tdm.qrtz_locks' doesn't exist [See nested exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'tdm.qrtz_locks' doesn't exist] 2025-07-25 07:38:28,007 WARN [main] - org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext:558 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobInitConfig': Invocation of init method failed; nested exception is ServerXException(msg=创建定时任务失败) 2025-07-25 07:38:28,104 INFO [main] - org.springframework.scheduling.quartz.SchedulerFactoryBean:845 - Shutting down Quartz Scheduler 2025-07-25 07:38:28,106 INFO [main] - org.quartz.core.QuartzScheduler:666 - Scheduler quartzScheduler_$_NON_CLUSTERED shutting down. 2025-07-25 07:38:28,106 INFO [main] - org.quartz.core.QuartzScheduler:585 - Scheduler quartzScheduler_$_NON_CLUSTERED paused. 2025-07-25 07:38:28,118 INFO [main] - org.quartz.core.QuartzScheduler:740 - Scheduler quartzScheduler_$_NON_CLUSTERED shutdown complete. 2025-07-25 07:38:28,155 INFO [main] - org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean:598 - Closing JPA EntityManagerFactory for persistence unit 'default' 2025-07-25 07:38:28,200 INFO [main] - com.alibaba.druid.pool.DruidDataSource:2003 - {dataSource-1} closing ... 2025-07-25 07:38:28,549 INFO [main] - com.alibaba.druid.pool.DruidDataSource:2075 - {dataSource-1} closed 2025-07-25 07:38:28,886 INFO [main] - org.apache.catalina.core.StandardService:173 - Stopping service [Tomcat] 2025-07-25 07:38:29,338 INFO [main] - org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener:136 - Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2025-07-25 07:38:29,385 ERROR [main] - org.springframework.boot.SpringApplication:826 - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobInitConfig': Invocation of init method failed; nested exception is ServerXException(msg=创建定时任务失败) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at cn.serverx.sx.ServerXApplication.main(ServerXApplication.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) Caused by: cn.serverx.sx.core.common.exception.ServerXException: 创建定时任务失败 at cn.serverx.sx.job.init.JobInitConfig.add(JobInitConfig.java:123) at cn.serverx.sx.job.init.JobInitConfig.init(JobInitConfig.java:94) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ... 26 common frames omitted
07-26
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 17:49:48.820 [RMI TCP Connection(2)-127.0.0.1] ERROR o.s.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [springfox.boot.starter.autoconfigure.OpenApiAutoConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [springfox/documentation/spring/web/SpringfoxWebConfiguration.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:616) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:299) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:606) at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:548) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92) at org.springframework.context.support.AbstractApp
04-01
<think>好的,用户遇到了Spring Boot启动失败的问题,具体是OpenApiAutoConfiguration类中找不到SpringfoxWebConfiguration.class文件。我需要先理解这个问题的背景和可能的原因。 首先,用户提到的是Springfox相关的配置问题。Springfox之前用于生成Swagger文档,但现在可能已经过时了,被SpringDoc取代。因此,可能的原因是依赖版本不兼容或者配置错误。 接下来,用户提供的引用内容提到了几个关键点。引用[2]和[3]都涉及Spring Boot项目的配置问题,比如启动类不能放在默认包下,或者组件扫描的问题。这可能和依赖扫描路径有关,但当前的问题更可能是依赖缺失或版本冲突。 需要检查用户是否正确引入了Springfox的依赖。例如,是否在pom.xml或build.gradle中添加了正确的依赖项,比如springfox-boot-starter和springfox-swagger2。同时,Spring Boot版本和Springfox的版本是否兼容,比如Springfox 3.x需要Spring Boot 2.5以上,而如果用户用的是Spring Boot 3.x,可能需要换用SpringDoc。 另外,自动配置类OpenApiAutoConfiguration可能试图加载Springfox的配置类,但由于依赖缺失或版本问题,无法找到相应的类,导致启动失败。这时候需要确认依赖是否正确,或者是否需要迁移到SpringDoc。 可能的解决方案包括:更新依赖版本,检查依赖是否被正确引入,或者替换为SpringDoc。同时,检查主启动类的位置是否正确,是否在顶层包下,避免组件扫描的问题。此外,检查是否有过时的配置或注解,比如@EnableSwagger2可能需要替换。 需要逐步引导用户检查这些方面,确保依赖正确,配置无误,必要时迁移到更新的库。</think>关于Spring Boot启动失败的问题,以下是分步解决方案: ### 问题分析 `OpenApiAutoConfiguration`类依赖`SpringfoxWebConfiguration.class`但找不到文件,通常由以下原因导致: $$ ClassNotFoundException = 依赖缺失 \lor 版本冲突 \lor 自动配置失效 $$ [^2][^3] ### 解决步骤 1. **检查依赖配置** ```xml <!-- pom.xml需包含springfox最新稳定版 --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</artifactId> <version>3.0.0</version> <!-- 最低要求Spring Boot 2.5+ --> </dependency> ``` 若使用Spring Boot 3.x必须改用springdoc-openapi[^1] 2. **验证包结构** 确保主启动类位于顶层包(如`com.example`),不可直接放在`java`文件夹下: ```java package com.example.demo; // 正确的包层级 @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` 3. **清除旧配置** 若曾使用过时swagger2注解: ```java // 错误配置(需移除) @EnableSwagger2 public class SwaggerConfig {} ``` 4. **版本兼容处理** 当Spring Boot ≥2.6时需添加配置: ```properties spring.mvc.pathmatch.matching-strategy=ant_path_matcher ``` ### 替代方案(推荐) 对于Spring Boot 3.x项目建议迁移到springdoc: ```xml <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.1.0</version> </dependency> ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值