Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 549FE976F for ; Tue, 20 Mar 2012 10:34:37 +0000 (UTC) Received: (qmail 39683 invoked by uid 500); 20 Mar 2012 10:34:36 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 39627 invoked by uid 500); 20 Mar 2012 10:34:36 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 39619 invoked by uid 99); 20 Mar 2012 10:34:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 10:34:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fairouz.fakhfakh@gmail.com designates 209.85.212.181 as permitted sender) Received: from [209.85.212.181] (HELO mail-wi0-f181.google.com) (209.85.212.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 10:34:30 +0000 Received: by wibhr17 with SMTP id hr17so4423148wib.10 for ; Tue, 20 Mar 2012 03:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=C9ShaKjrpaEGUyRinbRvIzuHEPBJJO1orvKmJzYqJb0=; b=YXopN7VrNRox8qVhXVQs7/DvZHaswGD2XWlsRO2/q4k+OS6pobOgiUZ9Uwol/MLjxK jIOL99Jx5g9v8dzHNqC/emd6uMtvOqbVdORl6+UT2KsHfIKrn2N+TQqCmnzgv1ldUJgt 2+HVhseOBR64SeGxaRnsyzK/MOe1irbhUIWwa4CiXHusYEBD5qfajnk/BrfS+I7JAwkz oyK6IVyha4xTh3rFL3PemXQji8ftyxid6v5angcrtwRzNndv6D93UqC+6QOmU2XyIflw QuGhIUJY/LaMUlC4fmZjIZqKCPsTzln6PJADnUQHZt/UDCLN2BBrG+K7PaAElsWteS9d Wjmw== MIME-Version: 1.0 Received: by 10.180.91.10 with SMTP id ca10mr27510756wib.17.1332239649820; Tue, 20 Mar 2012 03:34:09 -0700 (PDT) Received: by 10.216.73.73 with HTTP; Tue, 20 Mar 2012 03:34:09 -0700 (PDT) Date: Tue, 20 Mar 2012 11:34:09 +0100 Message-ID: Subject: create instance iPOJO From: Fairouz Fakhfakh To: users@felix.apache.org Content-Type: multipart/alternative; boundary=f46d043c093e1550af04bbaa37b6 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c093e1550af04bbaa37b6 Content-Type: text/plain; charset=ISO-8859-1 Hello, I would like to create a dynamic instance with iPOJO. I tried to follow this link: http://www.scribd.com/doc/64361631/130/Instantiating-components-with-iPOJO page 406 I try to write this method "create": private Factory helloFactory; private Map instances =new HashMap(); *public void create(String name) * { Hashtable props = new Hashtable(); props.put("kind", name); ComponentInstance instance = null; try { instance = helloFactory.createComponentInstance(props); } catch (UnacceptableConfiguration e) { e.printStackTrace(); } catch (MissingHandlerException e) { e.printStackTrace(); } catch (org.apache.felix.ipojo.ConfigurationException e) { e.printStackTrace(); } instances.put(name, instance); } But it generates this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at trmcs.alarm.HelpSe rviceAlarmImpl.__create(HelpServiceAlarmImpl.java:107) in the line:* **instance = helloFactory.createComponentInstance(props);* So, I understand that helloFactory is null. But, I dont' know why can I correct that to create an instance of a component? Thank for answering me. Best regards, -- Fairouz Fakhfakh Master Student National School of Engineers of SFAX Research group ReDCAD http://WWW.redcad.org --f46d043c093e1550af04bbaa37b6--