Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
2017-07-26 13:58
976 查看
SpringBoot出现下列错误。
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
或者
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
或者
ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b9e255: startup date [Wed Jul 26 13:37:27 CST 2017]; root of context hierarchy
主要是由于application.java文件没有放在main/java文件夹的原因,因为application.Java 文件不能直接放在main/java文件夹下,必须要建一个包把他放进去
SpringBoot在写启动类的时候如果不使用@ComponentScan指明对象扫描范围,默认指扫描当前启动类所在的包里的对象,如果当前启动类没有包,则在启动时会报错:
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package错误。
@ComponentScan(basePackageClasses=要扫描类.class所在位置的包)-意思是要扫描哪个类所在的包
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
或者
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
或者
ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b9e255: startup date [Wed Jul 26 13:37:27 CST 2017]; root of context hierarchy
主要是由于application.java文件没有放在main/java文件夹的原因,因为application.Java 文件不能直接放在main/java文件夹下,必须要建一个包把他放进去
SpringBoot在写启动类的时候如果不使用@ComponentScan指明对象扫描范围,默认指扫描当前启动类所在的包里的对象,如果当前启动类没有包,则在启动时会报错:
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package错误。
@SpringBootApplication @ComponentScan(basePackageClasses=MytestApplication.class) public class MytestApplication { public static void main(String[] args){ SpringApplication.run(MytestApplication.class, args); } }
@ComponentScan(basePackageClasses=要扫描类.class所在位置的包)-意思是要扫描哪个类所在的包
相关文章推荐
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- 解决错误:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- Java问题解决:springboot启动出现-Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- springBoot启动错误 Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- spring boot 报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default p
- Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- Springboot启动报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- springboot的启动Your ApplicationContext is unlikely to start due to a @ComponentScan of the default pac
- spring boot 报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- springboot警告:ApplicationContext is unlikely to start due to a @ComponentScan of the default package
- spring boot 报错:Your ApplicationContext is unlikely to start due to a @ComponentScan of the default p
- Your ApplicationContext is unlikely to start due to
- The call to LoadLibrary(YourExtensionName) failed, Win32 error 0n14001, “This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.”
- http://url is already routed to the Default zone of another application. Remove that mapping or use a different URL
- ASP.NET4.0错误:Operation is not valid due to the current state of the object