[protege-discussion] Problem with events and database backing

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

[protege-discussion] Problem with events and database backing

clemens utschig
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>

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

Re: [protege-discussion] Problem with events and database backing

clemens utschig
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>


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

Re: [protege-discussion] Problem with events and database backing

Timothy Redmond

The deadlock issue is a known issue.  The problem is that
  1. The graphical user interface, which holds the AWT-EventQueue lock, makes calls to the knowledge base, which is synchronized.
  2. The listeners in the knowledge base may make graphics calls.

This leads to the necessary conditions for a deadlock (the UI lock waits for the knowledge base lock which waits for the UI lock...).

There is a wiki page about this:

     http://protegewiki.stanford.edu/wiki/MultiThreadingConsiderationsInProtege3

I am guessing that your best solution will be the second one - run all knowledge base calls in the swing thread, perhaps by using the SwingUtilities.invokeLater routine.

-Timothy



On 02/17/2014 07:32 AM, clemens utschig wrote:
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>



_______________________________________________
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: [protege-discussion] Problem with events and database backing

Timothy Redmond

One more perhaps obvious comment.  The SwingUtilities class has two invokeLater methods, one which does the invocation and does not wait and one that does the invocation and waits.

-Timothy

On 02/17/2014 08:11 AM, Timothy Redmond wrote:

The deadlock issue is a known issue.  The problem is that
  1. The graphical user interface, which holds the AWT-EventQueue lock, makes calls to the knowledge base, which is synchronized.
  2. The listeners in the knowledge base may make graphics calls.

This leads to the necessary conditions for a deadlock (the UI lock waits for the knowledge base lock which waits for the UI lock...).

There is a wiki page about this:

     http://protegewiki.stanford.edu/wiki/MultiThreadingConsiderationsInProtege3

I am guessing that your best solution will be the second one - run all knowledge base calls in the swing thread, perhaps by using the SwingUtilities.invokeLater routine.

-Timothy



On 02/17/2014 07:32 AM, clemens utschig wrote:
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>



_______________________________________________
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: [protege-discussion] Problem with events and database backing

clemens utschig
In reply to this post by clemens utschig
I cant change the protege app ... the problem is that instances are updated underneath - via API and if i then use the protege application I get the deadlock ...

        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

I tried to use the swing utilities (as in the wiki) to do the above update (in its own thread) - but unfortunately no luck ...

I cant' turn off events as I have a few listeners myself ...

Cheers



On Mon, Feb 17, 2014 at 4:32 PM, clemens utschig <[hidden email]> wrote:
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>



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

Re: [protege-discussion] Problem with events and database backing

clemens utschig
start of the protege app

       Application.main(new String[] {});
        ProjectManager.getProjectManager().setExitVMOnApplicationExit(false);
        ProjectManager.getProjectManager().setCurrentProject(p1.getProject(), false, false);


later ...

            new Thread(new Runnable() {
                public void run() {
                   boolean dispatchEnabled = p1.setDispatchEventsEnabled(false);
                   try
                   {
                       bean1.getKnowledgeBundleOntologyFactory().
                           createEntity("bean1Entity" + System.currentTimeMillis());        
                   } finally {
                      if (dispatchEnabled)
                      {
                         p1.setDispatchEventsEnabled(true);
                      }
                      SwingUtilities.invokeLater(new Runnable() {
                         public void run() {
                            p1.flushEvents();
                         }
                       });
                   }
                 }
              }).start();

meanwhile I am clicking in the protege app - and once on an instance, (any instance) - I get the deadlock ... :-(

anything I am missing here?



On Mon, Feb 17, 2014 at 6:29 PM, clemens utschig <[hidden email]> wrote:
I cant change the protege app ... the problem is that instances are updated underneath - via API and if i then use the protege application I get the deadlock ...

        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

I tried to use the swing utilities (as in the wiki) to do the above update (in its own thread) - but unfortunately no luck ...

I cant' turn off events as I have a few listeners myself ...

Cheers



On Mon, Feb 17, 2014 at 4:32 PM, clemens utschig <[hidden email]> wrote:
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>




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

Re: [protege-discussion] Problem with events and database backing

Timothy Redmond
In reply to this post by clemens utschig

So the thread that is causing the deadlock is the main thread.  I have
included the entire thread dump below.  You can see that the first lock
that it takes is the knowledge base lock:

             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)
             at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)


The problem is that the knowledge base lock is taken before the UI lock
which is the wrong order.

Taking and holding the swing ui lock anywhere before that point will fix
the problem.  So I am not sure what code you have control over, but if
invoke the swing utilities right before you call the soacommunity code,
e.g., somewhere below this point:

             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)
             at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)


then the problem will go away.  If you can't modify this stack trace
then your only option is to turn off the generation or dispatching of
events.  I think that there is a way to turn off the dispatching of
events and then have all the events that were generated get dispatched
later, so this may be a possibility also.


-Timothy

     "main":
             at java.awt.Component.setFont(Component.java:1798)
             - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
             at java.awt.Container.setFont(Container.java:1554)
             at javax.swing.JComponent.setFont(JComponent.java:2723)
             at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.java:451)
             at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComponent(DefaultRenderer.java:230)
             at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2712)
             at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)
             at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:535)
             at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:181)
             at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510)
             at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503)
             at javax.swing.JTree.getPathBounds(JTree.java:2063)
             at javax.swing.JTree.getRowBounds(JTree.java:2076)
             at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(DefaultRenderer.java:138)
             at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2721)
             at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)
             at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:535)
             at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:181)
             at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510)
             at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503)
             at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTreeUI.java:3765)
             at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:468)
             at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:330)
             at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:261)
             at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTreeRoot.java:84)
             at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
             at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
             at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
             at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentChildNode.java:130)
             at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvent(EventDispatchFrameStore.java:296)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:269)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:241)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:232)
             at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.createSimpleInstance(EventDispatchFrameStore.java:814)
             at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCommand.doIt(CreateSimpleInstanceCommand.java:22)
             at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleCommandExecute(UndoFrameStore.java:90)
             at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute(UndoFrameStore.java:84)
             at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createSimpleInstance(UndoFrameStore.java:171)
             at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.createSimpleInstance(ArgumentCheckingFrameStore.java:137)
             at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.createSimpleInstance(ChangeMonitorFrameStore.java:46)
             at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSimpleInstance(FrameStoreAdapter.java:306)
             at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSimpleInstance(FrameStoreAdapter.java:306)
             at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.createSimpleInstance(ImmutableNamesFrameStore.java:89)
             at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInstance(DefaultKnowledgeBase.java:230)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:430)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:412)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:407)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:399)
             - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
             at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)
             at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)
             at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
             at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
             at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
             at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
             at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
             at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
             at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
             at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
             at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
             at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
             at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
             at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
             at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
             at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
             at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
             at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

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

Re: [protege-discussion] Problem with events and database backing

Timothy Redmond
In reply to this post by clemens utschig

I just realized that the wiki that I showed you didn't have the invokeLater code that I thought it would. I think that an alternative to the code in the wiki is something approximately like this:

              SwingUtilities.invokeLater(new Runnable() {
                      bean1.getKnowledgeBundleOntologyFactory().
                           createEntity("bean1Entity" + System.currentTimeMillis());
                   }
               });       

(I didn't do it in eclipse so....).

            new Thread(new Runnable() {
                public void run() {
                   boolean dispatchEnabled = p1.setDispatchEventsEnabled(false);
                   try
                   {
                       bean1.getKnowledgeBundleOntologyFactory().
                           createEntity("bean1Entity" + System.currentTimeMillis());        
                   } finally {
                      if (dispatchEnabled)
                      {
                         p1.setDispatchEventsEnabled(true);
                      }
                      SwingUtilities.invokeLater(new Runnable() {
                         public void run() {
                            p1.flushEvents();
                         }
                       });
                   }
                 }
              }).start();

So I haven't looked at Protege 3 code in a while but this looks approximately right.  It isn't consistent with the stack trace that I analyzed in my last message because that stack trace occurred in the main thread.  In addition in the stack trace that I looked at the dispatching was clearly happening:

            at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
            at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentChildNode.java:130)
            at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) 
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)

