【发布时间】:2015-06-24 12:02:44
【问题描述】:
在 Spring-boot 远程 shell CRaSH 中,我可以将所有 Spring bean 以 JSON 格式转储到屏幕上:
> beans
[{context=application, parent=null, beans=[{bean=repositoryServer, scope=singleton,
type=com.opentext.tlsPolicyRepository.RepositoryServer$$EnhancerBySpringCGLIB$$841a12c7,
resource=null, dependencies=[]}, {bean=tlsPolicyRepositoryController,
scope=singleton, type=com.opentext.tlsPolicyRepository.TlsPolicyRepositoryController,
resource=file
...等
但我找不到过滤该输出的方法:
beans | filter -p bean:repositoryServer
我从内部“man”页看到beans 命令生成Object,而filter 消耗Map,所以失败是有道理的。
如何从 CRaSH shell 获取有关单个 bean 的信息?
【问题讨论】:
标签: java spring-boot crash-shell