Protege plugin export error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Protege plugin export error

Daniel Schober
Dear Protege developers,

I have created a Protege plugin using Eclipse and it works fine if I
start it from within Eclipse ( Run As > OSGI Framework ), but when I
tried exporting the plugin, after I placed all (or so I believe) the
necessary files within the jar, I get the following error when trying to
use the plugin:

java.lang.NoSuchMethodError:
org.protege.editor.owl.model.OWLModelManager.getOWLEntityFinder()Lorg/protege/editor/owl/model/find/OWLEntityFinder;
     at
org.coode.taxonomy.OntoCheck.getAnnotationsInOntology(OntoCheck.java:867)
     at org.coode.taxonomy.OntoCheck.initialiseClassView(OntoCheck.java:64)
     at
org.protege.editor.owl.ui.view.cls.AbstractOWLClassViewComponent.initialiseView(AbstractOWLClassViewComponent.java:28)
     at
org.protege.editor.owl.ui.view.AbstractOWLSelectionViewComponent.initialiseOWLView(AbstractOWLSelectionViewComponent.java:105)
     at
org.protege.editor.owl.ui.view.AbstractOWLViewComponent.initialise(AbstractOWLViewComponent.java:56)
     at org.protege.editor.core.ui.view.View.createContent(View.java:390)
     at org.protege.editor.core.ui.view.View.createUI(View.java:190)
     at
org.protege.editor.core.ui.view.View$1.hierarchyChanged(View.java:120)
...

My class extends ModelManager. The thing is that the OWLModelManager is
an interface, but OWLModelManagerImpl (that is also contained in my jar
file) implements this function. So I have no clue what causes the error.
Any idea how to fix the issue ?

Regards,

Ilinca tudose & Daniel Schober

--

-------------------------------------------------------------
   Dr. Daniel Schober
   Universitätsklinikum
   Institut für Medizinische Biometrie und Medizinische Informatik
   Stefan-Meier-Strasse  26 Raum 6
   D-79104 Freiburg Germany
   Tel: +49 (0)761 2036807 FAX: +49 (0)761 2036711


Freiburg   ...     wo die Babys mit Fahrradhelm zur Welt kommen.










_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Protege plugin export error

Maurice Rabb

Sent from my LG phone

Daniel Schober <[hidden email]> wrote:


Dear Protege developers,

I have created a Protege plugin using Eclipse and it works fine if I
start it from within Eclipse ( Run As > OSGI Framework ), but when I
tried exporting the plugin, after I placed all (or so I believe) the
necessary files within the jar, I get the following error when trying to
use the plugin:

java.lang.NoSuchMethodError:
org.protege.editor.owl.model.OWLModelManager.getOWLEntityFinder()Lorg/protege/editor/owl/model/find/OWLEntityFinder;
     at
org.coode.taxonomy.OntoCheck.getAnnotationsInOntology(OntoCheck.java:867)
     at org.coode.taxonomy.OntoCheck.initialiseClassView(OntoCheck.java:64)
     at
org.protege.editor.owl.ui.view.cls.AbstractOWLClassViewComponent.initialiseView(AbstractOWLClassViewComponent.java:28)
     at
org.protege.editor.owl.ui.view.AbstractOWLSelectionViewComponent.initialiseOWLView(AbstractOWLSelectionViewComponent.java:105)
     at
org.protege.editor.owl.ui.view.AbstractOWLViewComponent.initialise(AbstractOWLViewComponent.java:56)
     at org.protege.editor.core.ui.view.View.createContent(View.java:390)
     at org.protege.editor.core.ui.view.View.createUI(View.java:190)
     at
org.protege.editor.core.ui.view.View$1.hierarchyChanged(View.java:120)
...

My class extends ModelManager. The thing is that the OWLModelManager is
an interface, but OWLModelManagerImpl (that is also contained in my jar
file) implements this function. So I have no clue what causes the error.
Any idea how to fix the issue ?

Regards,

Ilinca tudose & Daniel Schober

--

-------------------------------------------------------------
   Dr. Daniel Schober
   Universitätsklinikum
   Institut für Medizinische Biometrie und Medizinische Informatik
   Stefan-Meier-Strasse  26     Raum 6
   D-79104 Freiburg             Germany
   Tel: +49 (0)761 2036807      FAX: +49 (0)761 2036711


Freiburg   ...     wo die Babys mit Fahrradhelm zur Welt kommen.










_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Protege plugin export error

Maurice Rabb
No one was more surprised to see that I had "answered" your post than
me.  Sorry for the tease Daniel.  My android phone has a mind of its
own. ;-)

-Maurice


On 7/29/11 8:43 AM, Rabb, Maurice wrote:
> Sent from my LG phone
>
> Daniel Schober<[hidden email]>  wrote:
>
>
> Dear Protege developers,
>

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Protege plugin export error

Timothy Redmond
In reply to this post by Maurice Rabb

So I have no clue what causes the error.
Any idea how to fix the issue ?


