Writing plugin results in ClassNotFoundException

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

Writing plugin results in ClassNotFoundException

Lorenz Buehmann
Hello,

I'm trying to get my plugin working on Protege 5.0 beta by using the
Maven Bundle Plugin as shown in
https://github.com/protegeproject/protege-plugin-examples .


My MANIFEST.MF looks as follows:

Manifest-Version: 1.0
Bnd-LastModified: 1422267577834
Build-Jdk: 1.8.0_31
Built-By: me
Bundle-Activator: org.protege.editor.owl.ProtegeOWL
Bundle-ClassPath: .,lib/components-core-2.0-SNAPSHOT.jar,lib/org.protege
  .editor.owl-4.3.0.jar,lib/browserlauncher2-1.3.jar,lib/swingx-1.6.jar,l
  ib/looks-2.2.2.jar,lib/jamon-2.7.jar,lib/json-20090211.jar
Bundle-ManifestVersion: 2
Bundle-Name: DL-Learner Protege Plugin
Bundle-SymbolicName: protege;singleton:=true
Bundle-Vendor: DL-Learner Project
Bundle-Version: 2.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embed-Directory: lib
Embedded-Artifacts: lib/components-core-2.0-SNAPSHOT.jar;g="org.dllearne
  r";a="components-core";v="2.0-SNAPSHOT",lib/org.protege.editor.owl-4.3.
  0.jar;g="edu.stanford.protege";a="org.protege.editor.owl";v="4.3.0",lib
  /browserlauncher2-1.3.jar;g="net.sourceforge.browserlauncher2";a="brows
  erlauncher2";v="1.3",lib/swingx-1.6.jar;g="org.swinglabs";a="swingx";v=
  "1.6",lib/looks-2.2.2.jar;g="com.jgoodies";a="looks";v="2.2.2",lib/jamo
  n-2.7.jar;g="com.jamonapi";a="jamon";v="2.7",lib/json-20090211.jar;g="o
  rg.json";a="json";v="20090211"
Export-Package: org.dllearner.tools.protege;uses:="javax.swing,javax.swi
  ng.event,javax.swing.table,org.protege.editor.core,org.protege.editor.c
  ore.ui.util,org.semanticweb.owlapi.model,org.semanticweb.owlapi.reasone
  r";version="2.0.0.SNAPSHOT"
Import-Package: org.apache.log4j;version="[1.2,2)",org.protege.editor.ow
  l;version="4.3",org.protege.editor.owl.model;version="4.3",org.protege.
  editor.owl.model.event;version="4.3",org.protege.editor.owl.model.selec
  tion;version="4.3",org.protege.editor.owl.ui;version="4.3",org.protege.
  editor.owl.ui.action;version="4.3",org.protege.editor.owl.ui.view;versi
  on="4.3",javax.swing,org.semanticweb.owlapi.model,org.protege.editor.core;version="4.3"
Tool: Bnd-2.1.0.20130426-122213


The plugin is designed as a separate tab in the equivalent classes
selector, thus, I extend from AbstractOWLClassExpressionEditor and use
the following entry
point in the plugin.xml:

org.protege.editor.owl.ui_editor_description

When I start Protege verythings works fine, but once I want to assert an
equivalent class expression to a selected class, which obviously forces
the first activation
of the plugin, I get the following exception:

java.lang.NoClassDefFoundError:
org/protege/editor/core/plugin/ProtegePluginInstance
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
     at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
     at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
     at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
     at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
     at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
     at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
     at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
     at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
....
Caused by: java.lang.ClassNotFoundException:
org.protege.editor.core.plugin.ProtegePluginInstance not found by
protege [8]
     at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
     at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
     at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     ... 72 more

I'm pretty sure that I got the plugin working some long time ago, but
now I'm not able to do it again. Any ideas why some classes are not
found although they
should be contained in the main Protege libs?


Kind regards,
Lorenz

--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Writing plugin results in ClassNotFoundException

Matthew Horridge-2
Administrator
Hi Lorenz,

This looks like an OSGI problem at first glance, but it’s difficult for me to tell.  If you clone the plugin-examples repo from GitHub and do a straight build of it does it work?  Also, would you be able to post your code to the list (or send it to me off list) so I could take a look at it?

Cheers,

Matthew



