Este conteúdo não está disponível no idioma selecionado.

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

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.