代码拉取完成,页面将自动刷新
使用样例工程:
https://gitee.com/bryan31/liteflow-example
将SpringBoot版本号换为1.5.6后,SpringBoot直接启动失败。
错误信息如下:
Connected to the target VM, address: '127.0.0.1:21160', transport: 'socket'
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.6.RELEASE)
2021-05-11 10:42:05.294 INFO 6020 --- [ main] com.shtel.flow.IotMainApp : Starting IotMainApp on DESKTOP-HJK1IBI with PID 6020 (D:\IdeaProject\MMCS-SpringSesion-API\liteflow-demo\target\classes started by Shmily in D:\IdeaProject\MMCS-SpringSesion-API)
2021-05-11 10:42:05.302 INFO 6020 --- [ main] com.shtel.flow.IotMainApp : No active profile set, falling back to default profiles: default
2021-05-11 10:42:05.581 INFO 6020 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@50dfbc58: startup date [Tue May 11 10:42:05 CST 2021]; root of context hierarchy
2021-05-11 10:42:12.194 INFO 6020 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.yomahub.liteflow.springboot.LiteflowComponentScannerAutoConfiguration' of type [com.yomahub.liteflow.springboot.LiteflowComponentScannerAutoConfiguration$$EnhancerBySpringCGLIB$$8acbef96] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-05-11 10:42:41.482 INFO 6020 --- [ main] com.yomahub.liteflow.util.LOGOPrinter :
================================================================================================
_ ___ _____ _____ _____ _ _____ __
| | |_ _|_ _| ____| | ___| | / _ \ \ / /
| | | | | | | _| _____| |_ | | | | | \ \ /\ / /
| |___ | | | | | |__|_____| _| | |__| |_| |\ V V /
|_____|___| |_| |_____| |_| |_____\___/ \_/\_/
做最轻量级,最实用的微流程框架
To be the most lightweight and the most practical micro-process framework
================================================================================================
2021-05-11 10:42:41.504 WARN 6020 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.AbstractMethodError
2021-05-11 10:42:41.533 INFO 6020 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2021-05-11 10:42:41.564 ERROR 6020 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.AbstractMethodError
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at com.shtel.flow.IotMainApp.main(IotMainApp.java:12) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:479) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:199) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.6.RELEASE.jar:1.5.6.RELEASE]
... 8 common frames omitted
Caused by: java.lang.AbstractMethodError: null
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1037) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:1011) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:473) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
... 15 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:21160', transport: 'socket'
Process finished with exit code 1
使用SpringBoot 1.5.x的使用方法如下:
1)配置文件移除组件扫描自动配置
spring:
autoconfigure:
exclude: com.yomahub.liteflow.springboot.LiteflowComponentScannerAutoConfiguration
2)增加自定义组件扫描器
import com.yomahub.liteflow.spring.ComponentScanner;
import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
import java.beans.PropertyDescriptor;
public class LiteFlowComponentScanner extends ComponentScanner {
@Override
public Object postProcessBeforeInstantiation(Class<?> aClass, String s) throws BeansException {
return null;
}
@Override
public boolean postProcessAfterInstantiation(Object o, String s) throws BeansException {
return true;
}
@Override
public PropertyValues postProcessPropertyValues(PropertyValues propertyValues, PropertyDescriptor[] propertyDescriptors, Object o, String s) throws BeansException {
return propertyValues;
}
}
3)启用自定义组件扫描器
@Configuration
public class LiteFlowConfig {
@Bean("componentScanner")
public LiteFlowComponentScanner componentScaner() {
return new LiteFlowComponentScanner();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论