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 4892E11B63 for ; Wed, 20 Aug 2014 08:40:07 +0000 (UTC) Received: (qmail 34031 invoked by uid 500); 20 Aug 2014 08:39:54 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 33967 invoked by uid 500); 20 Aug 2014 08:39:54 -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 33956 invoked by uid 99); 20 Aug 2014 08:39:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 08:39:53 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of renatoathaydes@hotmail.com designates 65.55.111.154 as permitted sender) Received: from [65.55.111.154] (HELO BLU004-OMC4S15.hotmail.com) (65.55.111.154) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 08:39:28 +0000 Received: from BLU179-W16 ([65.55.111.137]) by BLU004-OMC4S15.hotmail.com with Microsoft SMTPSVC(7.5.7601.22712); Wed, 20 Aug 2014 01:39:27 -0700 X-TMN: [oZsrPYd1LI0F2mfjPqU9CWi9wvCrW7F7] X-Originating-Email: [renatoathaydes@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_40786f57-793d-4457-a54a-4a8a6ab29c89_" From: Paulo Renato de Athaydes To: "users@felix.apache.org" Subject: RE: [iPOJO] Modifying a metadata.xml property directly in the JAR Date: Wed, 20 Aug 2014 18:39:26 +1000 Importance: Normal In-Reply-To: <53F45BDA.9090503@cea.fr> References: <53F307B3.5050909@cea.fr> ,<53F45BDA.9090503@cea.fr> MIME-Version: 1.0 X-OriginalArrivalTime: 20 Aug 2014 08:39:27.0112 (UTC) FILETIME=[406AE080:01CFBC52] X-Virus-Checked: Checked by ClamAV on apache.org --_40786f57-793d-4457-a54a-4a8a6ab29c89_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Guys=2C this is beyond awesome. I've been using Guice and Spring DM at work and I just can't believe how su= perior IPojo is! And people are sucking for Guice for some reason. Keep up the good work on IPojo! By the way=2C has anyone been able to test= the Gradle plugin I've created for IPojo? I've tested it myself with a few= test projects and it seems to work great=2C but it would be great to know = if there's anything missing from it (or something broken). It's on JCenter if anyone wants to try it (work on version 1.1 is about to = start)... Documentation on GitHub: https://github.com/renatoathaydes/osgi-r= un/tree/master/ipojo-plugin Renato > Date: Wed=2C 20 Aug 2014 10:27:06 +0200 > From: remi.druilhe@cea.fr > To: users@felix.apache.org > Subject: Re: [iPOJO] Modifying a metadata.xml property directly in the JA= R >=20 > Thanks for the answers. >=20 > After you told me how to solve my problem=2C I found an old article of yo= u describing how to use the configuration admin service with cfg files : > http://ipojo-dark-side.blogspot.fr/2009/04/ipojo-and-file-install-configu= ring.html >=20 > So I installed config-admin and file-install bundles (felix bundles) but = it did not work at first. In fact=2C I had to rename my component from tcp-= handler to tcphandler (with no - in the name) and create the cfg file as yo= u said. >=20 > Now everything work :-) >=20 > Regards. >=20 > Le 19/08/2014 15:49=2C Clement Escoffier a =E9crit : > > Hi=2C > > > > Yes=2C changing the metadata.xml file won=92t work as it is not read at= runtime. What you can do is to externalized the instance declaration in a = =91cfg=92 file (if your runtime support this format). cfg files are general= ly use to push configurations to the configuration admin. > > > > In your case it would be something like : tcp-handler-instance.cfg=2C w= ith the following content: > > serverIP=3D=85=85 > > serverPort=3D8080 > > > > Changing the cfg file reconfigure the instance. > > > > Regards=2C > > > > Clement > > > > On 19 ao=FBt 2014 at 14:53:32=2C Paulo Renato de Athaydes (renatoathayd= es@hotmail.com) wrote: > > > > I believe the metadata.xml file is not actually used after you compile.= .. have a look at the jar's manifest instead=2C IPojo saves all the informa= tion it needs in the manifest after compilation=2C so if you change it ther= e it should work. > > However=2C it seems to me you need to find a better way to configure th= is kind of thing... Maybe others can help here? > > Renato > > > >> Date: Tue=2C 19 Aug 2014 10:15:47 +0200 > >> From:remi.druilhe@cea.fr =20 > >> To:users@felix.apache.org =20 > >> Subject: [iPOJO] Modifying a metadata.xml property directly in the JAR > >> =20 > >> Hello=2C > >> =20 > >> I just created a TCP client to communicate with a server using iPOJO. > >> For now=2C I used the property fields into the component "instance" to > >> configure the IP address of my server. Something like that : > >> =20 > >> > >> > >> > >> > >> =20 > >> My purpose is to easily modify this configuration when I move my serve= r > >> on another device without asking the user to set the IP address > >> everytime the client is started. And i'd like not to use a config file > >> because I assume that the metadata.xml is already some kind of a confi= g > >> file. > >> =20 > >> So=2C I though that using "instance" enables me to modify the metadata= .xml > >> file into the JAR file and update this JAR with the new value. In fact= =2C > >> Ubuntu asks if I want to update the archive after modifying a file and= I > >> say yes. I can see the change when I reopen the archive. > >> =20 > >> However=2C it seems that when my client is launched in Felix=2C it alw= ays > >> uses the old IP address despite changes I made in the JAR file. > >> =20 > >> What's wrong with my way of configuring my component ? Is it possible = to > >> modify a file into a JAR file ? Is the value of my property is > >> definitively set into the component "instance" in the metadata.xml (li= ke > >> a static field) ? > >> =20 > >> Thanks=2C > >> =20 > >> Regards. > >> =20 > >> -- > >> R=E9mi Druilhe > >> =20 >=20 > --=20 > R=E9mi Druilhe > Ing=E9nieur de recherche > DACLE/LIALP > Institut Carnot > Laboratoire d=92=E9lectronique et de technologie de l=92information > Commissariat =E0 l=92=E9nergie atomique et aux =E9nergies alternatives > MINATEC Campus | 17 rue des Martyrs | 38054 Grenoble Cedex 9 > T. +33 (0)4 38 78 06 45 | F. +33 (0)4 38 78 90 73 > www.leti.fr >=20 = --_40786f57-793d-4457-a54a-4a8a6ab29c89_--