[sip-comm] Add an external library


#1

Hi,

I would like to add external libraries on SC. I tried to do what I found in
the mail-list but I did not success. Could someone help me with this?

Thank you very much in advance.

Sorry about send this email wrong before, my email client became crazy.*

The thing is that you have to let felix know these libs exist before
your plugin can use them. There are three ways to do this:

1. You make the libs run as bundles in which case you have to declare

the packages they export in their manifest files and then modify
felix.client.run.properties to run them.
*I will try this now. I wanted to try it before send the whole
email.Sorry again.*

2. Add your libs to the classpath and add the packages you are going to

use to the org.osgi.framework.system.packages property in
felix.client.run.properties.

*I have added the external libraries to the project and in
eclipse->run->Classpath.
And I added the packages to org.osgi.framework.system.packages property in

felix.client.run.properties. But I got that error when running SC.
I did not change anything in build.xml. May I change something on it?

How can I import to bundle 1326?

**Caused by: java.lang.ClassNotFoundException:

*** Class 'gov.nasa.worldwind.layers.Layer' was not found because bundle
1326 does not import 'gov.nasa.worldwind.layers' even though bundle 0
does export it. Additionally, the class is also available from the system

class loader. There are two fixes: 1) Add an import for
'gov.nasa.worldwind.layers'
to bundle 1326; imports are necessary for each class directly touched by bundle
code or indirectly touched, such as super classes if their methods are used.

2) Add package 'gov.nasa.worldwind.layers' to the
'org.osgi.framework.bootdelegation'
property; a library or VM bug can cause classes to be loaded by the wrong
class loader. The first approach is preferable for preserving modularity. ****

3. Include their content inside your plugin jar. One way to do this is

using the zipfileset tag inside the jar task that creates your plugin
bundle.

*I tried to do it like is below. But I got the next error. With out
the libraries the examplepluginW is ok.
ERROR: Error starting reference:file:sc-bundles/examplepluginW.jar
(org.osgi.framework.BundleException:
Not found: net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator*

*<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
<target name="bundle-plugin-examplepluginW">
<!-- Creates a bundle for the plugin SIP Account Registration Wizard.-->
<jar compress="false" destfile="${bundles.dest}/examplepluginW.jar"

manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
   prefix="net/java/sip/communicator/plugin/examplepluginW"/>
<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
prefix=""/>
<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
prefix=""/>
<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
prefix=""/>
</jar>
</target>


#2

Hi,

The first option goes well
Thanks.

···

2008/11/7 Óscar Sánchez <oscarsancheziglesias@gmail.com>

Hi,

I would like to add external libraries on SC. I tried to do what I found in
the mail-list but I did not success. Could someone help me with this?

Thank you very much in advance.

Sorry about send this email wrong before, my email client became crazy.*

The thing is that you have to let felix know these libs exist before
your plugin can use them. There are three ways to do this:

1. You make the libs run as bundles in which case you have to declare

the packages they export in their manifest files and then modify
felix.client.run.properties to run them.
*I will try this now. I wanted to try it before send the whole email.Sorry again.*

2. Add your libs to the classpath and add the packages you are going to

use to the org.osgi.framework.system.packages property in
felix.client.run.properties.

*I have added the external libraries to the project and in eclipse->run->Classpath.
And I added the packages to org.osgi.framework.system.packages property in

felix.client.run.properties. But I got that error when running SC.
I did not change anything in build.xml. May I change something on it?

How can I import to bundle 1326?

**Caused by: java.lang.ClassNotFoundException:

*** Class 'gov.nasa.worldwind.layers.Layer' was not found because bundle
1326 does not import 'gov.nasa.worldwind.layers' even though bundle 0
does export it. Additionally, the class is also available from the system

class loader. There are two fixes: 1) Add an import for 'gov.nasa.worldwind.layers'
to bundle 1326; imports are necessary for each class directly touched by bundle
code or indirectly touched, such as super classes if their methods are used.

2) Add package 'gov.nasa.worldwind.layers' to the 'org.osgi.framework.bootdelegation'
property; a library or VM bug can cause classes to be loaded by the wrong
class loader. The first approach is preferable for preserving modularity. ****

3. Include their content inside your plugin jar. One way to do this is

using the zipfileset tag inside the jar task that creates your plugin
bundle.

