IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

OGSi Java Discussion :

{Débutant OSGI} Message d'erreur


Sujet :

OGSi Java

  1. #1
    Membre confirmé
    Avatar de geforce
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2010
    Messages
    1 055
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2010
    Messages : 1 055
    Points : 559
    Points
    559
    Par défaut {Débutant OSGI} Message d'erreur
    Bonjour
    Les messages d'erreur qu’affiche-la console sur Eclipse; je ne suis pas familier avec OSGI equinox et je n'arrive pas à comprendre d'où vines le problème !!

    Voilà une capture de ce que j'ai fait (avec le fichier MANIFEST qu’utiliser pour l’exécution)
    Nom : issus.PNG
Affichages : 516
Taille : 173,3 Ko

    Aussi le message d'erreur
    !SESSION 2015-12-30 21:01:38.116 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.8.0_45
    java.vendor=Oracle Corporation
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_CA
    Command-line arguments: -dev file:C:/Users/ak29580/Desktop/Lab1/OSGI/.metadata/.plugins/org.eclipse.pde.core/my composed service/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

    !ENTRY ca.ets.osgi.priceservice 4 0 2015-12-30 21:01:38.756
    !MESSAGE FrameworkEvent ERROR
    !STACK 0
    org.osgi.framework.BundleException: Exception in ca.ets.osgi.priceservice.Activator.start() of bundle ca.ets.osgi.priceservice.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)
    at org.eclipse.osgi.container.Module.start(Module.java:439)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
    Caused by: java.lang.NullPointerException
    at ca.ets.osgi.priceservice.Activator.start(Activator.java:22)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
    ... 12 more
    Root exception:
    java.lang.NullPointerException
    at ca.ets.osgi.priceservice.Activator.start(Activator.java:22)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)
    at org.eclipse.osgi.container.Module.start(Module.java:439)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

    !ENTRY ca.ets.osgicomposedservice 4 0 2015-12-30 21:01:38.756
    !MESSAGE FrameworkEvent ERROR
    !STACK 0
    org.osgi.framework.BundleException: Exception in ca.ets.osgicomposedservice.Activator.start() of bundle ca.ets.osgicomposedservice.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:792)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)
    at org.eclipse.osgi.container.Module.start(Module.java:439)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
    Caused by: java.lang.NullPointerException: A null service reference is not allowed.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:617)
    at ca.ets.osgicomposedservice.Activator.start(Activator.java:30)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
    ... 12 more
    Root exception:
    java.lang.NullPointerException: A null service reference is not allowed.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:617)
    at ca.ets.osgicomposedservice.Activator.start(Activator.java:30)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)
    at org.eclipse.osgi.container.Module.start(Module.java:439)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

    !ENTRY org.eclipse.osgi 4 0 2015-12-30 21:01:39.037
    !MESSAGE Bundle ca.ets.osgicomposedservice_1.0.0.qualifier [10] is not active.

    !ENTRY org.eclipse.osgi 4 0 2015-12-30 21:01:39.037
    !MESSAGE Bundle ca.ets.osgi.priceservice_1.0.0.qualifier [3] is not active.

    !ENTRY org.eclipse.osgi 4 0 2015-12-30 21:01:39.037
    !MESSAGE Could not find bundle: org.eclipse.equinox.console
    !STACK 0
    org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
    at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
    La classe Activator dans ca.ets.osgi.priceservice
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
     
    import org.osgi.framework.BundleActivator;
    import org.osgi.framework.BundleContext;
    //import ca.ets.osgi.price.IPriceService;
    import org.osgi.framework.BundleContext;
     
    public class Activator implements BundleActivator {
     
    	private static BundleContext context;
     
    	static BundleContext getContext() {
    		return context;
    	}
     
    	/*
    	 * (non-Javadoc)
    	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
    	 */
    	public void start(BundleContext bundleContext) throws Exception {
    		PriceService service = new PriceService();
    		context.registerService(ca.ets.osgi.priceinterface.IPriceService.class.getName(), service, null);
    		System.out.println("IPriceService is registered");;
    	}
     
    	/*
    	 * (non-Javadoc)
    	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
    	 */
    	public void stop(BundleContext bundleContext) throws Exception {
    		//Activator.context = null;
    	}
     
    }
    Merci de votre aides !

  2. #2
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Salut,

    L'erreur n'a rien à voir avec OSGI : tu invoques une méthode sur la variable context non initialisée.

  3. #3
    Membre confirmé
    Avatar de geforce
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2010
    Messages
    1 055
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2010
    Messages : 1 055
    Points : 559
    Points
    559
    Par défaut
    Citation Envoyé par joel.drigo Voir le message
    Salut,

    L'erreur n'a rien à voir avec OSGI : tu invoques une méthode sur la variable context non initialisée.
    Peu tu donnes plus d'explication? de variable context non initialisée tu parle? Moi j'ai jute faie un Run avec Eclipse ! que fait cela exactement

    Merci!

  4. #4
    Modérateur
    Avatar de joel.drigo
    Homme Profil pro
    Ingénieur R&D - Développeur Java
    Inscrit en
    Septembre 2009
    Messages
    12 430
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur R&D - Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2009
    Messages : 12 430
    Points : 29 131
    Points
    29 131
    Billets dans le blog
    2
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    public class Activator implements BundleActivator {
     
    	private static BundleContext context; // déclaration sans initialisation, donc context vaut null
     
    	static BundleContext getContext() {
    		return context;
    	}
     
    	/*
    	 * (non-Javadoc)
    	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
    	 */
    	public void start(BundleContext bundleContext) throws Exception { // cette méthode est invoquée pour démarrer le bundle (plug-in)...tout le reste plante parce que le démarrage plante sur une NullPointerException (sur context)
    		PriceService service = new PriceService();
    		context.registerService(ca.ets.osgi.priceinterface.IPriceService.class.getName(), service, null);  // invocation de la méthode registerService sur la variable context, jamais initialisée !!!
    		System.out.println("IPriceService is registered");;
    	}
     
    	/*
    	 * (non-Javadoc)
    	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
    	 */
    	public void stop(BundleContext bundleContext) throws Exception {
    		//Activator.context = null;
    	}
     
    }
    Ajoute context=bundleContext avant la ligne qui plante !

Discussions similaires

  1. [débutant] message d erreur
    Par yrlac dans le forum Langage
    Réponses: 3
    Dernier message: 08/10/2007, 16h28
  2. [Débutant]Message d'erreur et page web
    Par @yoyo dans le forum ASP.NET
    Réponses: 11
    Dernier message: 20/02/2007, 14h32
  3. Réponses: 18
    Dernier message: 07/02/2007, 14h33
  4. [Axis][Débutant] Message d'erreur dans la demande de réponse.
    Par angearael dans le forum Services Web
    Réponses: 16
    Dernier message: 22/11/2006, 17h26
  5. [Débutant] Message d'erreur que je ne comprends pas
    Par Le Furet dans le forum Langage
    Réponses: 2
    Dernier message: 25/02/2006, 17h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo