Error classnotfound in springboot startup Exception:EnhancerBySpringCGLIB
Error information solution
Error information
Spring boot 2.4.1 project, start to report the following error, but start will be normal, although it does not affect the use, but look very boring.
java.lang.ClassNotFoundException: cn.demo.Application$$EnhancerBySpringCGLIB$$310af73e
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at cn.demo.ocean.common.prop.core.spring.SpringConfigPropertiesHandle.handleSpringConfig(SpringConfigPropertiesHandle.java:47)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.doProcessProperties(ConfigServerPostProcessor.java:305)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.processProperties(ConfigServerPostProcessor.java:122)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.postProcessBeanFactory(ConfigServerPostProcessor.java:102)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:299)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:170)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
at cn.demo.Application.main(Application.java:19)
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.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
java.lang.ClassNotFoundException: cn.demo.config.Swagger2Config$$EnhancerBySpringCGLIB$$589bf224
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at cn.demo.ocean.common.prop.core.spring.SpringConfigPropertiesHandle.handleSpringConfig(SpringConfigPropertiesHandle.java:47)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.doProcessProperties(ConfigServerPostProcessor.java:305)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.processProperties(ConfigServerPostProcessor.java:122)
at cn.demo.ocean.common.prop.core.spring.ConfigServerPostProcessor.postProcessBeanFactory(ConfigServerPostProcessor.java:102)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:299)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:170)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
at cn.demo.Application.main(Application.java:19)
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.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
solve
Baidu has failed for many times, so we can only read the error report carefully. Last line found:
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Doubt is the problem of devtools, and then pom.xml Devtools dependency removal in
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
It’s solved (⊙ o ⊙)
Read More:
- Springboot project startup exception – required a single bean, but 2 were found
- Springboot startup exception: error creating bean with name ‘permissioncontroller’
- Springboot plus cross domain annotation @crossorigin startup error
- Springboot startup error: java.lang.IllegalArgumentException : Property ‘sqlSessionFactory’ or ‘sqlSessionTempla
- Springboot startup error [extshutdown hook]
- How to handle exception in springboot
- Springboot startup error could not resolve placeholder XXX
- Exception handling of httpmessage notwritableexception in springboot
- Springboot modifies the reference of the application.yml or. Properties file to report an error after startup
- Springboot startup error failed to configure a datasource
- Springboot startup error: error starting ApplicationContext
- How to Fix error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarE
- [Solved] Mac ES Startup Error: Exception in thread “main“ java.nio.file.NotDirectoryException
- Failed to instantiate org.mybatis.spring.SqlSessionTemplate Constructor threw exception
- Depending on the custom component jar package, unable to read meta data for class appears after startup
- The @ Autowired annotation in springboot is invalid in ordinary classes. How to solve and use the null pointer exception java.lang.nullpointerexception
- Mongodb — startup exception, error report ERROR:NUMBER 100
- Successful solution of eclipse startup error Error:Could not create the Java Virtual Machine Error:A fatal exception has occurred
- Springboot framework Maven build fastjson start error
- Error creating bean with name usercontroller appears when springboot starts