Login  Register

Re: plugins.config "Plugin or class not found:" exception

Posted by Volker Baecker on Jan 30, 2009; 3:45pm
URL: http://imagej.273.s1.nabble.com/plugins-config-Plugin-or-class-not-found-exception-tp3693885p3693889.html

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
I think there must be a misunderstanding somewhere. What I proposed in
the best practices workshop is to separate the implementation of the
plugin interface (let's call it A) from the code actually doing the work
(let's call it B). A should only care about plugin specific things and
use the api of B. A is in the default package and has an underscore in
the name. B is not in the default package. B can be distributed over
many packages each part being in a package according to what it does.

The main advantage of this scheme is that the functionality of your code
is available as a library, that can be used from any other code, without
passing by the ImageJ "run" mechanism.

To install your plugin, you can create a .jar containing all the
packages used by B and put the jar and the class file of A in a
subfolder of the plugin folder.

Best regards,
Volker Bäcker

Jeffrey B. Woodward a écrit :

> When I package things, I put my jars that are equivalent to your
> "Bone_Geometry.jar" in the directory ~/ImageJ/plugins/jars, and as you
> said, I put the plugins.config in the root directory of said jar file.
>
> Hope that helps/works for you,
>
> -Woody
>
>
> Michael Doube wrote:
>> Hi All
>>
>> I'm having trouble getting tidy menu items for my plugins.
>>
>> I followed the IJ-Eclipse best practice instructions from the IJ
>> conference in Luxembourg and started putting my plugins in packages,
>> e.g. in Fit_Sphere.java
>>
>> package org.doube.bone_geometry;
>>
>> But then I get lots of levels of menus before I can select a plugin,
>> which is a pain, e.g.:
>> Plugins>org>doube>bone_geometry>Fit Sphere
>>
>> So I wrote a plugins.config file, using these instructions:
>> https://list.nih.gov/cgi-bin/wa?A2=ind0804&L=IMAGEJ&P=R5626&I=-3
>> http://imagejdocu.tudor.lu/doku.php?id=howto:plugins:howto_create_an_imagej_plugin_jar_file
>>
>>
>> But if I put this in my plugins.config:
>> Plugins>Bone Geometry, "Fit Sphere",
>> org.doube.bone_geometry.Fit_Sphere("")
>>
>> I get the menu entry Plugins>Bone Geometry>Fit Sphere, but running it
>> throws this exception:
>> Plugin or class not found: "org.doube.bone_geometry.Fit_Sphere
>> (java.lang.ClassNotFoundException: org.doube.bone_geometry.Fit_Sphere)
>>
>> Bone_Geometry.jar is saved in ~/ImageJ/plugins/ and plugins.config is
>> in the root directory of the jar, and all the class files are in
>> /org/doube/bone_geometry/ within the jar.
>>
>> How can I fix this?
>>
>> Cheers
>>
>> Mike
>>
>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgyCwxZKX7A/4oMERAo+HAJ0WAaRel7tmDWh1wpaHU9WJGpa2qgCdFNbq
Td1Ujs8ih5yw5dcOHi9+dfg=
=uD4s
-----END PGP SIGNATURE-----

--
passerelle antivirus du campus CNRS de Montpellier
--