felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Third party libs/jar in Felix
Date Wed, 25 Oct 2006 08:35:32 GMT
Good. Let us know if you have any other questions.

-> richard

Ivo K. Koga wrote:
> Hi Richard,
>
> I did what you said and it worked.
>
> I put the javax.swing in the org.osgi.framework.system.packages and 
> accessed
> it from my bundle importing the javax.swing.
>
> I used that lib from the Java, but I think is the same for other libs.
>
> I´ll continue doing this for the other libs.
>
> My application sometimes has to have access to the packages and sometimes
> not. It was very good to mention that because now I know how to take the
> direction into my implementation: making a bundle with the lib and 
> exporting
> all the packages or accessing that directly from the classpath 
> exporting and
> importing the package to use inside my bundle.
>
> Thanks.
>
> Regards,
>
> Ivo K. Koga
>
>
> On 10/24/06, Richard S. Hall <heavy@ungoverned.org> wrote:
>>
>> Ivo Koga wrote:
>> > I was already registered to the felix-dev mailing list and I tried to
>> > send the e-mail to the list. Did u receive the message? I am copying
>> > this to the mailing list, hope it arrives there.
>>
>> It looks like the original message was delayed.
>>
>> > Following your consideration number 3. I looked into the
>> > conf/config.properties file and I saw this:
>> >
>> > org.osgi.framework.system.packages=org.osgi.framework; 
>> version=1.3.0, \
>> >  org.osgi.service.packageadmin ; version=1.2.0, \
>> >  org.osgi.service.startlevel; version=1.0.0, \
>> >  org.osgi.service.url; version=1.0.0, \
>> >  ${jre-${java.specification.version}}
>> >
>> > So I have to put my lib jar file into that or all the packages that I
>> > need to import?
>> > How I can do this?
>>
>> You have to put your libs onto the class path (e.g., java -classpath
>> mylib.jar ...). On the property above, you just put the packages that
>> you are exporting from the class path.
>>
>> I assume you want to do it this way because you are embedding Felix into
>> another application and your host application needs to access the libs
>> too. If so, then this makes sense. However, if your host application
>> does not need to access these libraries,  then it is better if you can
>> put these libraries in bundles and export the packages. Then you can
>> control the libraries' entire life cycle dynamically through the
>> framework.
>>
>> -> richard
>>
>> >
>> > Regards,
>> >
>> > Ivo K. Koga
>> >
>> >
>> >
>> > On 10/23/06, *Richard S. Hall* <heavy@ungoverned.org
>> > <mailto:heavy@ungoverned.org>> wrote:
>> >
>> >     You have three options:
>> >
>> >        1. Embed the JAR files into each bundle that needs them (this
>> >     works
>> >           if there is no sharing).
>> >        2. Create separate bundles for each JAR file and have them
>> >     export all
>> >           of their packages (this allows bundles to share the 
>> packages).
>> >        3. Put the JAR files on the class path and export them from the
>> >           system bundle. The way you do this is to edit the
>> >           'org.osgi.framework.system.packages' property in the
>> >           conf/config.properties files to export the packages you want
>> to
>> >           make visible, then your bundles can import those packages to
>> >     use them.
>> >
>> >     There is no way to reference external JAR files directly on a
>> bundle's
>> >     class path.
>> >
>> >     -> richard
>> >
>> >     Ivo Koga wrote:
>> >     > Hi Richard,
>> >     >
>> >     > No, I was trying to use that lib that is outside Felix. I have
>> many
>> >     > libs like that and I want to use it inside the bundle.
>> >     >
>> >     > That libs are for accessing databases (jdbc), reading xml 
>> (jdom),
>> >     > making a chart (jfreechart) and others.
>> >     >
>> >     > So, all these libs have to be inside my bundle jar?
>> >     >
>> >     > I´ll post that question to the list.
>> >     >
>> >     > Thanks again,
>> >     >
>> >     > Ivo K. Koga
>> >     >
>> >     > On 10/22/06, * Richard S. Hall* <heavy@ungoverned.org
>> >     <mailto:heavy@ungoverned.org>
>> >     > <mailto:heavy@ungoverned.org <mailto:heavy@ungoverned.org>>>
>> wrote:
>> >     >
>> >     >     It sounds like a packaging issue.
>> >     >
>> >     >     Does your bundle JAR file contain lib/jdom-1.0 /jdom.jar? If
>> not
>> >     >     you need to make sure you are including it inside the bundle
>> >     JAR file.
>> >     >
>> >     >     Also, perhaps I mentioned it before, but dynamically 
>> importing
>> *
>> >     >     is generally not a good idea.
>> >     >
>> >     >     Feel free to subscribe to the felix-dev mailing list and 
>> post
>> >     >     these types of questions since you might get other input and
>> >     other
>> >     >     people can learn from your questions too.
>> >     >
>> >     >     -> richard
>> >     >
>> >     >     -----Original Message-----
>> >     >
>> >     >     From:  "Ivo Koga" <ivo.koga@gmail.com
>> >     <mailto:ivo.koga@gmail.com> <mailto: ivo.koga@gmail.com
>> >     <mailto:ivo.koga@gmail.com>>>
>> >     >     Subj:  Third party libs/jar in Felix
>> >     >     Date:  Sun 22. Oct 2006 14:27
>> >     >     Size:  469 bytes
>> >     >     To:  "Richard S. Hall" < heavy@ungoverned.org
>> >     <mailto:heavy@ungoverned.org>
>> >     >     <mailto:heavy@ungoverned.org <mailto:heavy@ungoverned.org>>>
>> >     >
>> >     >     Hi Richard,
>> >     >
>> >     >     I was trying to use some libs that are outside the Felix,
>> >     but did
>> >     >     not have
>> >     >     success yet.
>> >     >
>> >     >     What I already did is to put in the manifest.mf file this:
>> >     >
>> >     >     Bundle-Classpath: .,lib/jdom-1.0/jdom.jar
>> >     >     DynamicImport-Package: *
>> >     >
>> >     >     But what I got is:
>> >     >
>> >     >     "INFO: Class path entry not found: lib/jdom-1.0/jdom.jar"
>> >     >
>> >     >     and a Exception:
>> >     >
>> >     >     "JarContent: java.util.zip.ZipException " saying that it
>> cannot
>> >     >     find the
>> >     >     specified path
>> >     >
>> >     >     hope you can help me again :-)
>> >     >
>> >     >     Regards,
>> >     >
>> >     >     Ivo K. Koga
>> >     >
>> >     >
>> >     >
>> >
>> >
>>
>

Mime
View raw message