> On 26 Jan 2015, at 04:23, Lorenz Bühmann <[hidden email]> wrote:
>
> Hello,
>
> I'm trying to get my plugin working on Protege 5.0 beta by using the Maven Bundle Plugin as shown in https://github.com/protegeproject/protege-plugin-examples .
>
>
> My MANIFEST.MF looks as follows:
>
> Manifest-Version: 1.0
> Bnd-LastModified: 1422267577834
> Build-Jdk: 1.8.0_31
> Built-By: me
> Bundle-Activator: org.protege.editor.owl.ProtegeOWL
> Bundle-ClassPath: .,lib/components-core-2.0-SNAPSHOT.jar,lib/org.protege
> .editor.owl-4.3.0.jar,lib/browserlauncher2-1.3.jar,lib/swingx-1.6.jar,l
> ib/looks-2.2.2.jar,lib/jamon-2.7.jar,lib/json-20090211.jar
> Bundle-ManifestVersion: 2
> Bundle-Name: DL-Learner Protege Plugin
> Bundle-SymbolicName: protege;singleton:=true
> Bundle-Vendor: DL-Learner Project
> Bundle-Version: 2.0.0.SNAPSHOT
> Created-By: Apache Maven Bundle Plugin
> Embed-Dependency: *;scope=compile|runtime
> Embed-Directory: lib
> Embedded-Artifacts: lib/components-core-2.0-SNAPSHOT.jar;g="org.dllearne
> r";a="components-core";v="2.0-SNAPSHOT",lib/org.protege.editor.owl-4.3.
> 0.jar;g="edu.stanford.protege";a="org.protege.editor.owl";v="4.3.0",lib
> /browserlauncher2-1.3.jar;g="net.sourceforge.browserlauncher2";a="brows
> erlauncher2";v="1.3",lib/swingx-1.6.jar;g="org.swinglabs";a="swingx";v=
> "1.6",lib/looks-2.2.2.jar;g="com.jgoodies";a="looks";v="2.2.2",lib/jamo
> n-2.7.jar;g="com.jamonapi";a="jamon";v="2.7",lib/json-20090211.jar;g="o
> rg.json";a="json";v="20090211"
> Export-Package: org.dllearner.tools.protege;uses:="javax.swing,javax.swi
> ng.event,javax.swing.table,org.protege.editor.core,org.protege.editor.c
> ore.ui.util,org.semanticweb.owlapi.model,org.semanticweb.owlapi.reasone
> r";version="2.0.0.SNAPSHOT"
> Import-Package: org.apache.log4j;version="[1.2,2)",org.protege.editor.ow
> l;version="4.3",org.protege.editor.owl.model;version="4.3",org.protege.
> editor.owl.model.event;version="4.3",org.protege.editor.owl.model.selec
> tion;version="4.3",org.protege.editor.owl.ui;version="4.3",org.protege.
> editor.owl.ui.action;version="4.3",org.protege.editor.owl.ui.view;versi
> on="4.3",javax.swing,org.semanticweb.owlapi.model,org.protege.editor.core;version="4.3"
> Tool: Bnd-2.1.0.20130426-122213
>
>
> The plugin is designed as a separate tab in the equivalent classes selector, thus, I extend from AbstractOWLClassExpressionEditor and use the following entry
> point in the plugin.xml:
>
> org.protege.editor.owl.ui_editor_description
>
> When I start Protege verythings works fine, but once I want to assert an equivalent class expression to a selected class, which obviously forces the first activation
> of the plugin, I get the following exception:
>
> java.lang.NoClassDefFoundError: org/protege/editor/core/plugin/ProtegePluginInstance
>    at java.lang.ClassLoader.defineClass1(Native Method)
>    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
>    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
>    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>    at java.lang.ClassLoader.defineClass1(Native Method)
>    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
>    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
>    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
> ....
> Caused by: java.lang.ClassNotFoundException: org.protege.editor.core.plugin.ProtegePluginInstance not found by protege [8]
>    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
>    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>    ... 72 more
>
> I'm pretty sure that I got the plugin working some long time ago, but now I'm not able to do it again. Any ideas why some classes are not found although they
> should be contained in the main Protege libs?
>
>
> Kind regards,
> Lorenz
>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
> _______________________________________________
> protege-dev mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Writing plugin results in ClassNotFoundException

Lorenz Buehmann
Hello Matthew,

thanks for your reply.

Well, using the plugin-examples works as expected. I pruned down my
plugin code and created a new GitHub repo:
https://github.com/LorenzBuehmann/ProtegePlugin-test

When I run 'mvn clean package' and use the created plugin
target/DL-Learner-Plugin.jar I get now the exception

ERROR: Bundle protege-plugin [8] Error starting
file:/home/me/tools/Protege_5.0_beta/plugins/DL-Learner-Plugin.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle
protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0]
osgi.wiring.package;
(&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle
protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0]
osgi.wiring.package;
(&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0)))

which is indeed some OSGI problem. Once I add an entry for the
org.protege.commons package, i.e.

<Import-Package>
                             org.apache.log4j.*;version="[1.2,2)",
org.protege.editor.owl.*;version="4.3",
org.protege.editor.core.*;version="4.3",
                             org.protege.common.*;version="4.3",
                             *
</Import-Package>

I get another exception that something else is missing. Adding the
missing package as import again, ...,   and so on and so forth.