*I tried to do it like is below. But I got the next error. With out the libraries the examplepluginW is ok.
ERROR: Error starting reference:file:sc-bundles/examplepluginW.jar
(org.osgi.framework.BundleException:
Not found: net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator*

*<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->

<target name="bundle-plugin-examplepluginW">
<!-- Creates a bundle for the plugin SIP Account Registration Wizard.-->
<jar compress="false" destfile="${bundles.dest}/examplepluginW.jar"

manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
   prefix="net/java/sip/communicator/plugin/examplepluginW"/>

<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar" prefix=""/>
<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar" prefix=""/>

<zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar" prefix=""/>
</jar>
</target>


#3

Cool! Glad you have it sorted out!

Cheers
Emil

Óscar Sánchez wrote:

···

Hi,

The first option goes well
Thanks.

2008/11/7 Óscar Sánchez <oscarsancheziglesias@gmail.com
<mailto:oscarsancheziglesias@gmail.com>>

    Hi,

    I would like to add external libraries on SC. I tried to do what I found in
    the mail-list but I did not success. Could someone help me with this?

    Thank you very much in advance.

    Sorry about send this email wrong before, my email client became crazy./

    The thing is that you have to let felix know these libs exist before

    your plugin can use them. There are three ways to do this:

    1. You make the libs run as bundles in which case you have to declare

    the packages they export in their manifest files and then modify
    felix.client.run.properties to run them.

    /I will try this now. I wanted to try it before send the whole email.Sorry again./

    2. Add your libs to the classpath and add the packages you are going to

    use to the org.osgi.framework.system.packages property in
    felix.client.run.properties.

    /I have added the external libraries to the project and in eclipse->run->Classpath.
    And I added the packages to org.osgi.framework.system.packages property in

    felix.client.run.properties. But I got that error when running SC.
    I did not change anything in build.xml. May I change something on it?

    How can I import to bundle 1326?

    //Caused by: java.lang.ClassNotFoundException:

     *** Class 'gov.nasa.worldwind.layers.Layer' was not found because bundle
    1326 does not import 'gov.nasa.worldwind.layers' even though bundle 0
    does export it. Additionally, the class is also available from the system

    class loader. There are two fixes: 1) Add an import for 'gov.nasa.worldwind.layers'
    to bundle 1326; imports are necessary for each class directly touched by bundle
    code or indirectly touched, such as super classes if their methods are used.

    2) Add package 'gov.nasa.worldwind.layers' to the 'org.osgi.framework.bootdelegation'
     property; a library or VM bug can cause classes to be loaded by the wrong
    class loader. The first approach is preferable for preserving modularity. ***/

    3. Include their content inside your plugin jar. One way to do this is

    using the zipfileset tag inside the jar task that creates your plugin
    bundle.

    /I tried to do it like is below. But I got the next error. With out the libraries the examplepluginW is ok.

    ERROR: Error starting reference:file:sc-bundles/examplepluginW.jar
    (org.osgi.framework.BundleException:

    Not found: net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/

    /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->

    <target name="bundle-plugin-examplepluginW">
    <!-- Creates a bundle for the plugin SIP Account Registration Wizard.-->
    <jar compress="false" destfile="${bundles.dest}/examplepluginW.jar"

    manifest="\{src\}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW\.manifest\.mf&quot;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;zipfileset dir=&quot;{dest}/net/java/sip/communicator/plugin/examplepluginW"
       prefix="net/java/sip/communicator/plugin/examplepluginW"/>

    <zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar" prefix=""/>
    <zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar" prefix=""/>

    <zipfileset src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar" prefix=""/>
    </jar>
    </target>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#4

Hi Emil,

In fact I have still problems. I thought it was ok because I have no error
when rebuild and run SC. But the first time I try to use a external library
within the new plugin I get an exception uncatched.

What I did was:
I dropped the libraries in the lib/installer-exclude directory.
I added a line in felix.client.run.properties in
felix.auto.start.67= \
reference:file:lib/installer-exclude/newlibrary.jar \
And I have also added the packages I need in the manifest of the new plugin.

Is all that correct? Do I miss something?

I also need to add in the ld.library.path some .dll so I have added in
build.xml
<condition property="ld.library.path"

value="${lib}/native/linux:${system.LD_LIBRARY_PATH}:/addingPath">
        <isset property="is.running.linux"/>
    </condition>
But I think that is ok, isn't it?

Thank you very much

Kind Regards,
Oscar

···

2008/11/7 Emil Ivov <emcho@sip-communicator.org>

Cool! Glad you have it sorted out!

Cheers
Emil

Óscar Sánchez wrote:
> Hi,
>
> The first option goes well
> Thanks.
>
> 2008/11/7 Óscar Sánchez <oscarsancheziglesias@gmail.com
> <mailto:oscarsancheziglesias@gmail.com>>
>
> Hi,
>
>
> I would like to add external libraries on SC. I tried to do what I
found in
> the mail-list but I did not success. Could someone help me with this?
>
>
> Thank you very much in advance.
>
> Sorry about send this email wrong before, my email client became
crazy./
>
> The thing is that you have to let felix know these libs exist before
>
>
> your plugin can use them. There are three ways to do this:
>
>
> 1. You make the libs run as bundles in which case you have to declare
>
>
>
> the packages they export in their manifest files and then modify
> felix.client.run.properties to run them.
>
>
> /I will try this now. I wanted to try it before send the whole
email.Sorry again./
>
>
>
>
> 2. Add your libs to the classpath and add the packages you are going
to
>
>
>
> use to the org.osgi.framework.system.packages property in
> felix.client.run.properties.
>
>
>
>
> /I have added the external libraries to the project and in
eclipse->run->Classpath.
> And I added the packages to org.osgi.framework.system.packages
property in
>
>
>
> felix.client.run.properties. But I got that error when running SC.
> I did not change anything in build.xml. May I change something on it?
>
>
>
> How can I import to bundle 1326?
>
> //Caused by: java.lang.ClassNotFoundException:
>
>
>
> *** Class 'gov.nasa.worldwind.layers.Layer' was not found because
bundle
> 1326 does not import 'gov.nasa.worldwind.layers' even though bundle 0
> does export it. Additionally, the class is also available from the
system
>
>
>
> class loader. There are two fixes: 1) Add an import for
'gov.nasa.worldwind.layers'
> to bundle 1326; imports are necessary for each class directly touched
by bundle
> code or indirectly touched, such as super classes if their methods
are used.
>
>
>
> 2) Add package 'gov.nasa.worldwind.layers' to the
'org.osgi.framework.bootdelegation'
> property; a library or VM bug can cause classes to be loaded by the
wrong
> class loader. The first approach is preferable for preserving
modularity. ***/
>
>
>
>
> 3. Include their content inside your plugin jar. One way to do this
is
>
>
>
> using the zipfileset tag inside the jar task that creates your plugin
> bundle.
>
>
>
> /I tried to do it like is below. But I got the next error. With out
the libraries the examplepluginW is ok.
>
>
> ERROR: Error starting reference:file:sc-bundles/examplepluginW.jar
> (org.osgi.framework.BundleException:
>
>
> Not found:
net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
>
> /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
>
>
> <target name="bundle-plugin-examplepluginW">
> <!-- Creates a bundle for the plugin SIP Account Registration
Wizard.-->
> <jar compress="false" destfile="${bundles.dest}/examplepluginW.jar"
>
>
>
>
manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
> <zipfileset
dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
> prefix="net/java/sip/communicator/plugin/examplepluginW"/>
>
>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
prefix=""/>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
prefix=""/>
>
>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
prefix=""/>
> </jar>
> </target>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#5

Hi Emil,

Thank you for emailing me so quick. What I want to do is use the worldwind
within SC. I created a simple application with the worldwind. That
application is ok, I can run it without SC.
But I still cannot use it within SC.

I have created the new bundle for the library like you do with log4j. I
added in the felix.client.run the proper line. But the first time I try to
use the library I get an exception. This is the message:
**** Package 'gov.nasa.worldwind.layers' is imported by bundle 1381 from
bundle 1363, but the exported package from bundle 1363 does not contain the
requested class 'gov.nasa.worldwind.layers.Layer'. Please verify that the
class name is correct in the importing bundle 1381 and/or that the exported
package is correctly bundled in 1363. ***

(bundle 1381 is the plugin and 1363 is the library)

···

*
I have checked the import package in the manifest of the plugin:
* gov.nasa.worldwind.layers*
And the .jar generated for the bundle in lib/bundle includes that class,
below is one line of the Manifiest of the .jar generated:
* Name: gov/nasa/worldwind/layers/Layer.class
      SHA1-Digest: jEqzlwLMpF340jrw+QLkvp+1OCU=

*So I really do not know how to solve it. Maybe I am already blind because
the computer :). I saw that your log4j is not in the All Bundle, maybe you
only did it once and afterthat you just use it. I tried that as well.

I also tried to use the zipfileset tag inside the jar task that create the
new plugin in order to include the libraries in examplepluginw.jar. But I
got the next error when run SC. (Of course the plugin never starts)
*ERROR: Error starting reference:file:sc-bundles/examplepluginw.jar
(org.osgi.framework.BundleException: Not found:
net.java.sip.communicator.plugin.examplepluginw.ExamplePluginWActivator)

*Of course ExamplePluginWActivator is there and it is ok without the
zipfileset tag. I thought maybe I have to change something in the Activator
in order to import libraries so I tried with another library from
/lib/bundle/installer-exclude : *ymsg_network_v0_63.jar*(I never use it) * *.
Then I do not get such an error. Is there any difference between the library
I have just dropped to /lib/bundle/installer-exclude an
ymsg_network_v0_63.jar? The only difference I see is that
ymsg_network_v0_63.jar does not appear in that folder from eclipse and the
mine does. Of course both are in /lib/bundle/installer-exclude.

Any idea?. Again, thank you very much.

Kind Regards,
Oscar

2008/11/8 Emil Ivov <emcho@sip-communicator.org>

Hey Oscar,

(comments inline)

--sent from my mobile.

On 8 nov. 08, at 19:18, "Óscar Sánchez" <oscarsancheziglesias@gmail.com> > wrote:

Hi Emil,

In fact I have still problems. I thought it was ok because I have no error
when rebuild and run SC. But the first time I try to use a external library
within the new plugin I get an exception uncatched.

Would help to know what it is. Could you pls send it if the below does not
help.

What I did was:
I dropped the libraries in the lib/installer-exclude directory.
I added a line in felix.client.run.properties in
felix.auto.start.67= \
reference:file:lib/installer-exclude/newlibrary.jar \
And I have also added the packages I need in the manifest of the new
plugin.

Is all that correct? Do I miss something?

You need to make a bundle for the new library. In your case this basically
comes down to adding a manifest file that specifies which packages this new
bundle is going to export.

You can have a look at what we do with log4j in build.xml since it would
most probably work for you too. Note that if you decide to do things the
same way and generate your bundle on every build then you'd also need to
change the corresponding line in felix.client.run so that it points to the
generated bundle.

Hope this helps.
Emil

I also need to add in the ld.library.path some .dll so I have added in
build.xml
<condition property="ld.library.path"

value="${lib}/native/linux:${system.LD_LIBRARY_PATH}:/addingPath">
        <isset property="is.running.linux"/>
    </condition>