I can think of several (too many) possibilities.  If you can send me the jar file or even the manifest that is in the jar file there is a very good chance that I can give you the right answer.

First of all, are there any caused-by statements in the full stack trace?  It seems like it may be some sort of class loading problem but the exception is a NoSuchMethodError. 

Are you familiar with the OSGi class loading mechanism?  The manifest (META-INF/MANIFEST.MF) controls where classes are loaded from.  In particular to load classes such as

org.protege.editor.owl.model.OWLModelManager
org.protege.editor.owl.model.find.OWLEntityFinder

you either need to have entries requiring the org.protege.editor.owl bundle in the Require-Bundle part of the manifest or you need to include the packages

org.protege.editor.owl.model
org.protege.editor.owl.model.find

in the Import-Package declaration.  For example the Require-Bundle declaration from the org.coode.dlquery plugin looks like this:

Require-Bundle: org.eclipse.equinox.registry,
 org.eclipse.equinox.common,
 org.protege.editor.core.application,
 org.protege.editor.owl,
 org.semanticweb.owl.owlapi

which allows it to load classes from the org.protege.editor.core.application and org.protege.editor.owl bundles.  Eclipse has tools to help you get the declarations in the MANIFEST right.  If I saw the manifest that is contained in the jar file I could see if this is an issue.

Also I am wondering if you are including either the jars or the classes from the Protege distribution in your jar file.  If so there is a possibility that you are getting collisions between two distinct and different versions of the org.protege.editor.owl.model.ModelManager class.  (One which is supplied by the standard Protege bundles and one which is supplied by your plugin.)  When these collide you will get unexpected results.  One thing that made me think of this possibility was when you said

The thing is that the OWLModelManager is
an interface, but OWLModelManagerImpl (that is also contained in my jar
file) implements this function.

If the OWLModelManagerImpl is included in your jar and loaded by your jar then it will be a different class than the one used by Protege and this could lead to problems.  I could detect this by looking at your jar file. 

There is a plugin [1] that helps debug class loading problems.  I have attached a screen shot showing that the

org.protege.editor.owl.model.OWLModelManager

class is supplied by the Protege 4 OWL editor only.  If there were two blue nodes (both supplying versions of this class) then you are either a very advanced user or - especially for this class - there is a problem.

Finally, I am surprised that you are writing your own implementation of the ModelManager interface.  This would make sense if you were planning on writing your own separate ontology editor (e.g. we are ultimately planning on writing an rdf editor).  But to interact with the OWL editor system it seems  a bit strange.  The model manager class plays a central role in Protege and it is not clear how you would use a different version.

-Timothy

[1] http://code.google.com/p/protege/downloads/detail?name=org.protege.osgi.debug-1.0.0.jar&can=2&q=

On 07/29/2011 06:43 AM, Rabb, Maurice wrote:
Sent from my LG phone

Daniel Schober [hidden email] wrote:


Dear Protege developers,

I have created a Protege plugin using Eclipse and it works fine if I
start it from within Eclipse ( Run As > OSGI Framework ), but when I
tried exporting the plugin, after I placed all (or so I believe) the
necessary files within the jar, I get the following error when trying to
use the plugin:

java.lang.NoSuchMethodError:
org.protege.editor.owl.model.OWLModelManager.getOWLEntityFinder()Lorg/protege/editor/owl/model/find/OWLEntityFinder;
     at
org.coode.taxonomy.OntoCheck.getAnnotationsInOntology(OntoCheck.java:867)
     at org.coode.taxonomy.OntoCheck.initialiseClassView(OntoCheck.java:64)
     at
org.protege.editor.owl.ui.view.cls.AbstractOWLClassViewComponent.initialiseView(AbstractOWLClassViewComponent.java:28)
     at
org.protege.editor.owl.ui.view.AbstractOWLSelectionViewComponent.initialiseOWLView(AbstractOWLSelectionViewComponent.java:105)
     at
org.protege.editor.owl.ui.view.AbstractOWLViewComponent.initialise(AbstractOWLViewComponent.java:56)
     at org.protege.editor.core.ui.view.View.createContent(View.java:390)
     at org.protege.editor.core.ui.view.View.createUI(View.java:190)
     at
org.protege.editor.core.ui.view.View$1.hierarchyChanged(View.java:120)
...

My class extends ModelManager. The thing is that the OWLModelManager is
an interface, but OWLModelManagerImpl (that is also contained in my jar
file) implements this function. So I have no clue what causes the error.
Any idea how to fix the issue ?

Regards,

Ilinca tudose & Daniel Schober

--

-------------------------------------------------------------
   Dr. Daniel Schober
   Universitätsklinikum
   Institut für Medizinische Biometrie und Medizinische Informatik
   Stefan-Meier-Strasse  26     Raum 6
   D-79104 Freiburg             Germany
   Tel: +49 (0)761 2036807      FAX: +49 (0)761 2036711


Freiburg   ...     wo die Babys mit Fahrradhelm zur Welt kommen.










_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

ClassLoading.png (181K) Download Attachment