Probably I do not understand the mechanism of OSGI, but I'm also puzzled
that your example is working. Might be because I use another plugin
type. Or might be that your example was designed for Protege 4.3. I
don't know.

Kind regards,
Lorenz

> Hi Lorenz,
>
> This looks like an OSGI problem at first glance, but it’s difficult for me to tell.  If you clone the plugin-examples repo from GitHub and do a straight build of it does it work?  Also, would you be able to post your code to the list (or send it to me off list) so I could take a look at it?
>
> Cheers,
>
> Matthew
>
>
>
>> On 26 Jan 2015, at 04:23, Lorenz Bühmann <[hidden email]> wrote:
>>
>> Hello,
>>
>> I'm trying to get my plugin working on Protege 5.0 beta by using the Maven Bundle Plugin as shown in https://github.com/protegeproject/protege-plugin-examples .
>>
>>
>> My MANIFEST.MF looks as follows:
>>
>> Manifest-Version: 1.0
>> Bnd-LastModified: 1422267577834
>> Build-Jdk: 1.8.0_31
>> Built-By: me
>> Bundle-Activator: org.protege.editor.owl.ProtegeOWL
>> Bundle-ClassPath: .,lib/components-core-2.0-SNAPSHOT.jar,lib/org.protege
>> .editor.owl-4.3.0.jar,lib/browserlauncher2-1.3.jar,lib/swingx-1.6.jar,l
>> ib/looks-2.2.2.jar,lib/jamon-2.7.jar,lib/json-20090211.jar
>> Bundle-ManifestVersion: 2
>> Bundle-Name: DL-Learner Protege Plugin
>> Bundle-SymbolicName: protege;singleton:=true
>> Bundle-Vendor: DL-Learner Project
>> Bundle-Version: 2.0.0.SNAPSHOT
>> Created-By: Apache Maven Bundle Plugin
>> Embed-Dependency: *;scope=compile|runtime
>> Embed-Directory: lib
>> Embedded-Artifacts: lib/components-core-2.0-SNAPSHOT.jar;g="org.dllearne
>> r";a="components-core";v="2.0-SNAPSHOT",lib/org.protege.editor.owl-4.3.
>> 0.jar;g="edu.stanford.protege";a="org.protege.editor.owl";v="4.3.0",lib
>> /browserlauncher2-1.3.jar;g="net.sourceforge.browserlauncher2";a="brows
>> erlauncher2";v="1.3",lib/swingx-1.6.jar;g="org.swinglabs";a="swingx";v=
>> "1.6",lib/looks-2.2.2.jar;g="com.jgoodies";a="looks";v="2.2.2",lib/jamo
>> n-2.7.jar;g="com.jamonapi";a="jamon";v="2.7",lib/json-20090211.jar;g="o
>> rg.json";a="json";v="20090211"
>> Export-Package: org.dllearner.tools.protege;uses:="javax.swing,javax.swi
>> ng.event,javax.swing.table,org.protege.editor.core,org.protege.editor.c
>> ore.ui.util,org.semanticweb.owlapi.model,org.semanticweb.owlapi.reasone
>> r";version="2.0.0.SNAPSHOT"
>> Import-Package: org.apache.log4j;version="[1.2,2)",org.protege.editor.ow
>> l;version="4.3",org.protege.editor.owl.model;version="4.3",org.protege.
>> editor.owl.model.event;version="4.3",org.protege.editor.owl.model.selec
>> tion;version="4.3",org.protege.editor.owl.ui;version="4.3",org.protege.
>> editor.owl.ui.action;version="4.3",org.protege.editor.owl.ui.view;versi
>> on="4.3",javax.swing,org.semanticweb.owlapi.model,org.protege.editor.core;version="4.3"
>> Tool: Bnd-2.1.0.20130426-122213
>>
>>
>> The plugin is designed as a separate tab in the equivalent classes selector, thus, I extend from AbstractOWLClassExpressionEditor and use the following entry
>> point in the plugin.xml:
>>
>> org.protege.editor.owl.ui_editor_description
>>
>> When I start Protege verythings works fine, but once I want to assert an equivalent class expression to a selected class, which obviously forces the first activation
>> of the plugin, I get the following exception:
>>
>> java.lang.NoClassDefFoundError: org/protege/editor/core/plugin/ProtegePluginInstance
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>>     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
>>     at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
>>     at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>>     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>     at java.lang.ClassLoader.defineClass1(Native Method)
>>     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>>     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
>>     at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
>>     at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>>     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
>> ....
>> Caused by: java.lang.ClassNotFoundException: org.protege.editor.core.plugin.ProtegePluginInstance not found by protege [8]
>>     at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
>>     at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
>>     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>>     ... 72 more
>>
>> I'm pretty sure that I got the plugin working some long time ago, but now I'm not able to do it again. Any ideas why some classes are not found although they
>> should be contained in the main Protege libs?
>>
>>
>> Kind regards,
>> Lorenz
>>
>> --
>> Lorenz Bühmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>> _______________________________________________
>> protege-dev mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-dev
>
> _______________________________________________
> protege-dev mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-dev
>
--
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Writing plugin results in ClassNotFoundException

