此内容没有您所选择的语言版本。

3.6. Troubleshooting


Check the status of a deployed bundle

After deploying an OSGi bundle, you can check its status using the osgi:list console command. For example:
JBossFuse:karaf@root> osgi:list
The most recently deployed bundles appear at the bottom of the listing. For example, a successfully deployed cxf-basic bundle has a status line like the following:
[ 232] [Active     ] [            ] [Started] [   60]
    Apache ServiceMix :: CXF Code First OSGi Bundle (1.0.0.SNAPSHOT)
The second column indicates the status of the OSGi bundle lifecycle (usually Installed, Resolved, or Active). A bundle that is successfully installed and started has the status Active. If the bundle contains a blueprint XML file, the third column indicates whether the blueprint context has been successfully Created or not. If the bundle contains a Spring XML file, the fourth column indicates whether the Spring context has been successfully Started or not.

Logging

If a bundle fails to start up properly, an error message is usually sent to the log. To view the most recent messages from the log, enter the log:display console command. Usually, you will be able to find a stack trace for the failed bundle in the log.
You can easily change the logging level using the log:set console command. For example:
JBossFuse:karaf@root> log:set DEBUG

Redeploying bundles with dev:watch

If there is an error in one of your bundles and you need to redeploy it, the best approach is to use the dev:watch command. For example, given that you have already deployed the cxf-basic bundle and it has the bundle ID, 232, you can tell the runtime to watch the bundle by entering the following console command:
JBossFuse:karaf@root> dev:watch 232
Watched URLs/IDs: 
232
Now, whenever you rebuild the bundle using Maven:
cd cxf-basic
mvn clean install
The runtime automatically redeploys the bundle, as soon as it notices that the corresponding JAR in the local Maven repository has been updated. In the console window, the following message appears:
[Watch] Updating watched bundle: cxf-basic (1.0.0.SNAPSHOT)
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.