The stack trace that I looked at in my last message was

    "main":
            at java.awt.Component.setFont(Component.java:1798)
            - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
            at java.awt.Container.setFont(Container.java:1554)
            at javax.swing.JComponent.setFont(JComponent.java:2723)
            at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.java:451)
            at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComponent(DefaultRenderer.java:230)
            at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2712)
            at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)
            at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:535)
            at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:181)
            at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510)
            at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503)
            at javax.swing.JTree.getPathBounds(JTree.java:2063)
            at javax.swing.JTree.getRowBounds(JTree.java:2076)
            at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(DefaultRenderer.java:138)
            at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimensions(BasicTreeUI.java:2721)
            at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayoutCache.java:475)
            at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:535)
            at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCache.java:181)
            at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510)
            at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503)
            at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTreeUI.java:3765)
            at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeModel.java:468)
            at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:330)
            at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:261)
            at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTreeRoot.java:84)
            at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
            at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
            at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTreeNode.java:368)
            at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentChildNode.java:130)
            at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) 
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvent(EventDispatchFrameStore.java:296)
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:269)
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:241)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchEvents(EventDispatchFrameStore.java:232)
            at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.createSimpleInstance(EventDispatchFrameStore.java:814)
            at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCommand.doIt(CreateSimpleInstanceCommand.java:22)
            at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleCommandExecute(UndoFrameStore.java:90)
            at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute(UndoFrameStore.java:84)
            at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createSimpleInstance(UndoFrameStore.java:171)
            at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.createSimpleInstance(ArgumentCheckingFrameStore.java:137)
            at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.createSimpleInstance(ChangeMonitorFrameStore.java:46)
            at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSimpleInstance(FrameStoreAdapter.java:306)
            at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSimpleInstance(FrameStoreAdapter.java:306)
            at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.createSimpleInstance(ImmutableNamesFrameStore.java:89)
            at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInstance(DefaultKnowledgeBase.java:230)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:430)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:412)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:407)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(DefaultKnowledgeBase.java:399)
            - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledgeBase)
            at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)
            at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)
            at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
            at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
            at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
            at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
            at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
            at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
            at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
            at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
            at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
            at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
            at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
            at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
            at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
            at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
            at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


-Timothy

On 02/17/2014 09:42 AM, clemens utschig wrote:
start of the protege app

       Application.main(new String[] {});
        ProjectManager.getProjectManager().setExitVMOnApplicationExit(false);
        ProjectManager.getProjectManager().setCurrentProject(p1.getProject(), false, false);


later ...

            new Thread(new Runnable() {
                public void run() {
                   boolean dispatchEnabled = p1.setDispatchEventsEnabled(false);
                   try
                   {
                       bean1.getKnowledgeBundleOntologyFactory().
                           createEntity("bean1Entity" + System.currentTimeMillis());        
                   } finally {
                      if (dispatchEnabled)
                      {
                         p1.setDispatchEventsEnabled(true);
                      }
                      SwingUtilities.invokeLater(new Runnable() {
                         public void run() {
                            p1.flushEvents();
                         }
                       });
                   }
                 }
              }).start();

meanwhile I am clicking in the protege app - and once on an instance, (any instance) - I get the deadlock ... :-(

anything I am missing here?



On Mon, Feb 17, 2014 at 6:29 PM, clemens utschig <[hidden email]> wrote:
I cant change the protege app ... the problem is that instances are updated underneath - via API and if i then use the protege application I get the deadlock ...

        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntity(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

I tried to use the swing utilities (as in the wiki) to do the above update (in its own thread) - but unfortunately no luck ...

I cant' turn off events as I have a few listeners myself ...

Cheers



On Mon, Feb 17, 2014 at 4:32 PM, clemens utschig <[hidden email]> wrote:
ok next step, a deadlock if I try to update an instance directly in the knowledgebase with the protege app sitting on the same project instance

Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(Defaul
tCls.java:49)
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

"VM Thread" prio=10 tid=0x02b3c800 nid=0x1b70 runnable

"VM Periodic Task Thread" prio=10 tid=0x02b96000 nid=0x232c waiting on condition


JNI global references: 2250


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x02b7bf24 (object 0x286513c8, a edu.stanford.smi.prot
ege.model.DefaultKnowledgeBase),
  which is held by "main"
"main":
  waiting to lock monitor 0x0329a604 (object 0x27f7d4d0, a java.awt.Component$AW
TTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.getSystemFrames(D
efaultKnowledgeBase.java:127)
        - waiting to lock <0x286513c8> (a edu.stanford.smi.protege.model.Default
KnowledgeBase)
        at edu.stanford.smi.protege.model.DefaultFrame.isSystem(DefaultFrame.jav
a:334)
        at edu.stanford.smi.protege.model.DefaultFrame.isIncluded(DefaultFrame.j
ava:330)
        at edu.stanford.smi.protege.model.DefaultFrame.isEditable(DefaultFrame.j
ava:322)
        at edu.stanford.smi.protege.ui.FrameRenderer.load(FrameRenderer.java:107
)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:464)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:169)
        at javax.swing.tree.AbstractLayoutCache.getPreferredWidth(AbstractLayout
Cache.java:215)
        at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTre
eUI.java:1820)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1921)
        at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:
1909)
        at javax.swing.JComponent.getPreferredSize(JComponent.java:1634)
        at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:76
9)
        at java.awt.Container.layout(Container.java:1421)
        at java.awt.Container.doLayout(Container.java:1410)
        at java.awt.Container.validateTree(Container.java:1507)
        at java.awt.Container.validate(Container.java:1480)
        - locked <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.j
ava:669)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(System
EventQueueUtilities.java:124)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:602)
        at java.awt.EventQueue$1.run(EventQueue.java:600)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessCo
ntrolContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
"main":
        at java.awt.Component.setFont(Component.java:1798)
        - waiting to lock <0x27f7d4d0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Container.setFont(Container.java:1554)
        at javax.swing.JComponent.setFont(JComponent.java:2723)
        at edu.stanford.smi.protege.util.DefaultRenderer.setup(DefaultRenderer.j
ava:451)
        at edu.stanford.smi.protege.util.DefaultRenderer.getTreeCellRendererComp
onent(DefaultRenderer.java:230)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2712)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.JTree.getPathBounds(JTree.java:2063)
        at javax.swing.JTree.getRowBounds(JTree.java:2076)
        at edu.stanford.smi.protege.util.DefaultRenderer.getPreferredSize(Defaul
tRenderer.java:138)
        at javax.swing.plaf.basic.BasicTreeUI$NodeDimensionsHandler.getNodeDimen
sions(BasicTreeUI.java:2721)
        at javax.swing.tree.AbstractLayoutCache.getNodeDimensions(AbstractLayout
Cache.java:475)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:535)
        at javax.swing.tree.FixedHeightLayoutCache.getBounds(FixedHeightLayoutCa
che.java:181)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:510
)
        at javax.swing.plaf.basic.BasicTreeUI.getPathBounds(BasicTreeUI.java:503
)
        at javax.swing.plaf.basic.BasicTreeUI$Handler.treeNodesChanged(BasicTree
UI.java:3765)
        at javax.swing.tree.DefaultTreeModel.fireTreeNodesChanged(DefaultTreeMod
el.java:468)
        at javax.swing.tree.DefaultTreeModel.nodesChanged(DefaultTreeModel.java:
330)
        at javax.swing.tree.DefaultTreeModel.nodeChanged(DefaultTreeModel.java:2
61)
        at edu.stanford.smi.protege.util.LazyTreeRoot.notifyNodeChanged(LazyTree
Root.java:84)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.util.LazyTreeNode.notifyNodeChanged(LazyTree
Node.java:368)
        at edu.stanford.smi.protege.ui.ParentChildNode.notifyNodeChanged(ParentC
hildNode.java:130)
        at edu.stanford.smi.protege.ui.ParentChildNode$1.directInstanceAdded(ParentChildNode.java:42) ****************************************************** UI Listener?
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dispatchClsEvent(EventDispatchFrameStore.java:425)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvent(EventDispatchFrameStore.java:296)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:269)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:241)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.dis
patchEvents(EventDispatchFrameStore.java:232)
        at edu.stanford.smi.protege.model.framestore.EventDispatchFrameStore.cre