Timothy Redmond

When I run 'mvn clean package' and use the created plugin target/DL-Learner-Plugin.jar I get now the exception

ERROR: Bundle protege-plugin [8] Error starting file:/home/me/tools/Protege_5.0_beta/plugins/DL-Learner-Plugin.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0)))

This is happening indirectly because of an "Embed-Dependency" line in the pom.xml:

<!-- embed all compile and runtime scope dependencies -->
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Directory>lib</Embed-Directory>

What this does is to embed a copy of the protege editor jar file into the DL-Learner.jar artifact.  Thus after a "mvn clean install" I find the following:

Neptune:ProtegePlugin-test% unzip -v target/DL-Learner-Plugin.jar 
Archive:  target/DL-Learner-Plugin.jar
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    3131  Defl:N     1036  67% 02-01-2015 15:43 b0754150  META-INF/MANIFEST.MF
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/org.dllearner/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/org.dllearner/protege-plugin/
     138  Defl:N      124  10% 02-01-2015 15:43 a5f85824  META-INF/maven/org.dllearner/protege-plugin/pom.properties
    2167  Defl:N      786  64% 02-01-2015 15:31 78c7e9da  META-INF/maven/org.dllearner/protege-plugin/pom.xml
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  lib/
 2228948  Defl:N  1930752  13% 02-01-2015 15:29 8c04efeb  lib/org.protege.editor.owl-4.3.0.jar                  <-------------- org.protege.editor.owl is embedded
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/tools/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/tools/protege/
    4325  Defl:N     1664  62% 02-01-2015 15:43 74214a81  org/dllearner/tools/protege/DLLearnerProtegePlugin.class
     227  Defl:N      176  23% 02-01-2015 10:15 38cd5ef6  package.html
     439  Defl:N      234  47% 02-01-2015 10:15 bb37981b  plugin.properties
     372  Defl:N      188  50% 02-01-2015 10:15 9e040dc3  plugin.xml
--------          -------  ---                            -------
 2239747          1934978  14%                            17 files
Neptune:ProtegePlugin-test% 

This embedded jar file is also reflected in the MANIFEST.MF which includes the line

Bundle-ClassPath: .,lib/org.protege.editor.owl-4.3.0.jar

This is not going to work with Protege in the best of all possible worlds because the Protege classes loaded by the DL-Learner-Plugin.jar bundle will be incompatible with the classes used by the Protege installation.  This would be the case even if the code-base of the embedded jar file was identical to the code-base of the Protege installation.  Classes from the one source could not be cast to classes of the other.

In your case, I think the DL-Learner-Plugin.jar is looking for dependencies of a Protege 4.3.0 plugin in a Protege 5.0.0 world and is not finding them.

If the Embed-Dependency lines are removed everything works.  Protege starts without exceptions:
sh run.sh
Starting Protege Desktop (Version 5.0.0, Build = beta-16-SNAPSHOT)
Platform:
    Java: JVM 1.8.0_31-b13 Memory: 466M
    Language: en, Country: US
    Framework: Apache Software Foundation (1.5)
    OS: linux (3.18.3-201.fc21.x86_64)
    Processor: x86-64
Plugin: DL-Learner Protege Plugin (1.0.0.RC1)
Plugin: Guava: Google Core Libraries for Java (17.0.0)
Plugin: Protege SPARQL Plugin (1.0.0)
Plugin: Protege Editor OWL (5.0.0.beta-16-SNAPSHOT)
Plugin: Protege HermiT Integration (1.0.0)
Plugin: OWLViz (4.1.4)
Plugin: OWL Difference (4.1.1)
Plugin: DL Query (1.1.4)
Plugin: OntoGraf (1.0.3)
Plugin: owlapi-osgidistribution (3.5.1)
Plugin: OWLAPI RDF Library (1.0.2)
Plugin: Explanation Workbench (1.0.0)
Plugin: OWL Code Generation Plug-in (1.0.2)
Plugin: OWL Difference Engine (1.0.1)
Plugin: Cajun Visualization Library (1.0.2)
	Guava: Google Core Libraries for Java Plugin has no plugin.xml resource
	owlapi-osgidistribution Plugin has no plugin.xml resource
	OWLAPI RDF Library Plugin has no plugin.xml resource
	OWL Difference Engine Plugin has no plugin.xml resource
	Cajun Visualization Library Plugin has no plugin.xml resource
