Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] add a new library

Timothy Redmond tredmond at stanford.edu
Fri Jan 30 10:44:59 PST 2009


My first comment is that this is really going to the wrong group.   
Since this is a Protege 4 issue the best place to go is the p4 mailing  
list [1].  This post could have very easily been missed by the Protege  
developers watching the p4 list (mainly Nick  at the moment).

On Jan 29, 2009, at 2:59 AM, Yongchun Xu wrote:

> Hello everyone,
>
> Now I am developing a Demo program by using protégé 4. I have  
> changed some codes in bundle org.protege.editor.owl and add a new  
> library.

This is not a generally recommended strategy.  By modifying the core  
protege support you are committing yourself to always having to  
coordinate your changes with the changes made by the Protege group and  
maintaining your own copy.  A much better approach would be to make  
your own plugin which implements your demo program.  To a large extent  
this will decouple you from the work being done by the Protege group  
and will allow you (when you are ready) to have your own copy in some  
version control tool like svn, git or cvs.

We need to write much more documentation about how to write plugins  
but there is some documentation here [2].  In particular this points  
to the documentation written by the co-ode group [3] and the  
documentation on the protege wiki [4[.


> But there is a problem when I compile the jar file.
> I have changed the following command in the  manifest.bnd:
>
> Bundle-ClassPath:  .    è   Bundle-ClassPath: .,lib/owldb.jar
>
> While compiling I get the following error information:
> BUILD FAILED
> C:\Working_Data\OWL_Workspace\protege\build.xml:244: The following  
> error occurred while executing this line:
> C:\Working_Data\OWL_Workspace\protege\build.xml:146: The following  
> error occurred while executing this line:
> C:\Working_Data\OWL_Workspace\protege\plugins\org.protege.editor.owl 
> \build.xml:58: java.lang.StackOverflowError

This looks like a bug in the bnd ant target and possibly in our  
build.xml file. I did try to replicate this but didn't succeed.  But  
there are two positive responses.  First, you should do this in  
another way (make a plugin).  Second, if you update in svn you will  
find that the latest build files build without using bnd (we  
discovered another issue with paths with spaces).

>  Then I try to build the jar file by using manifest.mf instead of  
> manifest.bnd(bnd tools). This time there is no error information  
> while compiling, but the protégé cannot install the plug-ins.
> The eclipse outputs the informations:
>      [java] Could not start bundle com.owldl.pellet
>      [java] org.osgi.framework.BundleException: The bundle could not  
> be resolved. Reason: Missing Constraint: Require-Bundle:  
> org.protege.editor.owl; bundle-version="0.0.0"
>      [java]       at  
> org 
> .eclipse 
> .osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java: 
> 305)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework.internal.core.AbstractBundle.start(AbstractBundle.java:252)
>      [java]       at  
> org 
> .protege 
> .editor.core.ProtegeApplication.loadPlugins(ProtegeApplication.java: 
> 358)
>      [java]       at  
> org 
> .protege 
> .editor 
> .core.ProtegeApplication.initApplication(ProtegeApplication.java:162)
>      [java]       at  
> org 
> .protege 
> .editor.core.ProtegeApplication.start(ProtegeApplication.java:110)
>      [java]       at  
> org.eclipse.osgi.framework.internal.core.BundleContextImpl 
> $2.run(BundleContextImpl.java:999)
>      [java]       at  
> java.security.AccessController.doPrivileged(Native Method)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal 
> .core.BundleContextImpl.startActivator(BundleContextImpl.java:993)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal.core.BundleContextImpl.start(BundleContextImpl.java:974)
>      [java]       at  
> org 
> .eclipse 
> .osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java: 
> 346)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework.internal.core.AbstractBundle.resume(AbstractBundle.java: 
> 350)
>      [java]       at  
> org 
> .eclipse 
> .osgi.framework.internal.core.Framework.resumeBundle(Framework.java: 
> 1118)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal 
> .core.StartLevelManager.resumeBundles(StartLevelManager.java:634)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal.core.StartLevelManager.incFWSL(StartLevelManager.java:508)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal 
> .core.StartLevelManager.doSetStartLevel(StartLevelManager.java:282)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework 
> .internal 
> .core.StartLevelManager.dispatchEvent(StartLevelManager.java:468)
>      [java]       at  
> org 
> .eclipse 
> .osgi 
> .framework.eventmgr.EventManager.dispatchEvent(EventManager.java:195)
>      [java]       at org.eclipse.osgi.framework.eventmgr.EventManager 
> $EventThread.run(EventManager.java:297)
>
> Who can tell me how to add a new library in the  
> org.protege.editor.owl bundle?

The manifest format [5] is a bit delicate (hokey?) and can be tricky  
to get right.  My suspicion is that there is a typo in your version of  
the org.protege.editor.owl manifest.mf that is causing it to be parsed  
differently than you want.  My best guess is that there is a problem  
with line continuation somewhere.  A newline followed by a space is  
seen a line continuation in the manifest format.

I don't know what tools you are using and I don't want to sway you  
from your ide tools of choice.  But if you are  neutral, my  
recommendation is to use eclipse.  We don't yet have documentation for  
the best way to take advantage of eclipse but a good thing about  
eclipse is that it understands the manifest format.  I am hoping that  
we will have some better documentation on how to use eclipse soon (as  
a windows user you can take advantage of the OSGi plugin support in  
eclipse - but we haven't documented how to do this yet.)  I hope to  
have some new documentation on setting up Protege 4 in eclipse very  
soon (it can be very simple - I can configure a brand new eclipse  
project, create projects for all the standard plugins, create a  
runnable and start the runnable in under one minute.)

-Timothy


>
>
> Sincerely,
>
> Yongchun
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03


[1] https://mailman.stanford.edu/mailman/listinfo/p4-feedback
[2] http://protegewiki.stanford.edu/index.php/Protege4DevDocs#Anatomy_of_a_Plugin
[3] http://www.co-ode.org/downloads/protege-x/plugin-code-example.php
[4] http://protegewiki.stanford.edu/index.php/CompileProtege4PluginInEclipseOneProject
[5] http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html


More information about the protege-discussion mailing list