ateSimpleInstance(EventDispatchFrameStore.java:814)
        at edu.stanford.smi.protege.model.framestore.undo.CreateSimpleInstanceCo
mmand.doIt(CreateSimpleInstanceCommand.java:22)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.simpleC
ommandExecute(UndoFrameStore.java:90)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.execute
(UndoFrameStore.java:84)
        at edu.stanford.smi.protege.model.framestore.undo.UndoFrameStore.createS
impleInstance(UndoFrameStore.java:171)
        at edu.stanford.smi.protege.model.framestore.ArgumentCheckingFrameStore.
createSimpleInstance(ArgumentCheckingFrameStore.java:137)
        at edu.stanford.smi.protege.model.framestore.ChangeMonitorFrameStore.cre
ateSimpleInstance(ChangeMonitorFrameStore.java:46)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.FrameStoreAdapter.createSim
pleInstance(FrameStoreAdapter.java:306)
        at edu.stanford.smi.protege.model.framestore.ImmutableNamesFrameStore.cr
eateSimpleInstance(ImmutableNamesFrameStore.java:89)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createSimpleInsta
nce(DefaultKnowledgeBase.java:230)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:430)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:412)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:407)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultKnowledgeBase.createInstance(De
faultKnowledgeBase.java:399)
        - locked <0x286513c8> (a edu.stanford.smi.protege.model.DefaultKnowledge
Base)
        at edu.stanford.smi.protege.model.DefaultCls.createDirectInstance(DefaultCls.java:49)   ************************************************** this is the api creating the thing
        at org.soacommunity.platform.a2x.ontology.A2XOntologyFactory.createEntit
y(A2XOntologyFactory.java:445)
        at TestConcurrentBundles.testBundleEvents(TestConcurrentBundles.java:90)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4
TestReference.java:46)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution
.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remot
eTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTest
Runner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTes
tRunner.java:197)

Found 1 deadlock.

-------------------------
Arg ...


On Mon, Feb 17, 2014 at 12:56 PM, clemens utschig <[hidden email]> wrote:
So, i got to the point of sneaking a kb object under the protege app at runtime -
pretty much a new constructor in project (using the code from the one with uri, and calling all the methods) and then projectmanager.getpm.
setcurrentproject...

    public Project(KnowledgeBase base, Collection errors, URI projectUri)
    {
        if (log.isLoggable(Level.FINE)) {
          log.fine("Creating Project " + "HACK" + " multiserver = " + isMultiUserServer);
        }
        setProjectURI(projectUri);
        _projectKB = base; // loadProjectKB(uri, factory, errors);

        ProjectFixupsPluginManager.fixProject(_projectKB);
        removeUnreferencedInstances(_projectKB);
       
        if (_projectKB != null) {
            _projectInstance = getProjectInstance(_projectKB);
        }
       
        createDomainKnowledgeBase(base.getKnowledgeBaseFactory(), errors, true);
        setupJournaling();
        updateKBNames();
    }

Seriously - almost there, but now i really need your help - all the default widgets are working - but when i click on an instance within the instances tab the instance form does not show? no error whatsoever

If i use the default project constructor (with a string) and do the same thing - the instance form does show up.. Unfortunately i cant debug into this with all the threads running around, so i really need some advice here - is there some other magic? some flag needed to be set...

On Sunday, February 16, 2014, clemens utschig <[hidden email]> wrote:
> Hey timothy - first of all thanks a ton for the reply.
>
> Yes i am on version 3.5.. The problem is that i cant create a server project first as i use the ontology to configure a (remote) application on the fly - and want to use the protege app to do configuration on top of that - think of the ontology as a graph within a deployable server app. And i dont want to start messing with two servers (my own and its lifecyle and the protege one ;-)
>
> I'll try to tweak the protege app tmrw a little - and see if i can sneak a project instance underneath it on the fly (rather than it *owning* and opening a uri..)..
>
> If you have some other super smart idea, any help is appreciated...
>
> Cheers from germany, i actually studied at stanford during my time in san francisco ;-)  
>
> On Saturday, February 15, 2014, Timothy Redmond <[hidden email]> wrote:
>>
>> Just in case you didn't see my reply.
>>





_______________________________________________
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