Using OWL API version 3.5.1
Rebuilding entity indices...
... rebuilt in 4 ms
Setting active ontology to OntologyID(OntologyIRI(<http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25>))
Rebuilding entity indices...
... rebuilt in 3 ms
... active ontology changed
Cannot generate ontology catalog for ontology at http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25
Setting active ontology to OntologyID(OntologyIRI(<http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25>))
Rebuilding entity indices...
... rebuilt in 2 ms
... active ontology changed
Auto-update last performed: Sun Feb 01 15:25:30 PST 2015
Auto-update has been run today.  Not running it again.
The DL-Learner-Plugin does not have any embedded protege artifacts:

Neptune:ProtegePlugin-test% unzip -v target/DL-Learner-Plugin.jar Archive:  target/DL-Learner-Plugin.jar
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    1027  Defl:N      428  58% 02-01-2015 15:53 f9609f5e  META-INF/MANIFEST.MF
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/org.dllearner/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/org.dllearner/protege-plugin/
     138  Defl:N      125   9% 02-01-2015 15:53 b1fe1758  META-INF/maven/org.dllearner/protege-plugin/pom.properties
    1990  Defl:N      720  64% 02-01-2015 15:53 1d200984  META-INF/maven/org.dllearner/protege-plugin/pom.xml
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/tools/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/tools/protege/
    4325  Defl:N     1664  62% 02-01-2015 15:53 74214a81  org/dllearner/tools/protege/DLLearnerProtegePlugin.class
     227  Defl:N      176  23% 02-01-2015 10:15 38cd5ef6  package.html
     439  Defl:N      234  47% 02-01-2015 10:15 bb37981b  plugin.properties
     372  Defl:N      188  50% 02-01-2015 10:15 9e040dc3  plugin.xml
--------          -------  ---                            -------
    8518             3551  58%                            15 files
Neptune:ProtegePlugin-test% 

There are some cases where you want to embed selected dependencies (some of the Protege artifacts do this) and if you are having trouble with this case, I can look into it.

-Timothy



On 01/30/2015 03:28 AM, Lorenz Bühmann wrote:
Hello Matthew,

thanks for your reply.

Well, using the plugin-examples works as expected. I pruned down my plugin code and created a new GitHub repo: https://github.com/LorenzBuehmann/ProtegePlugin-test

When I run 'mvn clean package' and use the created plugin target/DL-Learner-Plugin.jar I get now the exception

ERROR: Bundle protege-plugin [8] Error starting file:/home/me/tools/Protege_5.0_beta/plugins/DL-Learner-Plugin.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0)))

which is indeed some OSGI problem. Once I add an entry for the org.protege.commons package, i.e.

<Import-Package>
                            org.apache.log4j.*;version="[1.2,2)",
org.protege.editor.owl.*;version="4.3",
org.protege.editor.core.*;version="4.3",
                            org.protege.common.*;version="4.3",
                            *
</Import-Package>

I get another exception that something else is missing. Adding the missing package as import again, ...,   and so on and so forth.

Probably I do not understand the mechanism of OSGI, but I'm also puzzled that your example is working. Might be because I use another plugin type. Or might be that your example was designed for Protege 4.3. I don't know.

Kind regards,
Lorenz

Hi Lorenz,

This looks like an OSGI problem at first glance, but it’s difficult for me to tell.  If you clone the plugin-examples repo from GitHub and do a straight build of it does it work?  Also, would you be able to post your code to the list (or send it to me off list) so I could take a look at it?

Cheers,

Matthew



On 26 Jan 2015, at 04:23, Lorenz Bühmann [hidden email] wrote:

Hello,

I'm trying to get my plugin working on Protege 5.0 beta by using the Maven Bundle Plugin as shown in https://github.com/protegeproject/protege-plugin-examples .


My MANIFEST.MF looks as follows:

Manifest-Version: 1.0
Bnd-LastModified: 1422267577834
Build-Jdk: 1.8.0_31
Built-By: me
Bundle-Activator: org.protege.editor.owl.ProtegeOWL
Bundle-ClassPath: .,lib/components-core-2.0-SNAPSHOT.jar,lib/org.protege
.editor.owl-4.3.0.jar,lib/browserlauncher2-1.3.jar,lib/swingx-1.6.jar,l
ib/looks-2.2.2.jar,lib/jamon-2.7.jar,lib/json-20090211.jar
Bundle-ManifestVersion: 2
Bundle-Name: DL-Learner Protege Plugin
Bundle-SymbolicName: protege;singleton:=true
Bundle-Vendor: DL-Learner Project
Bundle-Version: 2.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embed-Directory: lib
Embedded-Artifacts: lib/components-core-2.0-SNAPSHOT.jar;g="org.dllearne
r";a="components-core";v="2.0-SNAPSHOT",lib/org.protege.editor.owl-4.3.
0.jar;g="edu.stanford.protege";a="org.protege.editor.owl";v="4.3.0",lib
/browserlauncher2-1.3.jar;g="net.sourceforge.browserlauncher2";a="brows
erlauncher2";v="1.3",lib/swingx-1.6.jar;g="org.swinglabs";a="swingx";v=
"1.6",lib/looks-2.2.2.jar;g="com.jgoodies";a="looks";v="2.2.2",lib/jamo
n-2.7.jar;g="com.jamonapi";a="jamon";v="2.7",lib/json-20090211.jar;g="o
rg.json";a="json";v="20090211"
Export-Package: org.dllearner.tools.protege;uses:="javax.swing,javax.swi
ng.event,javax.swing.table,org.protege.editor.core,org.protege.editor.c
ore.ui.util,org.semanticweb.owlapi.model,org.semanticweb.owlapi.reasone
r";version="2.0.0.SNAPSHOT"
Import-Package: org.apache.log4j;version="[1.2,2)",org.protege.editor.ow
l;version="4.3",org.protege.editor.owl.model;version="4.3",org.protege.
editor.owl.model.event;version="4.3",org.protege.editor.owl.model.selec
tion;version="4.3",org.protege.editor.owl.ui;version="4.3",org.protege.
editor.owl.ui.action;version="4.3",org.protege.editor.owl.ui.view;versi
on="4.3",javax.swing,org.semanticweb.owlapi.model,org.protege.editor.core;version="4.3"
Tool: Bnd-2.1.0.20130426-122213


The plugin is designed as a separate tab in the equivalent classes selector, thus, I extend from AbstractOWLClassExpressionEditor and use the following entry
point in the plugin.xml:

org.protege.editor.owl.ui_editor_description

When I start Protege verythings works fine, but once I want to assert an equivalent class expression to a selected class, which obviously forces the first activation
of the plugin, I get the following exception:

java.lang.NoClassDefFoundError: org/protege/editor/core/plugin/ProtegePluginInstance
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
....
Caused by: java.lang.ClassNotFoundException: org.protege.editor.core.plugin.ProtegePluginInstance not found by protege [8]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 72 more

I'm pretty sure that I got the plugin working some long time ago, but now I'm not able to do it again. Any ideas why some classes are not found although they
should be contained in the main Protege libs?


Kind regards,
Lorenz

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

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

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



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Writing plugin results in ClassNotFoundException

Lorenz Buehmann
This was indeed helpful and I could finally solve the problem.
Thank you very much for the help.

Regards,
Lorenz
On 02.02.2015 00:59, Timothy Redmond wrote:

When I run 'mvn clean package' and use the created plugin target/DL-Learner-Plugin.jar I get now the exception

ERROR: Bundle protege-plugin [8] Error starting file:/home/me/tools/Protege_5.0_beta/plugins/DL-Learner-Plugin.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0)))

This is happening indirectly because of an "Embed-Dependency" line in the pom.xml:

<!-- embed all compile and runtime scope dependencies -->
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Directory>lib</Embed-Directory>

What this does is to embed a copy of the protege editor jar file into the DL-Learner.jar artifact.  Thus after a "mvn clean install" I find the following:

Neptune:ProtegePlugin-test% unzip -v target/DL-Learner-Plugin.jar 
Archive:  target/DL-Learner-Plugin.jar
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    3131  Defl:N     1036  67% 02-01-2015 15:43 b0754150  META-INF/MANIFEST.MF
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/org.dllearner/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  META-INF/maven/org.dllearner/protege-plugin/
     138  Defl:N      124  10% 02-01-2015 15:43 a5f85824  META-INF/maven/org.dllearner/protege-plugin/pom.properties
    2167  Defl:N      786  64% 02-01-2015 15:31 78c7e9da  META-INF/maven/org.dllearner/protege-plugin/pom.xml
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  lib/
 2228948  Defl:N  1930752  13% 02-01-2015 15:29 8c04efeb  lib/org.protege.editor.owl-4.3.0.jar                  <-------------- org.protege.editor.owl is embedded
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/tools/
       0  Defl:N        2   0% 02-01-2015 15:43 00000000  org/dllearner/tools/protege/
    4325  Defl:N     1664  62% 02-01-2015 15:43 74214a81  org/dllearner/tools/protege/DLLearnerProtegePlugin.class
     227  Defl:N      176  23% 02-01-2015 10:15 38cd5ef6  package.html
     439  Defl:N      234  47% 02-01-2015 10:15 bb37981b  plugin.properties
     372  Defl:N      188  50% 02-01-2015 10:15 9e040dc3  plugin.xml
--------          -------  ---                            -------
 2239747          1934978  14%                            17 files
Neptune:ProtegePlugin-test% 

This embedded jar file is also reflected in the MANIFEST.MF which includes the line

Bundle-ClassPath: .,lib/org.protege.editor.owl-4.3.0.jar

