Ce contenu n'est pas disponible dans la langue sélectionnée.

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]
    Fabric8 :: 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

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.