But I think that is ok, isn't it?

Thank you very much

Kind Regards,
Oscar

2008/11/7 Emil Ivov < <emcho@sip-communicator.org>
emcho@sip-communicator.org>

Cool! Glad you have it sorted out!

Cheers
Emil

Óscar Sánchez wrote:
> Hi,
>
> The first option goes well
> Thanks.
>
> 2008/11/7 Óscar Sánchez < <oscarsancheziglesias@gmail.com>
oscarsancheziglesias@gmail.com
> <mailto: <oscarsancheziglesias@gmail.com>oscarsancheziglesias@gmail.com
>>
>
> Hi,
>
>
> I would like to add external libraries on SC. I tried to do what I
found in
> the mail-list but I did not success. Could someone help me with
this?
>
>
> Thank you very much in advance.
>
> Sorry about send this email wrong before, my email client became
crazy./
>
> The thing is that you have to let felix know these libs exist before
>
>
> your plugin can use them. There are three ways to do this:
>
>
> 1. You make the libs run as bundles in which case you have to
declare
>
>
>
> the packages they export in their manifest files and then modify
> felix.client.run.properties to run them.
>
>
> /I will try this now. I wanted to try it before send the whole
email.Sorry again./
>
>
>
>
> 2. Add your libs to the classpath and add the packages you are going
to
>
>
>
> use to the org.osgi.framework.system.packages property in
> felix.client.run.properties.
>
>
>
>
> /I have added the external libraries to the project and in
eclipse->run->Classpath.
> And I added the packages to org.osgi.framework.system.packages
property in
>
>
>
> felix.client.run.properties. But I got that error when running SC.
> I did not change anything in build.xml. May I change something on
it?
>
>
>
> How can I import to bundle 1326?
>
> //Caused by: java.lang.ClassNotFoundException:
>
>
>
> *** Class 'gov.nasa.worldwind.layers.Layer' was not found because
bundle
> 1326 does not import 'gov.nasa.worldwind.layers' even though bundle
0
> does export it. Additionally, the class is also available from the
system
>
>
>
> class loader. There are two fixes: 1) Add an import for
'gov.nasa.worldwind.layers'
> to bundle 1326; imports are necessary for each class directly
touched by bundle
> code or indirectly touched, such as super classes if their methods
are used.
>
>
>
> 2) Add package 'gov.nasa.worldwind.layers' to the
'org.osgi.framework.bootdelegation'
> property; a library or VM bug can cause classes to be loaded by the
wrong
> class loader. The first approach is preferable for preserving
modularity. ***/
>
>
>
>
> 3. Include their content inside your plugin jar. One way to do this
is
>
>
>
> using the zipfileset tag inside the jar task that creates your
plugin
> bundle.
>
>
>
> /I tried to do it like is below. But I got the next error. With out
the libraries the examplepluginW is ok.
>
>
> ERROR: Error starting reference:file:sc-bundles/examplepluginW.jar
> (org.osgi.framework.BundleException:
>
>
> Not found:
net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
>
> /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
>
>
> <target name="bundle-plugin-examplepluginW">
> <!-- Creates a bundle for the plugin SIP Account Registration
Wizard.-->
> <jar compress="false" destfile="${bundles.dest}/examplepluginW.jar"
>
>
>
>
manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
> <zipfileset
dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
> prefix="net/java/sip/communicator/plugin/examplepluginW"/>
>
>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
prefix=""/>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
prefix=""/>
>
>
> <zipfileset
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
prefix=""/>
> </jar>
> </target>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: <users-unsubscribe@sip-communicator.dev.java.net>
users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
<users-help@sip-communicator.dev.java.net>
users-help@sip-communicator.dev.java.net


#6

Óscar Sánchez wrote:

Hi Emil,

Thank you for emailing me so quick. What I want to do is use the
worldwind within SC. I created a simple application with the worldwind.
That application is ok, I can run it without SC.

Hey this sounds quite cool! Do you use it to display your contacts
around the globe?

But I still cannot use it within SC.

No worries, we'll get this sorted out.

I have created the new bundle for the library like you do with log4j. I
added in the felix.client.run the proper line. But the first time I try
to use the library I get an exception. This is the message:
/*** Package 'gov.nasa.worldwind.layers' is imported by bundle 1381 from
bundle 1363, but the exported package from bundle 1363 does not contain
the requested class 'gov.nasa.worldwind.layers.Layer'. Please verify
that the class name is correct in the importing bundle 1381 and/or that
the exported package is correctly bundled in 1363. ***

(bundle 1381 is the plugin and 1363 is the library)
/
I have checked the import package in the manifest of the plugin:
/ gov.nasa.worldwind.layers/
And the .jar generated for the bundle in lib/bundle includes that class,
below is one line of the Manifiest of the .jar generated:
/ Name: gov/nasa/worldwind/layers/Layer.class
      SHA1-Digest: jEqzlwLMpF340jrw+QLkvp+1OCU=

Strange. Could you please send the library jar and your manifest from
the plugin jar?

/So I really do not know how to solve it. Maybe I am already blind
because the computer :). I saw that your log4j is not in the All Bundle,
maybe you only did it once and afterthat you just use it. I tried that
as well.

Yes indeed. But I doubt your problem has anything to do with this.

I also tried to use the zipfileset tag inside the jar task that create
the new plugin in order to include the libraries in examplepluginw.jar.
But I got the next error when run SC. (Of course the plugin never starts)
/ERROR: Error starting reference:file:sc-bundles/examplepluginw.jar
(org.osgi.framework.BundleException: Not found:
net.java.sip.communicator.plugin.examplepluginw.ExamplePluginWActivator)

/Of course ExamplePluginWActivator is there and it is ok without the
zipfileset tag. I thought maybe I have to change something in the
Activator in order to import libraries so I tried with another library
from /lib/bundle/installer-exclude : /ymsg_network_v0_63.jar/(I never
use it) / /. Then I do not get such an error. Is there any difference
between the library I have just dropped to /lib/bundle/installer-exclude
an ymsg_network_v0_63.jar? The only difference I see is that
ymsg_network_v0_63.jar does not appear in that folder from eclipse and
the mine does. Of course both are in /lib/bundle/installer-exclude.

(You mean lib/installer-exclude right?)

Afraid, I have no ideas other than asking you to send your jar-ed plugin
if this is an option for you.

Cheers
Emil

···

Any idea?. Again, thank you very much.

Kind Regards,
Oscar

2008/11/8 Emil Ivov <emcho@sip-communicator.org
<mailto:emcho@sip-communicator.org>>

    Hey Oscar,

    (comments inline)

    --sent from my mobile.

    On 8 nov. 08, at 19:18, "Óscar Sánchez" > <oscarsancheziglesias@gmail.com > <mailto:oscarsancheziglesias@gmail.com>> wrote:

    Hi Emil,

    In fact I have still problems. I thought it was ok because I have
    no error when rebuild and run SC. But the first time I try to use
    a external library within the new plugin I get an exception uncatched.

    Would help to know what it is. Could you pls send it if the below
    does not help.

    What I did was:
    I dropped the libraries in the lib/installer-exclude directory.
    I added a line in felix.client.run.properties in
    felix.auto.start.67= \
    reference:file:lib/installer-exclude/newlibrary.jar \
    And I have also added the packages I need in the manifest of the
    new plugin.

    Is all that correct? Do I miss something?

    You need to make a bundle for the new library. In your case this
    basically comes down to adding a manifest file that specifies which
    packages this new bundle is going to export.

    You can have a look at what we do with log4j in build.xml since it
    would most probably work for you too. Note that if you decide to do
    things the same way and generate your bundle on every build then
    you'd also need to change the corresponding line in felix.client.run
    so that it points to the generated bundle.

    Hope this helps.
    Emil

    I also need to add in the ld.library.path some .dll so I have
    added in build.xml
     <condition property="ld.library.path"
                 
    value="\{lib\}/native/linux:{system.LD_LIBRARY_PATH}:/addingPath">
            <isset property="is.running.linux"/>
        </condition>
    But I think that is ok, isn't it?

    Thank you very much

    Kind Regards,
    Oscar

    2008/11/7 Emil Ivov <
    <mailto:emcho@sip-communicator.org>emcho@sip-communicator.org
    <mailto:emcho@sip-communicator.org>>

        Cool! Glad you have it sorted out!

        Cheers
        Emil

        Óscar Sánchez wrote:
        > Hi,
        >
        > The first option goes well
        > Thanks.
        >
        > 2008/11/7 Óscar Sánchez <
        <mailto:oscarsancheziglesias@gmail.com>oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>
        > <mailto:
        <mailto:oscarsancheziglesias@gmail.com>oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>>>
        >
        > Hi,
        >
        >
        > I would like to add external libraries on SC. I tried to
        do what I found in
        > the mail-list but I did not success. Could someone help
        me with this?
        >
        >
        > Thank you very much in advance.
        >
        > Sorry about send this email wrong before, my email
        client became crazy./
        >
        > The thing is that you have to let felix know these libs
        exist before
        >
        >
        > your plugin can use them. There are three ways to do this:
        >
        >
        > 1. You make the libs run as bundles in which case you
        have to declare
        >
        >
        >
        > the packages they export in their manifest files and
        then modify
        > felix.client.run.properties to run them.
        >
        >
        > /I will try this now. I wanted to try it before send the
        whole email.Sorry again./
        >
        >
        >
        >
        > 2. Add your libs to the classpath and add the packages
        you are going to
        >
        >
        >
        > use to the org.osgi.framework.system.packages property in
        > felix.client.run.properties.
        >
        >
        >
        >
        > /I have added the external libraries to the project and
        in eclipse->run->Classpath.
        > And I added the packages to
        org.osgi.framework.system.packages property in
        >
        >
        >
        > felix.client.run.properties. But I got that error when
        running SC.
        > I did not change anything in build.xml. May I change
        something on it?
        >
        >
        >
        > How can I import to bundle 1326?
        >
        > //Caused by: java.lang.ClassNotFoundException:
        >
        >
        >
        > *** Class 'gov.nasa.worldwind.layers.Layer' was not
        found because bundle
        > 1326 does not import 'gov.nasa.worldwind.layers' even
        though bundle 0
        > does export it. Additionally, the class is also
        available from the system
        >
        >
        >
        > class loader. There are two fixes: 1) Add an import for
        'gov.nasa.worldwind.layers'
        > to bundle 1326; imports are necessary for each class
        directly touched by bundle
        > code or indirectly touched, such as super classes if
        their methods are used.
        >
        >
        >
        > 2) Add package 'gov.nasa.worldwind.layers' to the
        'org.osgi.framework.bootdelegation'
        > property; a library or VM bug can cause classes to be
        loaded by the wrong
        > class loader. The first approach is preferable for
        preserving modularity. ***/
        >
        >
        >
        >
        > 3. Include their content inside your plugin jar. One way
        to do this is
        >
        >
        >
        > using the zipfileset tag inside the jar task that
        creates your plugin
        > bundle.
        >
        >
        >
        > /I tried to do it like is below. But I got the next
        error. With out the libraries the examplepluginW is ok.
        >
        >
        > ERROR: Error starting
        reference:file:sc-bundles/examplepluginW.jar
        > (org.osgi.framework.BundleException:
        >
        >
        > Not found:
        net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
        >
        > /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
        >
        >
        > <target name="bundle-plugin-examplepluginW">
        > <!-- Creates a bundle for the plugin SIP Account
        Registration Wizard.-->
        > <jar compress="false"
        destfile="\{bundles\.dest\}/examplepluginW\.jar&quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;manifest=&quot;{src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
        > <zipfileset
        dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
        >
         prefix="net/java/sip/communicator/plugin/examplepluginW"/>
        >
        >
        > <zipfileset
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
        prefix=""/>
        > <zipfileset
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
        prefix=""/>
        >
        >
        > <zipfileset
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
        prefix=""/>
        > </jar>
        > </target>
        >
        >
        >
        >

        ---------------------------------------------------------------------
        To unsubscribe, e-mail:
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>users-unsubscribe@sip-communicator.dev.java.net
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>
        For additional commands, e-mail:
        <mailto:users-help@sip-communicator.dev.java.net>users-help@sip-communicator.dev.java.net
        <mailto:users-help@sip-communicator.dev.java.net>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#7

Hi,

Yes, It would be nice to see all contacts around the globe. From now, I only
have a simple application where you can see icons in ramdom places. I still
have to find out the coordinates of each contact.

I have new ideas about how to use it within SC. I will try this week.

Kind Regards
Oscar

···

2008/11/16 Emil Ivov <emcho@sip-communicator.org>

Óscar Sánchez wrote:
> Hi Emil,
>
> Thank you for emailing me so quick. What I want to do is use the
> worldwind within SC. I created a simple application with the worldwind.
> That application is ok, I can run it without SC.

Hey this sounds quite cool! Do you use it to display your contacts
around the globe?

> But I still cannot use it within SC.

No worries, we'll get this sorted out.

> I have created the new bundle for the library like you do with log4j. I
> added in the felix.client.run the proper line. But the first time I try
> to use the library I get an exception. This is the message:
> /*** Package 'gov.nasa.worldwind.layers' is imported by bundle 1381 from
> bundle 1363, but the exported package from bundle 1363 does not contain
> the requested class 'gov.nasa.worldwind.layers.Layer'. Please verify
> that the class name is correct in the importing bundle 1381 and/or that
> the exported package is correctly bundled in 1363. ***
>
> (bundle 1381 is the plugin and 1363 is the library)
> /
> I have checked the import package in the manifest of the plugin:
> / gov.nasa.worldwind.layers/
> And the .jar generated for the bundle in lib/bundle includes that class,
> below is one line of the Manifiest of the .jar generated:
> / Name: gov/nasa/worldwind/layers/Layer.class
> SHA1-Digest: jEqzlwLMpF340jrw+QLkvp+1OCU=

Strange. Could you please send the library jar and your manifest from
the plugin jar?

> /So I really do not know how to solve it. Maybe I am already blind
> because the computer :). I saw that your log4j is not in the All Bundle,
> maybe you only did it once and afterthat you just use it. I tried that
> as well.

Yes indeed. But I doubt your problem has anything to do with this.

> I also tried to use the zipfileset tag inside the jar task that create
> the new plugin in order to include the libraries in examplepluginw.jar.
> But I got the next error when run SC. (Of course the plugin never starts)
> /ERROR: Error starting reference:file:sc-bundles/examplepluginw.jar
> (org.osgi.framework.BundleException: Not found:
> net.java.sip.communicator.plugin.examplepluginw.ExamplePluginWActivator)
>
> /Of course ExamplePluginWActivator is there and it is ok without the
> zipfileset tag. I thought maybe I have to change something in the
> Activator in order to import libraries so I tried with another library
> from /lib/bundle/installer-exclude : /ymsg_network_v0_63.jar/(I never
> use it) / /. Then I do not get such an error. Is there any difference
> between the library I have just dropped to /lib/bundle/installer-exclude
> an ymsg_network_v0_63.jar? The only difference I see is that
> ymsg_network_v0_63.jar does not appear in that folder from eclipse and
> the mine does. Of course both are in /lib/bundle/installer-exclude.

(You mean lib/installer-exclude right?)

Afraid, I have no ideas other than asking you to send your jar-ed plugin
if this is an option for you.

Cheers
Emil
>
> Any idea?. Again, thank you very much.
>
> Kind Regards,
> Oscar
>
>
>
> 2008/11/8 Emil Ivov <emcho@sip-communicator.org
> <mailto:emcho@sip-communicator.org>>
>
> Hey Oscar,
>
> (comments inline)
>
> --sent from my mobile.
>
> On 8 nov. 08, at 19:18, "Óscar Sánchez" > > <oscarsancheziglesias@gmail.com > > <mailto:oscarsancheziglesias@gmail.com>> wrote:
>
>> Hi Emil,
>>
>> In fact I have still problems. I thought it was ok because I have
>> no error when rebuild and run SC. But the first time I try to use
>> a external library within the new plugin I get an exception
uncatched.
>
> Would help to know what it is. Could you pls send it if the below
> does not help.
>
>> What I did was:
>> I dropped the libraries in the lib/installer-exclude directory.
>> I added a line in felix.client.run.properties in
>> felix.auto.start.67= \
>> reference:file:lib/installer-exclude/newlibrary.jar \
>> And I have also added the packages I need in the manifest of the
>> new plugin.
>>
>> Is all that correct? Do I miss something?
>
> You need to make a bundle for the new library. In your case this
> basically comes down to adding a manifest file that specifies which
> packages this new bundle is going to export.
>
> You can have a look at what we do with log4j in build.xml since it
> would most probably work for you too. Note that if you decide to do
> things the same way and generate your bundle on every build then
> you'd also need to change the corresponding line in felix.client.run
> so that it points to the generated bundle.
>
> Hope this helps.
> Emil
>>
>>
>> I also need to add in the ld.library.path some .dll so I have
>> added in build.xml
>> <condition property="ld.library.path"
>>
>> value="${lib}/native/linux:${system.LD_LIBRARY_PATH}:/addingPath">
>> <isset property="is.running.linux"/>
>> </condition>
>> But I think that is ok, isn't it?
>>
>> Thank you very much
>>
>> Kind Regards,
>> Oscar
>>
>>
>> 2008/11/7 Emil Ivov <
>> <mailto:emcho@sip-communicator.org>emcho@sip-communicator.org
>> <mailto:emcho@sip-communicator.org>>
>>
>> Cool! Glad you have it sorted out!
>>
>> Cheers
>> Emil
>>
>> Óscar Sánchez wrote:
>> > Hi,
>> >
>> > The first option goes well
>> > Thanks.
>> >
>> > 2008/11/7 Óscar Sánchez <
>> <mailto:oscarsancheziglesias@gmail.com>
oscarsancheziglesias@gmail.com
>> <mailto:oscarsancheziglesias@gmail.com>
>> > <mailto:
>> <mailto:oscarsancheziglesias@gmail.com>
oscarsancheziglesias@gmail.com
>> <mailto:oscarsancheziglesias@gmail.com>>>
>> >
>> > Hi,
>> >
>> >
>> > I would like to add external libraries on SC. I tried to
>> do what I found in
>> > the mail-list but I did not success. Could someone help
>> me with this?
>> >
>> >
>> > Thank you very much in advance.
>> >
>> > Sorry about send this email wrong before, my email
>> client became crazy./
>> >
>> > The thing is that you have to let felix know these libs
>> exist before
>> >
>> >
>> > your plugin can use them. There are three ways to do this:
>> >
>> >
>> > 1. You make the libs run as bundles in which case you
>> have to declare
>> >
>> >
>> >
>> > the packages they export in their manifest files and
>> then modify
>> > felix.client.run.properties to run them.
>> >
>> >
>> > /I will try this now. I wanted to try it before send the
>> whole email.Sorry again./
>> >
>> >
>> >
>> >
>> > 2. Add your libs to the classpath and add the packages
>> you are going to
>> >
>> >
>> >
>> > use to the org.osgi.framework.system.packages property in
>> > felix.client.run.properties.
>> >
>> >
>> >
>> >
>> > /I have added the external libraries to the project and
>> in eclipse->run->Classpath.
>> > And I added the packages to
>> org.osgi.framework.system.packages property in
>> >
>> >
>> >
>> > felix.client.run.properties. But I got that error when
>> running SC.
>> > I did not change anything in build.xml. May I change
>> something on it?
>> >
>> >
>> >
>> > How can I import to bundle 1326?
>> >
>> > //Caused by: java.lang.ClassNotFoundException:
>> >
>> >
>> >
>> > *** Class 'gov.nasa.worldwind.layers.Layer' was not
>> found because bundle
>> > 1326 does not import 'gov.nasa.worldwind.layers' even
>> though bundle 0
>> > does export it. Additionally, the class is also
>> available from the system
>> >
>> >
>> >
>> > class loader. There are two fixes: 1) Add an import for
>> 'gov.nasa.worldwind.layers'
>> > to bundle 1326; imports are necessary for each class
>> directly touched by bundle
>> > code or indirectly touched, such as super classes if
>> their methods are used.
>> >
>> >
>> >
>> > 2) Add package 'gov.nasa.worldwind.layers' to the
>> 'org.osgi.framework.bootdelegation'
>> > property; a library or VM bug can cause classes to be
>> loaded by the wrong
>> > class loader. The first approach is preferable for
>> preserving modularity. ***/
>> >
>> >
>> >
>> >
>> > 3. Include their content inside your plugin jar. One way
>> to do this is
>> >
>> >
>> >
>> > using the zipfileset tag inside the jar task that
>> creates your plugin
>> > bundle.
>> >
>> >
>> >
>> > /I tried to do it like is below. But I got the next
>> error. With out the libraries the examplepluginW is ok.
>> >
>> >
>> > ERROR: Error starting
>> reference:file:sc-bundles/examplepluginW.jar
>> > (org.osgi.framework.BundleException:
>> >
>> >
>> > Not found:
>>
net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
>> >
>> > /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
>> >
>> >
>> > <target name="bundle-plugin-examplepluginW">
>> > <!-- Creates a bundle for the plugin SIP Account
>> Registration Wizard.-->
>> > <jar compress="false"
>> destfile="${bundles.dest}/examplepluginW.jar"
>> >
>> >
>> >
>> >
>>
manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
>> > <zipfileset
>> dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
>> >
>> prefix="net/java/sip/communicator/plugin/examplepluginW"/>
>> >
>> >
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
>> prefix=""/>
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
>> prefix=""/>
>> >
>> >
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
>> prefix=""/>
>> > </jar>
>> > </target>
>> >
>> >
>> >
>> >
>>
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> <mailto:users-unsubscribe@sip-communicator.dev.java.net>
users-unsubscribe@sip-communicator.dev.java.net
>> <mailto:users-unsubscribe@sip-communicator.dev.java.net>
>> For additional commands, e-mail:
>> <mailto:users-help@sip-communicator.dev.java.net>
users-help@sip-communicator.dev.java.net
>> <mailto:users-help@sip-communicator.dev.java.net>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#8

Hi,

I got it solved.

I add the libraries .jar in* lib/installer-exclude/*
         the libraries .so in */lib/native/linux*

and I add all packages I need in the manifest of my plugin.
Finally I also add those packages to felix.client.run.properties in *
org.osgi.framework.system.packages

*Thank you very much Emil for your help :).

I have seen a .pdf of sip-communicator. Didn't you use google maps in order
to see all contacts on the map?

Kind Regards,
Oscar

···

*

*
2008/11/16 Óscar Sánchez <oscarsancheziglesias@gmail.com>

Hi,

Yes, It would be nice to see all contacts around the globe. From now, I
only have a simple application where you can see icons in ramdom places. I
still have to find out the coordinates of each contact.

I have new ideas about how to use it within SC. I will try this week.

Kind Regards
Oscar

2008/11/16 Emil Ivov <emcho@sip-communicator.org>

Óscar Sánchez wrote:
> Hi Emil,
>
> Thank you for emailing me so quick. What I want to do is use the
> worldwind within SC. I created a simple application with the worldwind.
> That application is ok, I can run it without SC.

Hey this sounds quite cool! Do you use it to display your contacts
around the globe?

> But I still cannot use it within SC.

No worries, we'll get this sorted out.

> I have created the new bundle for the library like you do with log4j. I
> added in the felix.client.run the proper line. But the first time I try
> to use the library I get an exception. This is the message:
> /*** Package 'gov.nasa.worldwind.layers' is imported by bundle 1381 from
> bundle 1363, but the exported package from bundle 1363 does not contain
> the requested class 'gov.nasa.worldwind.layers.Layer'. Please verify
> that the class name is correct in the importing bundle 1381 and/or that
> the exported package is correctly bundled in 1363. ***
>
> (bundle 1381 is the plugin and 1363 is the library)
> /
> I have checked the import package in the manifest of the plugin:
> / gov.nasa.worldwind.layers/
> And the .jar generated for the bundle in lib/bundle includes that class,
> below is one line of the Manifiest of the .jar generated:
> / Name: gov/nasa/worldwind/layers/Layer.class
> SHA1-Digest: jEqzlwLMpF340jrw+QLkvp+1OCU=

Strange. Could you please send the library jar and your manifest from
the plugin jar?

> /So I really do not know how to solve it. Maybe I am already blind
> because the computer :). I saw that your log4j is not in the All Bundle,
> maybe you only did it once and afterthat you just use it. I tried that
> as well.

Yes indeed. But I doubt your problem has anything to do with this.

> I also tried to use the zipfileset tag inside the jar task that create
> the new plugin in order to include the libraries in examplepluginw.jar.
> But I got the next error when run SC. (Of course the plugin never
starts)
> /ERROR: Error starting reference:file:sc-bundles/examplepluginw.jar
> (org.osgi.framework.BundleException: Not found:
> net.java.sip.communicator.plugin.examplepluginw.ExamplePluginWActivator)
>
> /Of course ExamplePluginWActivator is there and it is ok without the
> zipfileset tag. I thought maybe I have to change something in the
> Activator in order to import libraries so I tried with another library
> from /lib/bundle/installer-exclude : /ymsg_network_v0_63.jar/(I never
> use it) / /. Then I do not get such an error. Is there any difference
> between the library I have just dropped to /lib/bundle/installer-exclude
> an ymsg_network_v0_63.jar? The only difference I see is that
> ymsg_network_v0_63.jar does not appear in that folder from eclipse and
> the mine does. Of course both are in /lib/bundle/installer-exclude.

(You mean lib/installer-exclude right?)

Afraid, I have no ideas other than asking you to send your jar-ed plugin
if this is an option for you.

Cheers
Emil
>
> Any idea?. Again, thank you very much.
>
> Kind Regards,
> Oscar
>
>
>
> 2008/11/8 Emil Ivov <emcho@sip-communicator.org
> <mailto:emcho@sip-communicator.org>>
>
> Hey Oscar,
>
> (comments inline)
>
> --sent from my mobile.
>
> On 8 nov. 08, at 19:18, "Óscar Sánchez" >> > <oscarsancheziglesias@gmail.com >> > <mailto:oscarsancheziglesias@gmail.com>> wrote:
>
>> Hi Emil,
>>
>> In fact I have still problems. I thought it was ok because I have
>> no error when rebuild and run SC. But the first time I try to use
>> a external library within the new plugin I get an exception
uncatched.
>
> Would help to know what it is. Could you pls send it if the below
> does not help.
>
>> What I did was:
>> I dropped the libraries in the lib/installer-exclude directory.
>> I added a line in felix.client.run.properties in
>> felix.auto.start.67= \
>> reference:file:lib/installer-exclude/newlibrary.jar \
>> And I have also added the packages I need in the manifest of the
>> new plugin.
>>
>> Is all that correct? Do I miss something?
>
> You need to make a bundle for the new library. In your case this
> basically comes down to adding a manifest file that specifies which
> packages this new bundle is going to export.
>
> You can have a look at what we do with log4j in build.xml since it
> would most probably work for you too. Note that if you decide to do
> things the same way and generate your bundle on every build then
> you'd also need to change the corresponding line in felix.client.run
> so that it points to the generated bundle.
>
> Hope this helps.
> Emil
>>
>>
>> I also need to add in the ld.library.path some .dll so I have
>> added in build.xml
>> <condition property="ld.library.path"
>>
>> value="${lib}/native/linux:${system.LD_LIBRARY_PATH}:/addingPath">
>> <isset property="is.running.linux"/>
>> </condition>
>> But I think that is ok, isn't it?
>>
>> Thank you very much
>>
>> Kind Regards,
>> Oscar
>>
>>
>> 2008/11/7 Emil Ivov <
>> <mailto:emcho@sip-communicator.org>emcho@sip-communicator.org
>> <mailto:emcho@sip-communicator.org>>
>>
>> Cool! Glad you have it sorted out!
>>
>> Cheers
>> Emil
>>
>> Óscar Sánchez wrote:
>> > Hi,
>> >
>> > The first option goes well
>> > Thanks.
>> >
>> > 2008/11/7 Óscar Sánchez <
>> <mailto:oscarsancheziglesias@gmail.com>
oscarsancheziglesias@gmail.com
>> <mailto:oscarsancheziglesias@gmail.com>
>> > <mailto:
>> <mailto:oscarsancheziglesias@gmail.com>
oscarsancheziglesias@gmail.com
>> <mailto:oscarsancheziglesias@gmail.com>>>
>> >
>> > Hi,
>> >
>> >
>> > I would like to add external libraries on SC. I tried to
>> do what I found in
>> > the mail-list but I did not success. Could someone help
>> me with this?
>> >
>> >
>> > Thank you very much in advance.
>> >
>> > Sorry about send this email wrong before, my email
>> client became crazy./
>> >
>> > The thing is that you have to let felix know these libs
>> exist before
>> >
>> >
>> > your plugin can use them. There are three ways to do
this:
>> >
>> >
>> > 1. You make the libs run as bundles in which case you
>> have to declare
>> >
>> >
>> >
>> > the packages they export in their manifest files and
>> then modify
>> > felix.client.run.properties to run them.
>> >
>> >
>> > /I will try this now. I wanted to try it before send the
>> whole email.Sorry again./
>> >
>> >
>> >
>> >
>> > 2. Add your libs to the classpath and add the packages
>> you are going to
>> >
>> >
>> >
>> > use to the org.osgi.framework.system.packages property in
>> > felix.client.run.properties.
>> >
>> >
>> >
>> >
>> > /I have added the external libraries to the project and
>> in eclipse->run->Classpath.
>> > And I added the packages to
>> org.osgi.framework.system.packages property in
>> >
>> >
>> >
>> > felix.client.run.properties. But I got that error when
>> running SC.
>> > I did not change anything in build.xml. May I change
>> something on it?
>> >
>> >
>> >
>> > How can I import to bundle 1326?
>> >
>> > //Caused by: java.lang.ClassNotFoundException:
>> >
>> >
>> >
>> > *** Class 'gov.nasa.worldwind.layers.Layer' was not
>> found because bundle
>> > 1326 does not import 'gov.nasa.worldwind.layers' even
>> though bundle 0
>> > does export it. Additionally, the class is also
>> available from the system
>> >
>> >
>> >
>> > class loader. There are two fixes: 1) Add an import for
>> 'gov.nasa.worldwind.layers'
>> > to bundle 1326; imports are necessary for each class
>> directly touched by bundle
>> > code or indirectly touched, such as super classes if
>> their methods are used.
>> >
>> >
>> >
>> > 2) Add package 'gov.nasa.worldwind.layers' to the
>> 'org.osgi.framework.bootdelegation'
>> > property; a library or VM bug can cause classes to be
>> loaded by the wrong
>> > class loader. The first approach is preferable for
>> preserving modularity. ***/
>> >
>> >
>> >
>> >
>> > 3. Include their content inside your plugin jar. One way
>> to do this is
>> >
>> >
>> >
>> > using the zipfileset tag inside the jar task that
>> creates your plugin
>> > bundle.
>> >
>> >
>> >
>> > /I tried to do it like is below. But I got the next
>> error. With out the libraries the examplepluginW is ok.
>> >
>> >
>> > ERROR: Error starting
>> reference:file:sc-bundles/examplepluginW.jar
>> > (org.osgi.framework.BundleException:
>> >
>> >
>> > Not found:
>>
net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
>> >
>> > /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
>> >
>> >
>> > <target name="bundle-plugin-examplepluginW">
>> > <!-- Creates a bundle for the plugin SIP Account
>> Registration Wizard.-->
>> > <jar compress="false"
>> destfile="${bundles.dest}/examplepluginW.jar"
>> >
>> >
>> >
>> >
>>
manifest="${src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
>> > <zipfileset
>> dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
>> >
>> prefix="net/java/sip/communicator/plugin/examplepluginW"/>
>> >
>> >
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
>> prefix=""/>
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
>> prefix=""/>
>> >
>> >
>> > <zipfileset
>>
src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
>> prefix=""/>
>> > </jar>
>> > </target>
>> >
>> >
>> >
>> >
>>
>>
>>
---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> <mailto:users-unsubscribe@sip-communicator.dev.java.net>
users-unsubscribe@sip-communicator.dev.java.net
>> <mailto:users-unsubscribe@sip-communicator.dev.java.net>
>> For additional commands, e-mail:
>> <mailto:users-help@sip-communicator.dev.java.net>
users-help@sip-communicator.dev.java.net
>> <mailto:users-help@sip-communicator.dev.java.net>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#9

Hey Oscar,

(redirecting to dev)

Óscar Sánchez wrote:

Hi,

I got it solved.

Great news! Thanks for letting us know!

I add the libraries .jar in*/ lib/installer-exclude//*
         the libraries .so in /*/lib/native/linux*/

and I add all packages I need in the manifest of my plugin.
Finally I also add those packages to felix.client.run.properties in
/*org.osgi.framework.system.packages

Hmm ... if that solved your problem then this means that you were either
not exporting _all_ these packages in the library bundle manifest or
that some of them are actually coming from other jars.

*/Thank you very much Emil for your help :).

I am not sure which part of my comments helped but I am glad if they did.

I have seen a .pdf of sip-communicator. Didn't you use google maps in
order to see all contacts on the map?

Yes. Guillaume Schreiner worked on an implementation of a location
sharing feature some time ago. I think he's quite busy these days but he
might be willing to let you continue he's work if you are interested.

Cheers
Emil

···

Kind Regards,
Oscar
/*

*/
2008/11/16 Óscar Sánchez <oscarsancheziglesias@gmail.com
<mailto:oscarsancheziglesias@gmail.com>>

    Hi,

    Yes, It would be nice to see all contacts around the globe. From
    now, I only have a simple application where you can see icons in
    ramdom places. I still have to find out the coordinates of each
    contact.

    I have new ideas about how to use it within SC. I will try this week.

    Kind Regards
    Oscar

    2008/11/16 Emil Ivov <emcho@sip-communicator.org
    <mailto:emcho@sip-communicator.org>>

        Óscar Sánchez wrote:
        > Hi Emil,
        >
        > Thank you for emailing me so quick. What I want to do is use the
        > worldwind within SC. I created a simple application with the
        worldwind.
        > That application is ok, I can run it without SC.

        Hey this sounds quite cool! Do you use it to display your contacts
        around the globe?

        > But I still cannot use it within SC.

        No worries, we'll get this sorted out.

        > I have created the new bundle for the library like you do
        with log4j. I
        > added in the felix.client.run the proper line. But the first
        time I try
        > to use the library I get an exception. This is the message:
        > /*** Package 'gov.nasa.worldwind.layers' is imported by bundle
        1381 from
        > bundle 1363, but the exported package from bundle 1363 does
        not contain
        > the requested class 'gov.nasa.worldwind.layers.Layer'. Please
        verify
        > that the class name is correct in the importing bundle 1381
        and/or that
        > the exported package is correctly bundled in 1363. ***
        >
        > (bundle 1381 is the plugin and 1363 is the library)
        > /
        > I have checked the import package in the manifest of the plugin:
        > / gov.nasa.worldwind.layers/
        > And the .jar generated for the bundle in lib/bundle includes
        that class,
        > below is one line of the Manifiest of the .jar generated:
        > / Name: gov/nasa/worldwind/layers/Layer.class
        > SHA1-Digest: jEqzlwLMpF340jrw+QLkvp+1OCU=

        Strange. Could you please send the library jar and your manifest
        from
        the plugin jar?

        > /So I really do not know how to solve it. Maybe I am already blind
        > because the computer :). I saw that your log4j is not in the
        All Bundle,
        > maybe you only did it once and afterthat you just use it. I
        tried that
        > as well.

        Yes indeed. But I doubt your problem has anything to do with this.

        > I also tried to use the zipfileset tag inside the jar task
        that create
        > the new plugin in order to include the libraries in
        examplepluginw.jar.
        > But I got the next error when run SC. (Of course the plugin
        never starts)
        > /ERROR: Error starting
        reference:file:sc-bundles/examplepluginw.jar
        > (org.osgi.framework.BundleException: Not found:
        >
        net.java.sip.communicator.plugin.examplepluginw.ExamplePluginWActivator)
        >
        > /Of course ExamplePluginWActivator is there and it is ok
        without the
        > zipfileset tag. I thought maybe I have to change something in the
        > Activator in order to import libraries so I tried with another
        library
        > from /lib/bundle/installer-exclude :
        /ymsg_network_v0_63.jar/(I never
        > use it) / /. Then I do not get such an error. Is there any
        difference
        > between the library I have just dropped to
        /lib/bundle/installer-exclude
        > an ymsg_network_v0_63.jar? The only difference I see is that
        > ymsg_network_v0_63.jar does not appear in that folder from
        eclipse and
        > the mine does. Of course both are in
        /lib/bundle/installer-exclude.

        (You mean lib/installer-exclude right?)

        Afraid, I have no ideas other than asking you to send your
        jar-ed plugin
        if this is an option for you.

        Cheers
        Emil
        >
        > Any idea?. Again, thank you very much.
        >
        > Kind Regards,
        > Oscar
        >
        >
        >
        > 2008/11/8 Emil Ivov <emcho@sip-communicator.org
        <mailto:emcho@sip-communicator.org>
        > <mailto:emcho@sip-communicator.org
        <mailto:emcho@sip-communicator.org>>>
        >
        > Hey Oscar,
        >
        > (comments inline)
        >
        > --sent from my mobile.
        >
        > On 8 nov. 08, at 19:18, "Óscar Sánchez" > > <oscarsancheziglesias@gmail.com > <mailto:oscarsancheziglesias@gmail.com> > > <mailto:oscarsancheziglesias@gmail.com > <mailto:oscarsancheziglesias@gmail.com>>> wrote:
        >
        >> Hi Emil,
        >>
        >> In fact I have still problems. I thought it was ok
        because I have
        >> no error when rebuild and run SC. But the first time I
        try to use
        >> a external library within the new plugin I get an
        exception uncatched.
        >
        > Would help to know what it is. Could you pls send it if
        the below
        > does not help.
        >
        >> What I did was:
        >> I dropped the libraries in the lib/installer-exclude
        directory.
        >> I added a line in felix.client.run.properties in
        >> felix.auto.start.67= \
        >> reference:file:lib/installer-exclude/newlibrary.jar \
        >> And I have also added the packages I need in the manifest
        of the
        >> new plugin.
        >>
        >> Is all that correct? Do I miss something?
        >
        > You need to make a bundle for the new library. In your
        case this
        > basically comes down to adding a manifest file that
        specifies which
        > packages this new bundle is going to export.
        >
        > You can have a look at what we do with log4j in build.xml
        since it
        > would most probably work for you too. Note that if you
        decide to do
        > things the same way and generate your bundle on every
        build then
        > you'd also need to change the corresponding line in
        felix.client.run
        > so that it points to the generated bundle.
        >
        > Hope this helps.
        > Emil
        >>
        >>
        >> I also need to add in the ld.library.path some .dll so I have
        >> added in build.xml
        >> <condition property="ld.library.path"
        >>
        >>
        value="\{lib\}/native/linux:{system.LD_LIBRARY_PATH}:/addingPath">
        >> <isset property="is.running.linux"/>
        >> </condition>
        >> But I think that is ok, isn't it?
        >>
        >> Thank you very much
        >>
        >> Kind Regards,
        >> Oscar
        >>
        >>
        >> 2008/11/7 Emil Ivov <
        >> <mailto:emcho@sip-communicator.org
        <mailto:emcho@sip-communicator.org>>emcho@sip-communicator.org
        <mailto:emcho@sip-communicator.org>
        >> <mailto:emcho@sip-communicator.org
        <mailto:emcho@sip-communicator.org>>>
        >>
        >> Cool! Glad you have it sorted out!
        >>
        >> Cheers
        >> Emil
        >>
        >> Óscar Sánchez wrote:
        >> > Hi,
        >> >
        >> > The first option goes well
        >> > Thanks.
        >> >
        >> > 2008/11/7 Óscar Sánchez <
        >> <mailto:oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>>oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>
        >> <mailto:oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>>
        >> > <mailto:
        >> <mailto:oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>>oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>
        >> <mailto:oscarsancheziglesias@gmail.com
        <mailto:oscarsancheziglesias@gmail.com>>>>
        >> >
        >> > Hi,
        >> >
        >> >
        >> > I would like to add external libraries on SC. I
        tried to
        >> do what I found in
        >> > the mail-list but I did not success. Could
        someone help
        >> me with this?
        >> >
        >> >
        >> > Thank you very much in advance.
        >> >
        >> > Sorry about send this email wrong before, my email
        >> client became crazy./
        >> >
        >> > The thing is that you have to let felix know
        these libs
        >> exist before
        >> >
        >> >
        >> > your plugin can use them. There are three ways
        to do this:
        >> >
        >> >
        >> > 1. You make the libs run as bundles in which
        case you
        >> have to declare
        >> >
        >> >
        >> >
        >> > the packages they export in their manifest
        files and
        >> then modify
        >> > felix.client.run.properties to run them.
        >> >
        >> >
        >> > /I will try this now. I wanted to try it before
        send the
        >> whole email.Sorry again./
        >> >
        >> >
        >> >
        >> >
        >> > 2. Add your libs to the classpath and add the
        packages
        >> you are going to
        >> >
        >> >
        >> >
        >> > use to the org.osgi.framework.system.packages
        property in
        >> > felix.client.run.properties.
        >> >
        >> >
        >> >
        >> >
        >> > /I have added the external libraries to the
        project and
        >> in eclipse->run->Classpath.
        >> > And I added the packages to
        >> org.osgi.framework.system.packages property in
        >> >
        >> >
        >> >
        >> > felix.client.run.properties. But I got that
        error when
        >> running SC.
        >> > I did not change anything in build.xml. May I
        change
        >> something on it?
        >> >
        >> >
        >> >
        >> > How can I import to bundle 1326?
        >> >
        >> > //Caused by: java.lang.ClassNotFoundException:
        >> >
        >> >
        >> >
        >> > *** Class 'gov.nasa.worldwind.layers.Layer'
        was not
        >> found because bundle
        >> > 1326 does not import
        'gov.nasa.worldwind.layers' even
        >> though bundle 0
        >> > does export it. Additionally, the class is also
        >> available from the system
        >> >
        >> >
        >> >
        >> > class loader. There are two fixes: 1) Add an
        import for
        >> 'gov.nasa.worldwind.layers'
        >> > to bundle 1326; imports are necessary for each
        class
        >> directly touched by bundle
        >> > code or indirectly touched, such as super
        classes if
        >> their methods are used.
        >> >
        >> >
        >> >
        >> > 2) Add package 'gov.nasa.worldwind.layers' to the
        >> 'org.osgi.framework.bootdelegation'
        >> > property; a library or VM bug can cause
        classes to be
        >> loaded by the wrong
        >> > class loader. The first approach is preferable for
        >> preserving modularity. ***/
        >> >
        >> >
        >> >
        >> >
        >> > 3. Include their content inside your plugin
        jar. One way
        >> to do this is
        >> >
        >> >
        >> >
        >> > using the zipfileset tag inside the jar task that
        >> creates your plugin
        >> > bundle.
        >> >
        >> >
        >> >
        >> > /I tried to do it like is below. But I got the next
        >> error. With out the libraries the examplepluginW is ok.
        >> >
        >> >
        >> > ERROR: Error starting
        >> reference:file:sc-bundles/examplepluginW.jar
        >> > (org.osgi.framework.BundleException:
        >> >
        >> >
        >> > Not found:
        >>
        net.java.sip.communicator.plugin.examplepluginW.ExamplePluginWActivator/
        >> >
        >> > /<!-- BUNDLE-PLUGIN-EXAMPLE PLUGINW -->
        >> >
        >> >
        >> > <target name="bundle-plugin-examplepluginW">
        >> > <!-- Creates a bundle for the plugin SIP Account
        >> Registration Wizard.-->
        >> > <jar compress="false"
        >> destfile="\{bundles\.dest\}/examplepluginW\.jar&quot; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;manifest=&quot;{src}/net/java/sip/communicator/plugin/examplepluginW/examplepluginW.manifest.mf">
        >> > <zipfileset
        >>
        dir="${dest}/net/java/sip/communicator/plugin/examplepluginW"
        >> >
        >>
         prefix="net/java/sip/communicator/plugin/examplepluginW"/>
        >> >
        >> >
        >> > <zipfileset
        >>
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/worldwind.jar"
        >> prefix=""/>
        >> > <zipfileset
        >>
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/gluegen-rt.jar"
        >> prefix=""/>
        >> >
        >> >
        >> > <zipfileset
        >>
        src="/work/nestor/dk429/sip-communicator/lib/installer-exclude/jogl.jar"
        >> prefix=""/>
        >> > </jar>
        >> > </target>
        >> >
        >> >
        >> >
        >> >
        >>
        >>
        >>
        ---------------------------------------------------------------------
        >> To unsubscribe, e-mail:
        >>
        <mailto:users-unsubscribe@sip-communicator.dev.java.net
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>>users-unsubscribe@sip-communicator.dev.java.net
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>
        >>
        <mailto:users-unsubscribe@sip-communicator.dev.java.net
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>>
        >> For additional commands, e-mail:
        >> <mailto:users-help@sip-communicator.dev.java.net
        <mailto:users-help@sip-communicator.dev.java.net>>users-help@sip-communicator.dev.java.net
        <mailto:users-help@sip-communicator.dev.java.net>
        >> <mailto:users-help@sip-communicator.dev.java.net
        <mailto:users-help@sip-communicator.dev.java.net>>
        >>
        >>
        >

        ---------------------------------------------------------------------
        To unsubscribe, e-mail:
        users-unsubscribe@sip-communicator.dev.java.net
        <mailto:users-unsubscribe@sip-communicator.dev.java.net>
        For additional commands, e-mail:
        users-help@sip-communicator.dev.java.net
        <mailto:users-help@sip-communicator.dev.java.net>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net