This is not going to work with Protege in the best of all possible worlds because the Protege classes loaded by the DL-Learner-Plugin.jar bundle will be incompatible with the classes used by the Protege installation.  This would be the case even if the code-base of the embedded jar file was identical to the code-base of the Protege installation.  Classes from the one source could not be cast to classes of the other.

In your case, I think the DL-Learner-Plugin.jar is looking for dependencies of a Protege 4.3.0 plugin in a Protege 5.0.0 world and is not finding them.

If the Embed-Dependency lines are removed everything works.  Protege starts without exceptions:
sh run.sh
Starting Protege Desktop (Version 5.0.0, Build = beta-16-SNAPSHOT)
Platform:
    Java: JVM 1.8.0_31-b13 Memory: 466M
    Language: en, Country: US
    Framework: Apache Software Foundation (1.5)
    OS: linux (3.18.3-201.fc21.x86_64)
    Processor: x86-64
Plugin: DL-Learner Protege Plugin (1.0.0.RC1)
Plugin: Guava: Google Core Libraries for Java (17.0.0)
Plugin: Protege SPARQL Plugin (1.0.0)
Plugin: Protege Editor OWL (5.0.0.beta-16-SNAPSHOT)
Plugin: Protege HermiT Integration (1.0.0)
Plugin: OWLViz (4.1.4)
Plugin: OWL Difference (4.1.1)
Plugin: DL Query (1.1.4)
Plugin: OntoGraf (1.0.3)
Plugin: owlapi-osgidistribution (3.5.1)
Plugin: OWLAPI RDF Library (1.0.2)
Plugin: Explanation Workbench (1.0.0)
Plugin: OWL Code Generation Plug-in (1.0.2)
Plugin: OWL Difference Engine (1.0.1)
Plugin: Cajun Visualization Library (1.0.2)
	Guava: Google Core Libraries for Java Plugin has no plugin.xml resource
	owlapi-osgidistribution Plugin has no plugin.xml resource
	OWLAPI RDF Library Plugin has no plugin.xml resource
	OWL Difference Engine Plugin has no plugin.xml resource
	Cajun Visualization Library Plugin has no plugin.xml resource
