Home » Eclipse Projects » Eclipse Platform » Classes in a jar within a plugin are not visible to other plugins
Classes in a jar within a plugin are not visible to other plugins [message #331122] |
Tue, 26 August 2008 09:11  |
Eclipse User |
|
|
|
Originally posted by: bruce.skingle.org
Previously posted to the PDE group without response, can anyone here
give me a pointer on this?
Thanks,
Bruce.
I have a plugin which is a wrapper around a jar file. The plugin
contains an Activator, a view and the jar file. Other plugins need to be
able to access classes in the jar file.
When I create a second plugin in my development workbench everything is
fine, I add the first plugin as a dependency in the manifest of the
second plugin and I can instatntiate classes from the jar.
When I create a feature and update site, install a new copy of Eclipse
and use the update site to install my first plugin, containing the jar,
the plugin appears, but when I create another plugin and try to use
classes from the first plugin, I can see the Activator and the view
(i.e. classes built as part of the plugin) but nothing contained in the
jar. The jar itself is present, and the view, which calls classes in the
jar file works fine.
The jar file is on the plugin classpath and all of the packages in the
jar are in the Exported Packages list on the runtime tab of the manifest.
Normally I would use the "Plugin from existing jar" wizard to explode
the jar file into my plugin, but in this case the jar file is a signed
JCE provider (http://www.bouncycastle.org) so I cannot so this.
Am I missing something or is this a real limitation of the runtime?
Thanks,
Bruce.
|
|
|
Re: Classes in a jar within a plugin are not visible to other plugins [message #331126 is a reply to message #331122] |
Tue, 26 August 2008 12:26   |
Eclipse User |
|
|
|
Originally posted by: krzysztof.daniel.gmail.com
I am not sure if this will be correct, but I think that this answer is
better than no answer.
First of all I have faced the same problem when I tried to write some
demo app using java mail.
The solution seems to be simple (right click on the plugin, select PDE
Tools -> Update classpath). That is what worked for me (but I used
bruteforce strategy to test those functions).
Check please if you have in your Manifest.MF file similar section:
Bundle-ClassPath: .,
lib/dsn.jar,
lib/imap.jar,
lib/mail.jar,
lib/mailapi.jar,
lib/pop3.jar,
lib/smtp.jar
I guess it is responsible for exposing jars to external plugins...
On Tue, 2008-08-26 at 10:11 +0100, Bruce Skingle wrote:
> Previously posted to the PDE group without response, can anyone here
> give me a pointer on this?
>
> Thanks,
> Bruce.
>
> I have a plugin which is a wrapper around a jar file. The plugin
> contains an Activator, a view and the jar file. Other plugins need to be
> able to access classes in the jar file.
>
> When I create a second plugin in my development workbench everything is
> fine, I add the first plugin as a dependency in the manifest of the
> second plugin and I can instatntiate classes from the jar.
>
> When I create a feature and update site, install a new copy of Eclipse
> and use the update site to install my first plugin, containing the jar,
> the plugin appears, but when I create another plugin and try to use
> classes from the first plugin, I can see the Activator and the view
> (i.e. classes built as part of the plugin) but nothing contained in the
> jar. The jar itself is present, and the view, which calls classes in the
> jar file works fine.
>
> The jar file is on the plugin classpath and all of the packages in the
> jar are in the Exported Packages list on the runtime tab of the manifest.
>
> Normally I would use the "Plugin from existing jar" wizard to explode
> the jar file into my plugin, but in this case the jar file is a signed
> JCE provider (http://www.bouncycastle.org) so I cannot so this.
>
> Am I missing something or is this a real limitation of the runtime?
>
> Thanks,
> Bruce.
|
|
|
Re: Classes in a jar within a plugin are not visible to other plugins [message #331367 is a reply to message #331126] |
Wed, 03 September 2008 17:06  |
Eclipse User |
|
|
|
You also need to make sure you export all the packages you want visible
to the outside world.
-Andrew
kdaniel wrote:
> I am not sure if this will be correct, but I think that this answer is
> better than no answer.
>
> First of all I have faced the same problem when I tried to write some
> demo app using java mail.
>
> The solution seems to be simple (right click on the plugin, select PDE
> Tools -> Update classpath). That is what worked for me (but I used
> bruteforce strategy to test those functions).
>
> Check please if you have in your Manifest.MF file similar section:
> Bundle-ClassPath: .,
> lib/dsn.jar,
> lib/imap.jar,
> lib/mail.jar,
> lib/mailapi.jar,
> lib/pop3.jar,
> lib/smtp.jar
>
> I guess it is responsible for exposing jars to external plugins...
>
> On Tue, 2008-08-26 at 10:11 +0100, Bruce Skingle wrote:
>> Previously posted to the PDE group without response, can anyone here
>> give me a pointer on this?
>>
>> Thanks,
>> Bruce.
>>
>> I have a plugin which is a wrapper around a jar file. The plugin
>> contains an Activator, a view and the jar file. Other plugins need to be
>> able to access classes in the jar file.
>>
>> When I create a second plugin in my development workbench everything is
>> fine, I add the first plugin as a dependency in the manifest of the
>> second plugin and I can instatntiate classes from the jar.
>>
>> When I create a feature and update site, install a new copy of Eclipse
>> and use the update site to install my first plugin, containing the jar,
>> the plugin appears, but when I create another plugin and try to use
>> classes from the first plugin, I can see the Activator and the view
>> (i.e. classes built as part of the plugin) but nothing contained in the
>> jar. The jar itself is present, and the view, which calls classes in the
>> jar file works fine.
>>
>> The jar file is on the plugin classpath and all of the packages in the
>> jar are in the Exported Packages list on the runtime tab of the manifest.
>>
>> Normally I would use the "Plugin from existing jar" wizard to explode
>> the jar file into my plugin, but in this case the jar file is a signed
>> JCE provider (http://www.bouncycastle.org) so I cannot so this.
>>
>> Am I missing something or is this a real limitation of the runtime?
>>
>> Thanks,
>> Bruce.
>
|
|
|
Goto Forum:
Current Time: Sat Feb 15 11:25:50 GMT 2025
Powered by FUDForum. Page generated in 0.04846 seconds
|