腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
Spring
-
无法
执行
CommandLineRunner
:@
Bean
、
、
、
o.s.boot.SpringApplication : Application run failed SpringApplication.run(Application.class, args); @
Bean
CommandLineRunner
init(UserRepos
浏览 29
提问于2019-06-13
得票数 1
回答已采纳
1
回答
用
Spring
发送Gmail
、
、
、
我正在创建一个向
spring
发送电子邮件的示例。该
bean
被声明为Java而不是xml。@Configuration@
Bean
浏览 45
提问于2018-09-20
得票数 -1
1
回答
如何在我的应用程序中运行特定的SpringBoot
CommandLineRunner
运行程序?
、
我遵循为我的SpringBoot应用程序创建
CommandLineRunner
。我不明白的是,如何在ma应用程序中运行这个特定的命令?
浏览 2
提问于2015-09-24
得票数 0
回答已采纳
1
回答
Spring
@Autowire没有XML或YAML
、
、
、
我试图在没有XML/YAML文件的情况下使用
Spring
运行Hazelcast客户端应用程序,但我
无法
找到通过
Spring
管理Hazelcast实例的方法。@Configuration private Environment env; retu
浏览 7
提问于2022-01-17
得票数 1
回答已采纳
2
回答
在
Spring
Boot启动时
执行
MongoDB脚本
、
我需要用一些脚本文件初始化一个Mongo DB,比如
Spring
对JPA和import.sql文件所做的操作。但是怎么做呢? 有人能帮我吗?
浏览 9
提问于2017-01-27
得票数 3
1
回答
如何在Springboot平台的主类中触发不同的类?
、
我使用
Spring
套件作为我的IDE。
浏览 1
提问于2020-07-03
得票数 1
回答已采纳
1
回答
Spring
Boot属性从主函数注入到Runnable
、
、
我有一个程序需要开始
执行
四个不同的Runnable类。这些Runnable类具有我希望它们从application.properties获取的配置。threadPoolTaskExecutor.initialize(); } } } application.properties value=&
浏览 71
提问于2020-10-25
得票数 1
2
回答
SpringBoot:如果不存在,则在启动时在mongodb中创建文档
、
、
、
、
我在SpringBoot和Mongodb上有一个小服务作为DB。我需要能够创建一个文件(非常基本的: id,名称,状态)启动一个小集合。如果不存在类似sql create table,但用于mongo。我该怎么做呢?我尝试初始化文档属性中的值,但没有帮助。目前,只有当我使用API添加集合和文档时,它才会出现。
浏览 89
提问于2021-11-19
得票数 0
回答已采纳
4
回答
什么时候以及为什么我们需要ApplicationRunner和Runner接口?
、
、
我正在学习
Spring
boot。ApplicationRunner或任何运行器接口的一些典型用例是什么?
浏览 7
提问于2019-12-14
得票数 19
回答已采纳
17
回答
在
Spring
Boot启动后运行代码
、
、
我想要在我的
spring
-boot应用程序开始监视目录的变化之后运行代码。 我尝试运行一个新线程,但@Autowired服务尚未设置。在
spring
-boot中运行应用程序后,有没有更好的事件可以使用,或者有更好的方式运行代码
浏览 46
提问于2014-12-11
得票数 297
回答已采纳
2
回答
当ddl设置为在
Spring
中创建时运行
CommandLineRunner
Bean
、
、
、
、
我的主课堂上有这个
CommandLineRunner
(ReservationprojectApplication)
CommandLineRunner
run(UserService
spring
: datasource: url: jdbc:postgresql://localhost
浏览 3
提问于2022-11-03
得票数 0
回答已采纳
1
回答
什么时候用@
Bean
注释的方法在
Spring
中被
执行
?
、
、
main(String[] args) { } return builder.build(); @
Bean
public
CommandLineRunner
run(RestTemplate restTemplate) throw
浏览 5
提问于2022-08-15
得票数 0
回答已采纳
2
回答
排序
CommandLineRunner
执行
、
、
我有四个
CommandLineRunner
要按照特定的顺序
执行
。其中两个被注释为@Component,另两个被声明为
Bean
。upRunner"); @Order(1) return声明为@
Bean
的运行程序按照它们在App类中定义的顺序
执行
,而不考虑@Order注释。 有什么我错过的东西来
执行</em
浏览 1
提问于2020-12-05
得票数 2
2
回答
如何从main方法调用组件的方法?
我是springboot的新手。 我创建了一个组件: @Component static File out = new File(Constante.ARTICLE_CSV + "out_article.csv"); Thread th = ne
浏览 28
提问于2019-01-16
得票数 3
回答已采纳
2
回答
如果没有@PostConsrtuct/init/@EventListener,如何在
Spring
中启动时运行一次方法?
、
我有一个
Spring
应用程序,它需要在启动时将文件从资源文件夹加载到外部ftp存储。所以应用程序启动时,->文件被上传,->application启动成功,负责上传的->
bean
被破坏。问题是,我不想使用像@PostConsrtuct/init这样的东西来做一些
bean
,并且在我的上下文中有空闲的
bean
,它在启动时完成了他的工作。我不想使用@EventListener来监听刷新上下文并运行逻辑,因为这个侦听器会在每次上下文刷新时
执行
此操作,即使在启动之后也是如此。我的应用程
浏览 50
提问于2021-08-13
得票数 0
回答已采纳
1
回答
当beaninstantiationexception发生时退出
Spring
引导服务
、
、
、
我正在启动一个
spring
引导应用程序,如下所示@ComponentScan(basePackages = "com.brocade")public class Application implements
CommandLineRunner
{ new SpringApplication(Application.
浏览 0
提问于2018-03-28
得票数 0
1
回答
Spring
Batch总是以
Spring
Boot开始:
spring
.batch.job.enabled=false不工作
、
、
我有一个名为MyApplication的
Spring
Boot应用程序。我还有一个名为JobStartupRunner的
Spring
Batch Application。下面是
Spring
Batch应用程序:...@SpringBootApplication @Autowired下面是
Spring
Batch Config类:...如何防止
Spring
B
浏览 79
提问于2019-12-18
得票数 0
回答已采纳
1
回答
如何使用InMemoryUserDetailsManager post自动配置?
、
、
在我的基于
Spring
Boot的应用程序中-为了简单起见-我依赖于
Spring
Web Security通过UserDetailsServiceAutoConfiguration自动配置InMemoryUserDetailsManager为此,我刚刚通过属性(.yml)设置了一个用户,如下所示: name: whatever roles: USER@A
浏览 0
提问于2019-08-28
得票数 0
2
回答
spring
方法:如何获得方法名称?
、
、
、
、
让我们假设我有一个用@
Bean
注释
spring
的java方法。getEnclosingMethod().getName(); } r
浏览 5
提问于2020-12-27
得票数 0
回答已采纳
1
回答
显式运行带弹簧引导的天桥迁移
、
我有一个基于
spring
引导的应用程序,我想在这个应用程序上运行天桥迁移。该应用程序只需要在特定情况下运行天桥迁移。例如,如果将“迁移”参数传递给Main()。public class ExampleMain implements
CommandLineRunner
{ .load();} 在这种情况下,Flyway.migra
浏览 3
提问于2022-02-15
得票数 1
回答已采纳
点击加载更多
相关
资讯
Spring多种启动初始化方案,看这篇就够了
Spring@Bean注解
SpringBoot 启动时初始化数据
Spring中Bean的几种配置
Spring创建bean的几种方式
热门
标签
更多标签
云服务器
ICP备案
对象存储
即时通信 IM
云直播
活动推荐
运营活动
广告
关闭
领券