Using OWL API version 3.5.1
Rebuilding entity indices...
... rebuilt in 4 ms
Setting active ontology to OntologyID(OntologyIRI(<http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25>))
Rebuilding entity indices...
... rebuilt in 3 ms
... active ontology changed
Cannot generate ontology catalog for ontology at http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25
Setting active ontology to OntologyID(OntologyIRI(<http://www.semanticweb.org/developer/ontologies/2015/1/untitled-ontology-25>))
Rebuilding entity indices...
... rebuilt in 2 ms
... active ontology changed
Auto-update last performed: Sun Feb 01 15:25:30 PST 2015
Auto-update has been run today.  Not running it again.
The DL-Learner-Plugin does not have any embedded protege artifacts:

Neptune:ProtegePlugin-test% unzip -v target/DL-Learner-Plugin.jar Archive:  target/DL-Learner-Plugin.jar
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
    1027  Defl:N      428  58% 02-01-2015 15:53 f9609f5e  META-INF/MANIFEST.MF
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/org.dllearner/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  META-INF/maven/org.dllearner/protege-plugin/
     138  Defl:N      125   9% 02-01-2015 15:53 b1fe1758  META-INF/maven/org.dllearner/protege-plugin/pom.properties
    1990  Defl:N      720  64% 02-01-2015 15:53 1d200984  META-INF/maven/org.dllearner/protege-plugin/pom.xml
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/tools/
       0  Defl:N        2   0% 02-01-2015 15:53 00000000  org/dllearner/tools/protege/
    4325  Defl:N     1664  62% 02-01-2015 15:53 74214a81  org/dllearner/tools/protege/DLLearnerProtegePlugin.class
     227  Defl:N      176  23% 02-01-2015 10:15 38cd5ef6  package.html
     439  Defl:N      234  47% 02-01-2015 10:15 bb37981b  plugin.properties
     372  Defl:N      188  50% 02-01-2015 10:15 9e040dc3  plugin.xml
--------          -------  ---                            -------
    8518             3551  58%                            15 files
Neptune:ProtegePlugin-test% 

There are some cases where you want to embed selected dependencies (some of the Protege artifacts do this) and if you are having trouble with this case, I can look into it.

-Timothy



On 01/30/2015 03:28 AM, Lorenz Bühmann wrote:
Hello Matthew,

thanks for your reply.

Well, using the plugin-examples works as expected. I pruned down my plugin code and created a new GitHub repo: https://github.com/LorenzBuehmann/ProtegePlugin-test

When I run 'mvn clean package' and use the created plugin target/DL-Learner-Plugin.jar I get now the exception

ERROR: Bundle protege-plugin [8] Error starting file:/home/me/tools/Protege_5.0_beta/plugins/DL-Learner-Plugin.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle protege-plugin [8]: Unable to resolve 8.0: missing requirement [8.0] osgi.wiring.package; (&(osgi.wiring.package=org.protege.common)(version>=4.3.0)(!(version>=5.0.0)))

which is indeed some OSGI problem. Once I add an entry for the org.protege.commons package, i.e.

<Import-Package>
                            org.apache.log4j.*;version="[1.2,2)",
org.protege.editor.owl.*;version="4.3",
org.protege.editor.core.*;version="4.3",
                            org.protege.common.*;version="4.3",
                            *
</Import-Package>

I get another exception that something else is missing. Adding the missing package as import again, ...,   and so on and so forth.

Probably I do not understand the mechanism of OSGI, but I'm also puzzled that your example is working. Might be because I use another plugin type. Or might be that your example was designed for Protege 4.3. I don't know.

Kind regards,
Lorenz

Hi Lorenz,

This looks like an OSGI problem at first glance, but it’s difficult for me to tell.  If you clone the plugin-examples repo from GitHub and do a straight build of it does it work?  Also, would you be able to post your code to the list (or send it to me off list) so I could take a look at it?

Cheers,

Matthew



On 26 Jan 2015, at 04:23, Lorenz Bühmann [hidden email] wrote:

Hello,

I'm trying to get my plugin working on Protege 5.0 beta by using the Maven Bundle Plugin as shown in https://github.com/protegeproject/protege-plugin-examples .


My MANIFEST.MF looks as follows:

Manifest-Version: 1.0
Bnd-LastModified: 1422267577834
Build-Jdk: 1.8.0_31
Built-By: me
Bundle-Activator: org.protege.editor.owl.ProtegeOWL
Bundle-ClassPath: .,lib/components-core-2.0-SNAPSHOT.jar,lib/org.protege
.editor.owl-4.3.0.jar,lib/browserlauncher2-1.3.jar,lib/swingx-1.6.jar,l
ib/looks-2.2.2.jar,lib/jamon-2.7.jar,lib/json-20090211.jar
Bundle-ManifestVersion: 2
Bundle-Name: DL-Learner Protege Plugin
Bundle-SymbolicName: protege;singleton:=true
Bundle-Vendor: DL-Learner Project
Bundle-Version: 2.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embed-Directory: lib
Embedded-Artifacts: lib/components-core-2.0-SNAPSHOT.jar;g="org.dllearne
r";a="components-core";v="2.0-SNAPSHOT",lib/org.protege.editor.owl-4.3.
0.jar;g="edu.stanford.protege";a="org.protege.editor.owl";v="4.3.0",lib
/browserlauncher2-1.3.jar;g="net.sourceforge.browserlauncher2";a="brows
erlauncher2";v="1.3",lib/swingx-1.6.jar;g="org.swinglabs";a="swingx";v=
"1.6",lib/looks-2.2.2.jar;g="com.jgoodies";a="looks";v="2.2.2",lib/jamo
n-2.7.jar;g="com.jamonapi";a="jamon";v="2.7",lib/json-20090211.jar;g="o
rg.json";a="json";v="20090211"
Export-Package: org.dllearner.tools.protege;uses:="javax.swing,javax.swi
ng.event,javax.swing.table,org.protege.editor.core,org.protege.editor.c
ore.ui.util,org.semanticweb.owlapi.model,org.semanticweb.owlapi.reasone
r";version="2.0.0.SNAPSHOT"
Import-Package: org.apache.log4j;version="[1.2,2)",org.protege.editor.ow
l;version="4.3",org.protege.editor.owl.model;version="4.3",org.protege.
editor.owl.model.event;version="4.3",org.protege.editor.owl.model.selec
tion;version="4.3",org.protege.editor.owl.ui;version="4.3",org.protege.
editor.owl.ui.action;version="4.3",org.protege.editor.owl.ui.view;versi
on="4.3",javax.swing,org.semanticweb.owlapi.model,org.protege.editor.core;version="4.3"
Tool: Bnd-2.1.0.20130426-122213


The plugin is designed as a separate tab in the equivalent classes selector, thus, I extend from AbstractOWLClassExpressionEditor and use the following entry
point in the plugin.xml:

org.protege.editor.owl.ui_editor_description

When I start Protege verythings works fine, but once I want to assert an equivalent class expression to a selected class, which obviously forces the first activation
of the plugin, I get the following exception:

java.lang.NoClassDefFoundError: org/protege/editor/core/plugin/ProtegePluginInstance
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
....
Caused by: java.lang.ClassNotFoundException: org.protege.editor.core.plugin.ProtegePluginInstance not found by protege [8]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 72 more

I'm pretty sure that I got the plugin working some long time ago, but now I'm not able to do it again. Any ideas why some classes are not found although they
should be contained in the main Protege libs?


Kind regards,
Lorenz

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

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

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




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


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