Question on some old classes/methods

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

Re: Build Questions (was Re: Question on some old classes/methods)

Tania Tudorache
Mark,

You can load a project using a call like:

Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj", errors);

This will set the correct current project.

You also got a class not found error. The class that was not found was
in the jena.jar.  Did you add to your Eclipse project:

- the protege.jar (or protege-cores sources)
- the protege-owl.jar (or protege-owl sources)

If you compile the protege-owl sources, than you need to add to the
Eclipse project all the jars from the protege owl plugin directory (such
as, jena.jar, owlsyntax.jar, etc.).

Tania



Mark Feblowitz wrote:

> Since there's been radio silence on this, I'll restate my request as I
> currently understand it.
>
> What is the best way to load a project, such that currentProject is
> set correctly?  It seems like simply issuing a "new Project(...)"  
> doesn't do the trick.
>
> (Is that a bug or simply an incomplete creation/loading of the project?)
>
> It would help to see some code that loads a project (that is an Owl
> project).
>
> Thanks,
>
> Mark
>
>
> At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
>> Ok -
>>
>> Forget all of my prior questions :-) Using ant instead of eclipse,
>> I've been able to debug and diagnose the problem I'm having.
>>
>> You were right on the money!
>>
>> The LexGrid Protege in Eclipse code creates a project and project
>> views, but does not set the current project.
>>
>> The problem comes when trying to get the current project.
>>
>> I assume that the LG code is using some outdated means of loading a
>> project. Below is the method that appears to be flawed.
>>
>> Can you point me to something the does this correctly?
>>
>> Thanks!
>>
>> Mark
>>
>> from LgProtegeEditor.java:
>> ...
>> public void init() throws SwingInitException {
>>          try {
>>                  final IFileEditorInput input = (IFileEditorInput)
>> getEditorInput();
>>                  if (input != null) {
>>                          Collection errs = new ArrayList();
>>                          p = new
>>                        
>> Project(((org.eclipse.core.internal.resources.File)
>>
>> input.getStorage()).getRawLocation().toString(), errs);
>>                          if (!disposed) {
>>                                  if (!errs.isEmpty()) {
>>                                          for (Iterator errIt =
>>                                         errs.iterator();
>> errIt.hasNext(); )
>>                                                  
>> Plugin.log(IStatus.ERROR,
>>                                                
>> errIt.next().toString());
>>                                              display.syncExec(new
>> Runnable() {
>>                                                  public void run() {
>>
>> MessageDialog.openError(getSite().getShell(),
>>                                         "Error",
>>
>> "Errors occurred initializing the Protege project. Refer to the error
>> log for  additional information.");
>>                                                  }
>>                                          });
>>                                  }
>>                                  if (p.hasCompleteSources()) {
>>                                          // Create the Swing-based
>> canvas ...
>>                                          pv = new ProjectView(p);
>>                                          f.setLayout(new
>> java.awt.BorderLayout());
>>                                          f.add(pv, "Center");
>>                                          f.addWindowListener(new
>> WindowAdapter() {
>>                                                  public void
>> windowClosing(WindowEvent event) {
>>                                                          dispose();
>>                                                  }
>>                                          });
>>                                          // Fresh starting point for
>> edit tracking ...
>>                                          p.clearIsDirty();
>>                                  } else {
>>                                          throw new SwingInitException();
>>                                  }
>>                          }
>>                  }
>> ...
>>
>>
>> At 04:50 PM 10/17/2006, Tania Tudorache wrote:
>> >Mark,
>> >
>> >I can't tell you what's going on, if I don't know in which line the
>> >exception occurred. I suppose it occurred in
>> >
>> >String projName =
>> >ProjectManager.getProjectManager().getCurrentProject().getName();
>> >
>> >which probably means that the project manager was not initialized
>> >correctly, or that the project was not yet created.
>> >
>> >Maybe some things have also changed in Eclipse initialization as
>> >well. I know that they support only partially Swing applications.
>> >
>> >Tania
>> >
>> >
>> >
>> >Mark Feblowitz wrote:
>> >>I am using Java 1.5, either the IBM version or the Sun version.
>> >>
>> >>I'll see if I can get some help here in using eclipse to do the build.
>> >>
>> >>I'm bringing in the Protege source to debug what's happening in
>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
>> >>like it occurs in the Protege code. Here's the exception:
>> >>
>> >>WARNING: _java.lang.NullPointerException
>> >>_at
>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.crea
>> teOntologyBrowserHeader(Unknown
>> >>Source)
>> >>at
>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<ini
>> t>(Unknown
>> >>Source)
>> >>at
>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.create
>> MainPanel(Unknown
>> >>Source)
>> >>at
>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.initia
>> lize(Unknown
>> >>Source)
>> >>at
>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(Un
>> known Source)
>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
>> >>at edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown
>> Source)
>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
>> >>at
>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
>>
>> >>_LgProtegeEditor.java:180_ )
>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
>> >>_LgProtegeEditor.java:338_ )
>> >>at
>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
>> >>( _LgProtegeEditor.java:266_ )
>> >>
>> >>Mark
>> >>
>> >>
>> >>
>> >>At 02:48 PM 10/17/2006, you wrote:
>> >>>Mark,
>> >>>
>> >>>If you use the latest Protege 3.2 beta, than you should use Java 1.5.
>> >>>
>> >>>The Parser class is automatically generated by the Protege build
>> >>>script. The instructions for building Protege out of the svn
>> >>>repository or source code distribution are here:
>> >>>http://protege.stanford.edu/doc/readme.html
>> >>>
>> >>>However, I don't think that you need to recompile Protege. I
>> >>>suppose, you can use the Protege jars and only recompile the
>> >>>Eclipse plugin code.
>> >>>
>> >>>Tania
>> >>>
>> >>>
>> >>>Mark Feblowitz wrote:
>> >>>>My prior questions had to do with my efforts to update the
>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
>> >>>>
>> >>>>I'm trying to debug and have the need to debug the source of
>> >>>>Protege. I've imported the Protege core, but have a persistent
>> >>>>problem with two build errors:
>> >>>>
>> >>>>         The project was not built since its build path is
>> >>>> incomplete. Cannot find the class file for
>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
>> >>>>
>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
>> >>>>     resolved. It is indirectly referenced from required .class
>> files
>> >>>>     Protege/src/edu/stanford/smi/protege/util
>> >>>>ProtegePlasticTheme.java
>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
>> >>>>get 4 errors about
>> >>>>
>> >>>>     "Parser cannot be resolved to at type"
>> >>>>and 42 errors about
>> >>>>
>> >>>>     jThe declared package "javax.swing.plaf.metal" does not
>> match the
>> >>>>     expected package "edu.stanford.smi.protege.util"
>> >>>>
>> >>>>I'm doing this work within ecplise 3.2.0
>> >>>>
>> >>>>What should I be using for my JRE? Any additional jars in the
>> >>>>build path needed to reference
>> javax.swing.plaf.metal.DefaultMetalTheme?
>> >>>>
>> >>>>Thanks,
>> >>>>
>> >>>>Mark
>> >>>>
>> >>>>
>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
>> >>>>>Mark,
>> >>>>>
>> >>>>>We are very careful not to delete or move public classes or
>> methods.
>> >>>>>
>> >>>>>The
>> >>>>>
>> >>>>>edu.stanford.smi.protege.util.FileHandler
>> >>>>>
>> >>>>>is in the same place :)
>> >>>>>
>> >>>>>In which version did Protege have a detachCurrentTab() method in
>> >>>>>ProjectView? I think the method you are looking for is the
>> >>>>>detachCurrentView().
>> >>>>>
>> >>>>>The DefaultEntry is still in the same place:
>> >>>>>
>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
>> >>>>>
>> >>>>>Are you using the right jars?
>> >>>>>
>> >>>>>Tania
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>Mark Feblowitz wrote:
>> >>>>> > Add to that
>> >>>>> >
>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
>> >>>>> >
>> >>>>> >
>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
>> >>>>> > >> I was wondering what became of these two classes in Protege:
>> >>>>> >>
>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView - specifically
>> >>>>> >> detachCurrentTab()
>> >>>>> >>
>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
>> >>>>> >>
>> >>>>> >> Have these been moved, removed or replaced? What would be
>> >>>>> the new equivalents?
>> >>>>> >>
>> >>>>> >> Thanks,
>> >>>>> >>
>> >>>>> >> Mark
>> >>>>> >> _______________________________________________
>> >>>>> >> protege-discussion mailing list
>> >>>>> >> [hidden email]
>> >>>>> >>
>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>> >>>>> >>
>> >>>>> >> Instructions for unsubscribing:
>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
>> >>>>> >>
>> >>>>> >
>> >>>>> > _______________________________________________
>> >>>>> > protege-discussion mailing list
>> >>>>> > [hidden email]
>> >>>>> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>> >>>>> >
>> >>>>> > Instructions for unsubscribing:
>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>> >>>>> >
>> >>>>> >
>> >>>>>_______________________________________________
>> >>>>>protege-discussion mailing list
>> >>>>>[hidden email]
>> >>>>>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>> >>>>>
>> >>>>>Instructions for unsubscribing:
>> >>>>>http://protege.stanford.edu/doc/faq.html#01a.03
>>
>> _______________________________________________
>> protege-discussion mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>
>> Instructions for unsubscribing:
>> http://protege.stanford.edu/doc/faq.html#01a.03
>
>

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

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

Re: Build Questions (was Re: Question on some old classes/methods)

Mark Feblowitz
I was finally able to debug the problem and to come up with a solution.

The problem is in ProjectManager.java: setCurrentProject has the side
effect of displaying the project, using the standard
displayCurrentProject method. This is probably a fine optimization
for most uses of Protege. The LexGrid code wants to display the
project in an Eclipse environment, though. So the caller has a
choice: call code that doesn't set the current project (and break the
metadata tab code) or call the code that sets the current project and
have an exception in the LexGrid code when Protege tries to display
to a nonexistent root frame.

My workaround is to replace the current setCurrentProject(Project
project, boolean remote) method with the following:

    public void setCurrentProject(Project project, boolean remote) {
         setCurrentProject(project, true, false);
     }

and to add the following method:

    public void setCurrentProject(Project project, boolean remote,
boolean suppressDisplay) {
         if (closeProjectRequest()) {
             _currentProject = project;
             if (_currentProject != null && !suppressDisplay) {
                 _projectPluginManager.afterLoad(_currentProject);
                 displayCurrentProject(remote);
             }
         }
     }

It might be better to factor out the call to displayCurrentProject
from the setCurrentProject code, but that'd be a judgement call on
the part of the designers.

How could I get this accommodated an upcoming Protege build?

Thanks,

Mark


At 03:08 PM 10/24/2006, Tania Tudorache wrote:

>Mark,
>
>You can load a project using a call like:
>
>Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj", errors);
>
>This will set the correct current project.
>
>You also got a class not found error. The class that was not found
>was in the jena.jar.  Did you add to your Eclipse project:
>
>- the protege.jar (or protege-cores sources)
>- the protege-owl.jar (or protege-owl sources)
>
>If you compile the protege-owl sources, than you need to add to the
>Eclipse project all the jars from the protege owl plugin directory
>(such as, jena.jar, owlsyntax.jar, etc.).
>
>Tania
>
>
>
>Mark Feblowitz wrote:
>>Since there's been radio silence on this, I'll restate my request
>>as I currently understand it.
>>
>>What is the best way to load a project, such that currentProject is
>>set correctly?  It seems like simply issuing a "new Project(...)"
>>doesn't do the trick.
>>
>>(Is that a bug or simply an incomplete creation/loading of the project?)
>>
>>It would help to see some code that loads a project (that is an Owl project).
>>
>>Thanks,
>>
>>Mark
>>
>>
>>At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
>>>Ok -
>>>
>>>Forget all of my prior questions :-) Using ant instead of eclipse,
>>>I've been able to debug and diagnose the problem I'm having.
>>>
>>>You were right on the money!
>>>
>>>The LexGrid Protege in Eclipse code creates a project and project
>>>views, but does not set the current project.
>>>
>>>The problem comes when trying to get the current project.
>>>
>>>I assume that the LG code is using some outdated means of loading a
>>>project. Below is the method that appears to be flawed.
>>>
>>>Can you point me to something the does this correctly?
>>>
>>>Thanks!
>>>
>>>Mark
>>>
>>>from LgProtegeEditor.java:
>>>...
>>>public void init() throws SwingInitException {
>>>          try {
>>>                  final IFileEditorInput input = (IFileEditorInput)
>>>getEditorInput();
>>>                  if (input != null) {
>>>                          Collection errs = new ArrayList();
>>>                          p = new
>>>
>>>Project(((org.eclipse.core.internal.resources.File)
>>>
>>>input.getStorage()).getRawLocation().toString(), errs);
>>>                          if (!disposed) {
>>>                                  if (!errs.isEmpty()) {
>>>                                          for (Iterator errIt =
>>>                                         errs.iterator(); errIt.hasNext(); )
>>>
>>>Plugin.log(IStatus.ERROR,
>>>
>>>errIt.next().toString());
>>>                                              display.syncExec(new
>>> Runnable() {
>>>                                                  public void run() {
>>>
>>>MessageDialog.openError(getSite().getShell(),
>>>                                         "Error",
>>>
>>>"Errors occurred initializing the Protege project. Refer to the
>>>error log for  additional information.");
>>>                                                  }
>>>                                          });
>>>                                  }
>>>                                  if (p.hasCompleteSources()) {
>>>                                          // Create the
>>> Swing-based canvas ...
>>>                                          pv = new ProjectView(p);
>>>                                          f.setLayout(new
>>> java.awt.BorderLayout());
>>>                                          f.add(pv, "Center");
>>>                                          f.addWindowListener(new
>>> WindowAdapter() {
>>>                                                  public void
>>> windowClosing(WindowEvent event) {
>>>                                                          dispose();
>>>                                                  }
>>>                                          });
>>>                                          // Fresh starting point
>>> for edit tracking ...
>>>                                          p.clearIsDirty();
>>>                                  } else {
>>>                                          throw new SwingInitException();
>>>                                  }
>>>                          }
>>>                  }
>>>...
>>>
>>>
>>>At 04:50 PM 10/17/2006, Tania Tudorache wrote:
>>> >Mark,
>>> >
>>> >I can't tell you what's going on, if I don't know in which line the
>>> >exception occurred. I suppose it occurred in
>>> >
>>> >String projName =
>>> >ProjectManager.getProjectManager().getCurrentProject().getName();
>>> >
>>> >which probably means that the project manager was not initialized
>>> >correctly, or that the project was not yet created.
>>> >
>>> >Maybe some things have also changed in Eclipse initialization as
>>> >well. I know that they support only partially Swing applications.
>>> >
>>> >Tania
>>> >
>>> >
>>> >
>>> >Mark Feblowitz wrote:
>>> >>I am using Java 1.5, either the IBM version or the Sun version.
>>> >>
>>> >>I'll see if I can get some help here in using eclipse to do the build.
>>> >>
>>> >>I'm bringing in the Protege source to debug what's happening in
>>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
>>> >>like it occurs in the Protege code. Here's the exception:
>>> >>
>>> >>WARNING: _java.lang.NullPointerException
>>> >>_at
>>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.cr
>>> ea teOntologyBrowserHeader(Unknown
>>> >>Source)
>>> >>at
>>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<i
>>> ni t>(Unknown
>>> >>Source)
>>> >>at
>>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.crea
>>> te MainPanel(Unknown
>>> >>Source)
>>> >>at
>>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.init
>>> ia lize(Unknown
>>> >>Source)
>>> >>at
>>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(
>>> Un known Source)
>>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
>>> >>at
>>> edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown Source)
>>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
>>> >>at
>>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
>>> >>_LgProtegeEditor.java:180_ )
>>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
>>> >>_LgProtegeEditor.java:338_ )
>>> >>at
>>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
>>> >>( _LgProtegeEditor.java:266_ )
>>> >>
>>> >>Mark
>>> >>
>>> >>
>>> >>
>>> >>At 02:48 PM 10/17/2006, you wrote:
>>> >>>Mark,
>>> >>>
>>> >>>If you use the latest Protege 3.2 beta, than you should use Java 1.5.
>>> >>>
>>> >>>The Parser class is automatically generated by the Protege build
>>> >>>script. The instructions for building Protege out of the svn
>>> >>>repository or source code distribution are here:
>>> >>>http://protege.stanford.edu/doc/readme.html
>>> >>>
>>> >>>However, I don't think that you need to recompile Protege. I
>>> >>>suppose, you can use the Protege jars and only recompile the
>>> >>>Eclipse plugin code.
>>> >>>
>>> >>>Tania
>>> >>>
>>> >>>
>>> >>>Mark Feblowitz wrote:
>>> >>>>My prior questions had to do with my efforts to update the
>>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
>>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
>>> >>>>
>>> >>>>I'm trying to debug and have the need to debug the source of
>>> >>>>Protege. I've imported the Protege core, but have a persistent
>>> >>>>problem with two build errors:
>>> >>>>
>>> >>>>         The project was not built since its build path is
>>> >>>> incomplete. Cannot find the class file for
>>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
>>> >>>>
>>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
>>> >>>>     resolved. It is indirectly referenced from required .class files
>>> >>>>     Protege/src/edu/stanford/smi/protege/util
>>> >>>>ProtegePlasticTheme.java
>>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
>>> >>>>get 4 errors about
>>> >>>>
>>> >>>>     "Parser cannot be resolved to at type"
>>> >>>>and 42 errors about
>>> >>>>
>>> >>>>     jThe declared package "javax.swing.plaf.metal" does not match the
>>> >>>>     expected package "edu.stanford.smi.protege.util"
>>> >>>>
>>> >>>>I'm doing this work within ecplise 3.2.0
>>> >>>>
>>> >>>>What should I be using for my JRE? Any additional jars in the
>>> >>>>build path needed to reference
>>> javax.swing.plaf.metal.DefaultMetalTheme?
>>> >>>>
>>> >>>>Thanks,
>>> >>>>
>>> >>>>Mark
>>> >>>>
>>> >>>>
>>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
>>> >>>>>Mark,
>>> >>>>>
>>> >>>>>We are very careful not to delete or move public classes or methods.
>>> >>>>>
>>> >>>>>The
>>> >>>>>
>>> >>>>>edu.stanford.smi.protege.util.FileHandler
>>> >>>>>
>>> >>>>>is in the same place :)
>>> >>>>>
>>> >>>>>In which version did Protege have a detachCurrentTab() method in
>>> >>>>>ProjectView? I think the method you are looking for is the
>>> >>>>>detachCurrentView().
>>> >>>>>
>>> >>>>>The DefaultEntry is still in the same place:
>>> >>>>>
>>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
>>> >>>>>
>>> >>>>>Are you using the right jars?
>>> >>>>>
>>> >>>>>Tania
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>>Mark Feblowitz wrote:
>>> >>>>> > Add to that
>>> >>>>> >
>>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
>>> >>>>> >
>>> >>>>> >
>>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
>>> >>>>> > >> I was wondering what became of these two classes in Protege:
>>> >>>>> >>
>>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView - specifically
>>> >>>>> >> detachCurrentTab()
>>> >>>>> >>
>>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
>>> >>>>> >>
>>> >>>>> >> Have these been moved, removed or replaced? What would be
>>> >>>>> the new equivalents?
>>> >>>>> >>
>>> >>>>> >> Thanks,
>>> >>>>> >>
>>> >>>>> >> Mark
>>> >>>>> >> _______________________________________________
>>> >>>>> >> protege-discussion mailing list
>>> >>>>> >> [hidden email]
>>> >>>>> >> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>> >>>>> >>
>>> >>>>> >> Instructions for unsubscribing:
>>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
>>> >>>>> >>
>>> >>>>> >
>>> >>>>> > _______________________________________________
>>> >>>>> > protege-discussion mailing list
>>> >>>>> > [hidden email]
>>> >>>>> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>> >>>>> >
>>> >>>>> > Instructions for unsubscribing:
>>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
>>> >>>>> >
>>> >>>>> >
>>> >>>>>_______________________________________________
>>> >>>>>protege-discussion mailing list
>>> >>>>>[hidden email]
>>> >>>>>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>> >>>>>
>>> >>>>>Instructions for unsubscribing:
>>> >>>>>http://protege.stanford.edu/doc/faq.html#01a.03
>>>
>>>_______________________________________________
>>>protege-discussion mailing list
>>>[hidden email]
>>>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>>
>>>Instructions for unsubscribing:
>>>http://protege.stanford.edu/doc/faq.html#01a.03
>>
_______________________________________________
protege-discussion mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-discussion

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

Re: Build Questions (was Re: Question on some old classes/methods)

Mark Feblowitz
In reply to this post by Mark Feblowitz
(Sending this again - no response to the first one...)

I was finally able to debug the problem and to come up with a solution.

The problem is in ProjectManager.java: setCurrentProject has the side
effect of displaying the project, using the standard
displayCurrentProject method. This is probably a fine optimization
for most uses of Protege. The LexGrid code wants to display the
project in an Eclipse environment, though. So the caller has a
choice: call code that doesn't set the current project (and break the
metadata tab code) or call the code that sets the current project and
have an exception in the LexGrid code when Protege tries to display
to a nonexistent root frame.

My workaround is to replace the current setCurrentProject(Project
project, boolean remote) method with the following:

     public void setCurrentProject(Project project, boolean remote) {
          setCurrentProject(project, true, false);
      }

and to add the following method:

     public void setCurrentProject(Project project, boolean remote,
boolean suppressDisplay) {
          if (closeProjectRequest()) {
              _currentProject = project;
              if (_currentProject != null && !suppressDisplay) {
                  _projectPluginManager.afterLoad(_currentProject);
                  displayCurrentProject(remote);
              }
          }
      }

It might be better to factor out the call to displayCurrentProject
from the setCurrentProject code, but that'd be a judgement call on
the part of the designers.

How could I get this accommodated an upcoming Protege build?

Also, I am still observing the following exception when starting
LexGrid Protege. It's not a show stopper, but I like to make it go
away. Any ideas?

Can't load log handler "edu.stanford.smi.protege.util.FileHandler"
java.lang.ClassNotFoundException: edu.stanford.smi.protege.util.FileHandler
java.lang.ClassNotFoundException: edu.stanford.smi.protege.util.FileHandler
at java.net.URLClassLoader.findClass(URLClassLoader.java:492)
at java.lang.ClassLoader.loadClass(ClassLoader.java:606)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
at java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at java.util.logging.LogManager$7.run(LogManager.java:916)
at java.security.AccessController.doPrivileged(AccessController.java:193)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:906)
at java.util.logging.LogManager.access$900(LogManager.java:154)
at java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:1016)
at java.util.logging.Logger.log(Logger.java:465)
at java.util.logging.Logger.doLog(Logger.java:491)
at java.util.logging.Logger.log(Logger.java:514)
at java.util.logging.Logger.config(Logger.java:1049)
at edu.stanford.smi.protege.util.SystemUtilities.logSystemInfo(Unknown Source)
at edu.stanford.smi.protege.util.SystemUtilities.init(Unknown Source)
at edu.stanford.smi.protege.util.SystemUtilities.<clinit>(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at
edu.stanford.smi.protege.util.ApplicationProperties.getApplicationDirectory(Unknown
Source)
at
edu.stanford.smi.protege.util.ApplicationProperties.getPropertiesDirectory(Unknown
Source)
at edu.stanford.smi.protege.util.ApplicationProperties.<clinit>(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at
edu.stanford.smi.protege.plugin.PluginUtilities.findPluginsDirectory(Unknown
Source)
at edu.stanford.smi.protege.plugin.PluginUtilities.loadPlugins(Unknown Source)
at edu.stanford.smi.protege.plugin.PluginUtilities.init(Unknown Source)
at edu.stanford.smi.protege.plugin.PluginUtilities.<clinit>(Unknown Source)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at org.lexgrid.ui.extension.protege.Plugin.<clinit>(Plugin.java:61)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:177)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1243)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:136)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:966)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:317)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:256)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(EclipseLazyStarter.java:86)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:402)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:339)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:391)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:352)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:276)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1245)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:147)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
at
org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:242)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:238)
at
org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:231)
at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:908)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:549)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:263)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1420)
at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.java:1005)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.EditorManager.restoreState(EditorManager.java:1000)
at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2785)
at
org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1936)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2857)
at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2805)
at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1681)
at
org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1421)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1679)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1650)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1473)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Thanks,

Mark


At 03:08 PM 10/24/2006, Tania Tudorache wrote:
 >Mark,
 >
 >You can load a project using a call like:
 >
 >Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj", errors);
 >
 >This will set the correct current project.
 >
 >You also got a class not found error. The class that was not found
 >was in the jena.jar.  Did you add to your Eclipse project:
 >
 >- the protege.jar (or protege-cores sources)
 >- the protege-owl.jar (or protege-owl sources)
 >
 >If you compile the protege-owl sources, than you need to add to the
 >Eclipse project all the jars from the protege owl plugin directory
 >(such as, jena.jar, owlsyntax.jar, etc.).
 >
 >Tania
 >
 >
 >
 >Mark Feblowitz wrote:
 >>Since there's been radio silence on this, I'll restate my request
 >>as I currently understand it.
 >>
 >>What is the best way to load a project, such that currentProject is
 >>set correctly?  It seems like simply issuing a "new Project(...)"
 >>doesn't do the trick.
 >>
 >>(Is that a bug or simply an incomplete creation/loading of the project?)
 >>
 >>It would help to see some code that loads a project (that is an
Owl project).
 >>
 >>Thanks,
 >>
 >>Mark
 >>
 >>
 >>At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
 >>>Ok -
 >>>
 >>>Forget all of my prior questions :-) Using ant instead of eclipse,
 >>>I've been able to debug and diagnose the problem I'm having.
 >>>
 >>>You were right on the money!
 >>>
 >>>The LexGrid Protege in Eclipse code creates a project and project
 >>>views, but does not set the current project.
 >>>
 >>>The problem comes when trying to get the current project.
 >>>
 >>>I assume that the LG code is using some outdated means of loading a
 >>>project. Below is the method that appears to be flawed.
 >>>
 >>>Can you point me to something the does this correctly?
 >>>
 >>>Thanks!
 >>>
 >>>Mark
 >>>
 >>>from LgProtegeEditor.java:
 >>>...
 >>>public void init() throws SwingInitException {
 >>>          try {
 >>>                  final IFileEditorInput input = (IFileEditorInput)
 >>>getEditorInput();
 >>>                  if (input != null) {
 >>>                          Collection errs = new ArrayList();
 >>>                          p = new
 >>>
 >>>Project(((org.eclipse.core.internal.resources.File)
 >>>
 >>>input.getStorage()).getRawLocation().toString(), errs);
 >>>                          if (!disposed) {
 >>>                                  if (!errs.isEmpty()) {
 >>>                                          for (Iterator errIt =
 >>>                                         errs.iterator();
errIt.hasNext(); )
 >>>
 >>>Plugin.log(IStatus.ERROR,
 >>>
 >>>errIt.next().toString());
 >>>                                              display.syncExec(new
 >>> Runnable() {
 >>>                                                  public void run() {
 >>>
 >>>MessageDialog.openError(getSite().getShell(),
 >>>                                         "Error",
 >>>
 >>>"Errors occurred initializing the Protege project. Refer to the
 >>>error log for  additional information.");
 >>>                                                  }
 >>>                                          });
 >>>                                  }
 >>>                                  if (p.hasCompleteSources()) {
 >>>                                          // Create the
 >>> Swing-based canvas ...
 >>>                                          pv = new ProjectView(p);
 >>>                                          f.setLayout(new
 >>> java.awt.BorderLayout());
 >>>                                          f.add(pv, "Center");
 >>>                                          f.addWindowListener(new
 >>> WindowAdapter() {
 >>>                                                  public void
 >>> windowClosing(WindowEvent event) {
 >>>                                                          dispose();
 >>>                                                  }
 >>>                                          });
 >>>                                          // Fresh starting point
 >>> for edit tracking ...
 >>>                                          p.clearIsDirty();
 >>>                                  } else {
 >>>                                          throw new SwingInitException();
 >>>                                  }
 >>>                          }
 >>>                  }
 >>>...
 >>>
 >>>
 >>>At 04:50 PM 10/17/2006, Tania Tudorache wrote:
 >>> >Mark,
 >>> >
 >>> >I can't tell you what's going on, if I don't know in which line the
 >>> >exception occurred. I suppose it occurred in
 >>> >
 >>> >String projName =
 >>> >ProjectManager.getProjectManager().getCurrentProject().getName();
 >>> >
 >>> >which probably means that the project manager was not initialized
 >>> >correctly, or that the project was not yet created.
 >>> >
 >>> >Maybe some things have also changed in Eclipse initialization as
 >>> >well. I know that they support only partially Swing applications.
 >>> >
 >>> >Tania
 >>> >
 >>> >
 >>> >
 >>> >Mark Feblowitz wrote:
 >>> >>I am using Java 1.5, either the IBM version or the Sun version.
 >>> >>
 >>> >>I'll see if I can get some help here in using eclipse to do the build.
 >>> >>
 >>> >>I'm bringing in the Protege source to debug what's happening in
 >>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
 >>> >>like it occurs in the Protege code. Here's the exception:
 >>> >>
 >>> >>WARNING: _java.lang.NullPointerException
 >>> >>_at
 >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.cr
 >>> ea teOntologyBrowserHeader(Unknown
 >>> >>Source)
 >>> >>at
 >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<i
 >>> ni t>(Unknown
 >>> >>Source)
 >>> >>at
 >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.crea
 >>> te MainPanel(Unknown
 >>> >>Source)
 >>> >>at
 >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.init
 >>> ia lize(Unknown
 >>> >>Source)
 >>> >>at
 >>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(
 >>> Un known Source)
 >>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
 >>> >>at
 >>> edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown Source)
 >>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
 >>> >>at
 >>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
 >>> >>_LgProtegeEditor.java:180_ )
 >>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
 >>> >>_LgProtegeEditor.java:338_ )
 >>> >>at
 >>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
 >>> >>( _LgProtegeEditor.java:266_ )
 >>> >>
 >>> >>Mark
 >>> >>
 >>> >>
 >>> >>
 >>> >>At 02:48 PM 10/17/2006, you wrote:
 >>> >>>Mark,
 >>> >>>
 >>> >>>If you use the latest Protege 3.2 beta, than you should use Java 1.5.
 >>> >>>
 >>> >>>The Parser class is automatically generated by the Protege build
 >>> >>>script. The instructions for building Protege out of the svn
 >>> >>>repository or source code distribution are here:
 >>> >>>http://protege.stanford.edu/doc/readme.html
 >>> >>>
 >>> >>>However, I don't think that you need to recompile Protege. I
 >>> >>>suppose, you can use the Protege jars and only recompile the
 >>> >>>Eclipse plugin code.
 >>> >>>
 >>> >>>Tania
 >>> >>>
 >>> >>>
 >>> >>>Mark Feblowitz wrote:
 >>> >>>>My prior questions had to do with my efforts to update the
 >>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
 >>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
 >>> >>>>
 >>> >>>>I'm trying to debug and have the need to debug the source of
 >>> >>>>Protege. I've imported the Protege core, but have a persistent
 >>> >>>>problem with two build errors:
 >>> >>>>
 >>> >>>>         The project was not built since its build path is
 >>> >>>> incomplete. Cannot find the class file for
 >>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
 >>> >>>>
 >>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
 >>> >>>>     resolved. It is indirectly referenced from required .class files
 >>> >>>>     Protege/src/edu/stanford/smi/protege/util
 >>> >>>>ProtegePlasticTheme.java
 >>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
 >>> >>>>get 4 errors about
 >>> >>>>
 >>> >>>>     "Parser cannot be resolved to at type"
 >>> >>>>and 42 errors about
 >>> >>>>
 >>> >>>>     jThe declared package "javax.swing.plaf.metal" does not match the
 >>> >>>>     expected package "edu.stanford.smi.protege.util"
 >>> >>>>
 >>> >>>>I'm doing this work within ecplise 3.2.0
 >>> >>>>
 >>> >>>>What should I be using for my JRE? Any additional jars in the
 >>> >>>>build path needed to reference
 >>> javax.swing.plaf.metal.DefaultMetalTheme?
 >>> >>>>
 >>> >>>>Thanks,
 >>> >>>>
 >>> >>>>Mark
 >>> >>>>
 >>> >>>>
 >>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
 >>> >>>>>Mark,
 >>> >>>>>
 >>> >>>>>We are very careful not to delete or move public classes or methods.
 >>> >>>>>
 >>> >>>>>The
 >>> >>>>>
 >>> >>>>>edu.stanford.smi.protege.util.FileHandler
 >>> >>>>>
 >>> >>>>>is in the same place :)
 >>> >>>>>
 >>> >>>>>In which version did Protege have a detachCurrentTab() method in
 >>> >>>>>ProjectView? I think the method you are looking for is the
 >>> >>>>>detachCurrentView().
 >>> >>>>>
 >>> >>>>>The DefaultEntry is still in the same place:
 >>> >>>>>
 >>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
 >>> >>>>>
 >>> >>>>>Are you using the right jars?
 >>> >>>>>
 >>> >>>>>Tania
 >>> >>>>>
 >>> >>>>>
 >>> >>>>>
 >>> >>>>>
 >>> >>>>>Mark Feblowitz wrote:
 >>> >>>>> > Add to that
 >>> >>>>> >
 >>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
 >>> >>>>> >
 >>> >>>>> >
 >>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
 >>> >>>>> > >> I was wondering what became of these two classes in Protege:
 >>> >>>>> >>
 >>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView - specifically
 >>> >>>>> >> detachCurrentTab()
 >>> >>>>> >>
 >>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
 >>> >>>>> >>
 >>> >>>>> >> Have these been moved, removed or replaced? What would be
 >>> >>>>> the new equivalents?
 >>> >>>>> >>
 >>> >>>>> >> Thanks,
 >>> >>>>> >>
 >>> >>>>> >> Mark
 >>> >>>>> >> _______________________________________________
 >>> >>>>> >> protege-discussion mailing list
 >>> >>>>> >> [hidden email]
 >>> >>>>> >> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
 >>> >>>>> >>
 >>> >>>>> >> Instructions for unsubscribing:
 >>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
 >>> >>>>> >>
 >>> >>>>> >
 >>> >>>>> > _______________________________________________
 >>> >>>>> > protege-discussion mailing list
 >>> >>>>> > [hidden email]
 >>> >>>>> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
 >>> >>>>> >
 >>> >>>>> > Instructions for unsubscribing:
 >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
 >>> >>>>> >
 >>> >>>>> >
 >>> >>>>>_______________________________________________
 >>> >>>>>protege-discussion mailing list
 >>> >>>>>[hidden email]
 >>> >>>>>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
 >>> >>>>>
 >>> >>>>>Instructions for unsubscribing:
 >>> >>>>>http://protege.stanford.edu/doc/faq.html#01a.03
 >>>
 >>>_______________________________________________
 >>>protege-discussion mailing list
 >>>[hidden email]
 >>>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
 >>>
 >>>Instructions for unsubscribing:
 >>>http://protege.stanford.edu/doc/faq.html#01a.03
 >>
_______________________________________________
protege-discussion mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-discussion

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

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

Re: Build Questions (was Re: Question on some old classes/methods)

Tania Tudorache
Mark,

We are considering your solution. However, if the problem is in the OWL
Metadata Tab, I would rather fix that than change the setCurrentProject
method.

Can you please send a stack trace of the error that you get from the OWL
Metadata Tab?

The class not found exception, seem to indicate that you don't have
protege.jar in the classpath. The FileHandler class is in protege.jar.
But this would be strange, cause other things would also not work. Did
you include all the jars in the owl plugins directory in your classpath?
Like log4j? It seems the exception is caused by the java Logger which
cannot find a log handler defined in protege.jar. This is defined in the
logging.properties file in the Protege installation directory.

I suppose that a solution would be either to delete the
logging.properties file, or to comment out the  
edu.stanford.smi.protege.util.FileHandler from the line where it is
defined. (the line starts with "handlers=...")

Tania

Mark Feblowitz wrote:

> (Sending this again - no response to the first one...)
>
> I was finally able to debug the problem and to come up with a solution.
>
> The problem is in ProjectManager.java: setCurrentProject has the side
> effect of displaying the project, using the standard
> displayCurrentProject method. This is probably a fine optimization
> for most uses of Protege. The LexGrid code wants to display the
> project in an Eclipse environment, though. So the caller has a
> choice: call code that doesn't set the current project (and break the
> metadata tab code) or call the code that sets the current project and
> have an exception in the LexGrid code when Protege tries to display
> to a nonexistent root frame.
>
> My workaround is to replace the current setCurrentProject(Project
> project, boolean remote) method with the following:
>
>     public void setCurrentProject(Project project, boolean remote) {
>          setCurrentProject(project, true, false);
>      }
>
> and to add the following method:
>
>     public void setCurrentProject(Project project, boolean remote,
> boolean suppressDisplay) {
>          if (closeProjectRequest()) {
>              _currentProject = project;
>              if (_currentProject != null && !suppressDisplay) {
>                  _projectPluginManager.afterLoad(_currentProject);
>                  displayCurrentProject(remote);
>              }
>          }
>      }
>
> It might be better to factor out the call to displayCurrentProject
> from the setCurrentProject code, but that'd be a judgement call on
> the part of the designers.
>
> How could I get this accommodated an upcoming Protege build?
>
> Also, I am still observing the following exception when starting
> LexGrid Protege. It's not a show stopper, but I like to make it go
> away. Any ideas?
>
> Can't load log handler "edu.stanford.smi.protege.util.FileHandler"
> _ java.lang.ClassNotFoundException_ :
> edu.stanford.smi.protege.util.FileHandler
> _ java.lang.ClassNotFoundException_ :
> edu.stanford.smi.protege.util.FileHandler
> at java.net.URLClassLoader.findClass( _URLClassLoader.java:492_ )
> at java.lang.ClassLoader.loadClass( _ClassLoader.java:606_ )
> at sun.misc.Launcher$AppClassLoader.loadClass( _Launcher.java:327_ )
> at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> at java.util.logging.LogManager$7.run( _LogManager.java:916_ )
> at java.security.AccessController.doPrivileged(
> _AccessController.java:193_ )
> at java.util.logging.LogManager.initializeGlobalHandlers(
> _LogManager.java:906_ )
> at java.util.logging.LogManager.access$900( _LogManager.java:154_ )
> at java.util.logging.LogManager$RootLogger.getHandlers(
> _LogManager.java:1016_ )
> at java.util.logging.Logger.log( _Logger.java:465_ )
> at java.util.logging.Logger.doLog( _Logger.java:491_ )
> at java.util.logging.Logger.log( _Logger.java:514_ )
> at java.util.logging.Logger.config( _Logger.java:1049_ )
> at edu.stanford.smi.protege.util.SystemUtilities.logSystemInfo(Unknown
> Source)
> at edu.stanford.smi.protege.util.SystemUtilities.init(Unknown Source)
> at edu.stanford.smi.protege.util.SystemUtilities.<clinit>(Unknown Source)
> at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> at
> edu.stanford.smi.protege.util.ApplicationProperties.getApplicationDirectory(Unknown
> Source)
> at
> edu.stanford.smi.protege.util.ApplicationProperties.getPropertiesDirectory(Unknown
> Source)
> at
> edu.stanford.smi.protege.util.ApplicationProperties.<clinit>(Unknown
> Source)
> at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> at
> edu.stanford.smi.protege.plugin.PluginUtilities.findPluginsDirectory(Unknown
> Source)
> at edu.stanford.smi.protege.plugin.PluginUtilities.loadPlugins(Unknown
> Source)
> at edu.stanford.smi.protege.plugin.PluginUtilities.init(Unknown Source)
> at edu.stanford.smi.protege.plugin.PluginUtilities.<clinit>(Unknown
> Source)
> at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> at org.lexgrid.ui.extension.protege.Plugin.<clinit>( _Plugin.java:61_ )
> at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> at java.lang.Class.newInstanceImpl( _Native Method_)
> at java.lang.Class.newInstance( _Class.java:1243_ )
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(
> _AbstractBundle.java:136_ )
> at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
> _BundleContextImpl.java:966_ )
> at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
> _BundleHost.java:317_ )
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
> _AbstractBundle.java:256_ )
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(
> _EclipseLazyStarter.java:86_ )
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
> _ClasspathManager.java:402_ )
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(
> _DefaultClassLoader.java:188_ )
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
> _BundleLoader.java:339_ )
> at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> _BundleLoader.java:391_ )
> at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> _BundleLoader.java:352_ )
> at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
> _DefaultClassLoader.java:83_ )
> at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(
> _BundleLoader.java:276_ )
> at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(
> _BundleHost.java:227_ )
> at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(
> _AbstractBundle.java:1245_ )
> at
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(
> _RegistryStrategyOSGI.java:147_ )
> at
> org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(
> _ExtensionRegistry.java:759_ )
> at
> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(
> _ConfigurationElement.java:243_ )
> at
> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(
> _ConfigurationElementHandle.java:51_ )
> at org.eclipse.ui.internal.WorkbenchPlugin$1.run(
> _WorkbenchPlugin.java:242_ )
> at org.eclipse.swt.custom.BusyIndicator.showWhile(
> _BusyIndicator.java:67_ )
> at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(
> _WorkbenchPlugin.java:238_ )
> at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(
> _EditorDescriptor.java:231_ )
> at org.eclipse.ui.internal.EditorManager.createPart(
> _EditorManager.java:908_ )
> at org.eclipse.ui.internal.EditorReference.createPartHelper(
> _EditorReference.java:549_ )
> at org.eclipse.ui.internal.EditorReference.createPart(
> _EditorReference.java:372_ )
> at org.eclipse.ui.internal.WorkbenchPartReference.getPart(
> _WorkbenchPartReference.java:566_ )
> at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(
> _EditorAreaHelper.java:263_ )
> at org.eclipse.ui.internal.EditorManager.setVisibleEditor(
> _EditorManager.java:1420_ )
> at org.eclipse.ui.internal.EditorManager$5.run(
> _EditorManager.java:1005_ )
> at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> at org.eclipse.core.runtime.Platform.run( _Platform.java:843_ )
> at org.eclipse.ui.internal.EditorManager.restoreState(
> _EditorManager.java:1000_ )
> at org.eclipse.ui.internal.WorkbenchPage.restoreState(
> _WorkbenchPage.java:2785_ )
> at org.eclipse.ui.internal.WorkbenchWindow.restoreState(
> _WorkbenchWindow.java:1936_ )
> at org.eclipse.ui.internal.Workbench.doRestoreState(
> _Workbench.java:2857_ )
> at org.eclipse.ui.internal.Workbench.access$14( _Workbench.java:2805_ )
> at org.eclipse.ui.internal.Workbench$19.run( _Workbench.java:1681_ )
> at org.eclipse.ui.internal.Workbench.runStartupWithProgress(
> _Workbench.java:1421_ )
> at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1679_ )
> at org.eclipse.ui.internal.Workbench.access$12( _Workbench.java:1650_ )
> at org.eclipse.ui.internal.Workbench$17.run( _Workbench.java:1529_ )
> at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1473_ )
> at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(
> _WorkbenchConfigurer.java:183_ )
> at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(
> _WorkbenchAdvisor.java:702_ )
> at org.eclipse.ui.internal.Workbench.init( _Workbench.java:1085_ )
> at org.eclipse.ui.internal.Workbench.runUI( _Workbench.java:1847_ )
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
> _Workbench.java:419_ )
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
> _PlatformUI.java:143_ )
> at org.eclipse.ui.internal.ide.IDEApplication.run(
> _IDEApplication.java:95_ )
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> _PlatformActivator.java:78_ )
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
> _EclipseAppLauncher.java:92_ )
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> _EclipseAppLauncher.java:68_ )
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> _EclipseStarter.java:400_ )
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> _EclipseStarter.java:177_ )
> at sun.reflect.NativeMethodAccessorImpl.invoke0( _Native Method_)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> _NativeMethodAccessorImpl.java:64_ )
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> _DelegatingMethodAccessorImpl.java:43_ )
> at java.lang.reflect.Method.invoke( _Method.java:615_ )
> at org.eclipse.core.launcher.Main.invokeFramework( _Main.java:336_ )
> at org.eclipse.core.launcher.Main.basicRun( _Main.java:280_ )
> at org.eclipse.core.launcher.Main.run( _Main.java:977_ )
> at org.eclipse.core.launcher.Main.main( _Main.java:952_ )
> Thanks,
>
> Mark
>
>
> At 03:08 PM 10/24/2006, Tania Tudorache wrote:
> >Mark,
> >
> >You can load a project using a call like:
> >
> >Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj",
> errors);
> >
> >This will set the correct current project.
> >
> >You also got a class not found error. The class that was not found
> >was in the jena.jar.  Did you add to your Eclipse project:
> >
> >- the protege.jar (or protege-cores sources)
> >- the protege-owl.jar (or protege-owl sources)
> >
> >If you compile the protege-owl sources, than you need to add to the
> >Eclipse project all the jars from the protege owl plugin directory
> >(such as, jena.jar, owlsyntax.jar, etc.).
> >
> >Tania
> >
> >
> >
> >Mark Feblowitz wrote:
> >>Since there's been radio silence on this, I'll restate my request
> >>as I currently understand it.
> >>
> >>What is the best way to load a project, such that currentProject is
> >>set correctly?  It seems like simply issuing a "new Project(...)"
> >>doesn't do the trick.
> >>
> >>(Is that a bug or simply an incomplete creation/loading of the project?)
> >>
> >>It would help to see some code that loads a project (that is an Owl
> project).
> >>
> >>Thanks,
> >>
> >>Mark
> >>
> >>
> >>At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
> >>>Ok -
> >>>
> >>>Forget all of my prior questions :-) Using ant instead of eclipse,
> >>>I've been able to debug and diagnose the problem I'm having.
> >>>
> >>>You were right on the money!
> >>>
> >>>The LexGrid Protege in Eclipse code creates a project and project
> >>>views, but does not set the current project.
> >>>
> >>>The problem comes when trying to get the current project.
> >>>
> >>>I assume that the LG code is using some outdated means of loading a
> >>>project. Below is the method that appears to be flawed.
> >>>
> >>>Can you point me to something the does this correctly?
> >>>
> >>>Thanks!
> >>>
> >>>Mark
> >>>
> >>>from LgProtegeEditor.java:
> >>>...
> >>>public void init() throws SwingInitException {
> >>>          try {
> >>>                  final IFileEditorInput input = (IFileEditorInput)
> >>>getEditorInput();
> >>>                  if (input != null) {
> >>>                          Collection errs = new ArrayList();
> >>>                          p = new
> >>>
> >>>Project(((org.eclipse.core.internal.resources.File)
> >>>
> >>>input.getStorage()).getRawLocation().toString(), errs);
> >>>                          if (!disposed) {
> >>>                                  if (!errs.isEmpty()) {
> >>>                                          for (Iterator errIt =
> >>>                                         errs.iterator();
> errIt.hasNext(); )
> >>>
> >>>Plugin.log(IStatus.ERROR,
> >>>
> >>>errIt.next().toString());
> >>>                                              display.syncExec(new
> >>> Runnable() {
> >>>                                                  public void run() {
> >>>
> >>>MessageDialog.openError(getSite().getShell(),
> >>>                                         "Error",
> >>>
> >>>"Errors occurred initializing the Protege project. Refer to the
> >>>error log for  additional information.");
> >>>                                                  }
> >>>                                          });
> >>>                                  }
> >>>                                  if (p.hasCompleteSources()) {
> >>>                                          // Create the
> >>> Swing-based canvas ...
> >>>                                          pv = new ProjectView(p);
> >>>                                          f.setLayout(new
> >>> java.awt.BorderLayout());
> >>>                                          f.add(pv, "Center");
> >>>                                          f.addWindowListener(new
> >>> WindowAdapter() {
> >>>                                                  public void
> >>> windowClosing(WindowEvent event) {
> >>>                                                          dispose();
> >>>                                                  }
> >>>                                          });
> >>>                                          // Fresh starting point
> >>> for edit tracking ...
> >>>                                          p.clearIsDirty();
> >>>                                  } else {
> >>>                                          throw new
> SwingInitException();
> >>>                                  }
> >>>                          }
> >>>                  }
> >>>...
> >>>
> >>>
> >>>At 04:50 PM 10/17/2006, Tania Tudorache wrote:
> >>> >Mark,
> >>> >
> >>> >I can't tell you what's going on, if I don't know in which line the
> >>> >exception occurred. I suppose it occurred in
> >>> >
> >>> >String projName =
> >>> >ProjectManager.getProjectManager().getCurrentProject().getName();
> >>> >
> >>> >which probably means that the project manager was not initialized
> >>> >correctly, or that the project was not yet created.
> >>> >
> >>> >Maybe some things have also changed in Eclipse initialization as
> >>> >well. I know that they support only partially Swing applications.
> >>> >
> >>> >Tania
> >>> >
> >>> >
> >>> >
> >>> >Mark Feblowitz wrote:
> >>> >>I am using Java 1.5, either the IBM version or the Sun version.
> >>> >>
> >>> >>I'll see if I can get some help here in using eclipse to do the
> build.
> >>> >>
> >>> >>I'm bringing in the Protege source to debug what's happening in
> >>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
> >>> >>like it occurs in the Protege code. Here's the exception:
> >>> >>
> >>> >>WARNING: _java.lang.NullPointerException
> >>> >>_at
> >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.cr
> >>> ea teOntologyBrowserHeader(Unknown
> >>> >>Source)
> >>> >>at
> >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<i
> >>> ni t>(Unknown
> >>> >>Source)
> >>> >>at
> >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.crea
> >>> te MainPanel(Unknown
> >>> >>Source)
> >>> >>at
> >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.init
> >>> ia lize(Unknown
> >>> >>Source)
> >>> >>at
> >>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(
> >>> Un known Source)
> >>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
> >>> >>at
> >>> edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown
> Source)
> >>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
> >>> >>at
> >>>
> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
> >>> >>_LgProtegeEditor.java:180_ )
> >>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
> >>> >>_LgProtegeEditor.java:338_ )
> >>> >>at
> >>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
> >>> >>( _LgProtegeEditor.java:266_ )
> >>> >>
> >>> >>Mark
> >>> >>
> >>> >>
> >>> >>
> >>> >>At 02:48 PM 10/17/2006, you wrote:
> >>> >>>Mark,
> >>> >>>
> >>> >>>If you use the latest Protege 3.2 beta, than you should use
> Java 1.5.
> >>> >>>
> >>> >>>The Parser class is automatically generated by the Protege build
> >>> >>>script. The instructions for building Protege out of the svn
> >>> >>>repository or source code distribution are here:
> >>> >>> http://protege.stanford.edu/doc/readme.html
> >>> >>>
> >>> >>>However, I don't think that you need to recompile Protege. I
> >>> >>>suppose, you can use the Protege jars and only recompile the
> >>> >>>Eclipse plugin code.
> >>> >>>
> >>> >>>Tania
> >>> >>>
> >>> >>>
> >>> >>>Mark Feblowitz wrote:
> >>> >>>>My prior questions had to do with my efforts to update the
> >>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
> >>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
> >>> >>>>
> >>> >>>>I'm trying to debug and have the need to debug the source of
> >>> >>>>Protege. I've imported the Protege core, but have a persistent
> >>> >>>>problem with two build errors:
> >>> >>>>
> >>> >>>>         The project was not built since its build path is
> >>> >>>> incomplete. Cannot find the class file for
> >>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
> >>> >>>>
> >>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
> >>> >>>>     resolved. It is indirectly referenced from required
> .class files
> >>> >>>>     Protege/src/edu/stanford/smi/protege/util
> >>> >>>>ProtegePlasticTheme.java
> >>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
> >>> >>>>get 4 errors about
> >>> >>>>
> >>> >>>>     "Parser cannot be resolved to at type"
> >>> >>>>and 42 errors about
> >>> >>>>
> >>> >>>>     jThe declared package "javax.swing.plaf.metal" does not
> match the
> >>> >>>>     expected package "edu.stanford.smi.protege.util"
> >>> >>>>
> >>> >>>>I'm doing this work within ecplise 3.2.0
> >>> >>>>
> >>> >>>>What should I be using for my JRE? Any additional jars in the
> >>> >>>>build path needed to reference
> >>> javax.swing.plaf.metal.DefaultMetalTheme?
> >>> >>>>
> >>> >>>>Thanks,
> >>> >>>>
> >>> >>>>Mark
> >>> >>>>
> >>> >>>>
> >>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
> >>> >>>>>Mark,
> >>> >>>>>
> >>> >>>>>We are very careful not to delete or move public classes or
> methods.
> >>> >>>>>
> >>> >>>>>The
> >>> >>>>>
> >>> >>>>>edu.stanford.smi.protege.util.FileHandler
> >>> >>>>>
> >>> >>>>>is in the same place :)
> >>> >>>>>
> >>> >>>>>In which version did Protege have a detachCurrentTab() method in
> >>> >>>>>ProjectView? I think the method you are looking for is the
> >>> >>>>>detachCurrentView().
> >>> >>>>>
> >>> >>>>>The DefaultEntry is still in the same place:
> >>> >>>>>
> >>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
> >>> >>>>>
> >>> >>>>>Are you using the right jars?
> >>> >>>>>
> >>> >>>>>Tania
> >>> >>>>>
> >>> >>>>>
> >>> >>>>>
> >>> >>>>>
> >>> >>>>>Mark Feblowitz wrote:
> >>> >>>>> > Add to that
> >>> >>>>> >
> >>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
> >>> >>>>> >
> >>> >>>>> >
> >>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
> >>> >>>>> > >> I was wondering what became of these two classes in
> Protege:
> >>> >>>>> >>
> >>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView -
> specifically
> >>> >>>>> >> detachCurrentTab()
> >>> >>>>> >>
> >>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
> >>> >>>>> >>
> >>> >>>>> >> Have these been moved, removed or replaced? What would be
> >>> >>>>> the new equivalents?
> >>> >>>>> >>
> >>> >>>>> >> Thanks,
> >>> >>>>> >>
> >>> >>>>> >> Mark
> >>> >>>>> >> _______________________________________________
> >>> >>>>> >> protege-discussion mailing list
> >>> >>>>> >> [hidden email]
> >>> >>>>> >>
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >>> >>>>> >>
> >>> >>>>> >> Instructions for unsubscribing:
> >>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
> >>> >>>>> >>
> >>> >>>>> >
> >>> >>>>> > _______________________________________________
> >>> >>>>> > protege-discussion mailing list
> >>> >>>>> > [hidden email]
> >>> >>>>> >
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >>> >>>>> >
> >>> >>>>> > Instructions for unsubscribing:
> >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> >>> >>>>> >
> >>> >>>>> >
> >>> >>>>>_______________________________________________
> >>> >>>>>protege-discussion mailing list
> >>> >>>>>[hidden email]
> >>> >>>>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >>> >>>>>
> >>> >>>>>Instructions for unsubscribing:
> >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> >>>
> >>>_______________________________________________
> >>>protege-discussion mailing list
> >>>[hidden email]
> >>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >>>
> >>>Instructions for unsubscribing:
> >>> http://protege.stanford.edu/doc/faq.html#01a.03
> >>
> _______________________________________________
> protege-discussion mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03 

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

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

Re: Build Questions (was Re: Question on some old classes/methods)

Mark Feblowitz
I'll see whether all of the plugins are being referenced properly.

Here's the exception trace:

WARNING: java.lang.NullPointerException
at
edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.createOntologyBrowserHeader(Unknown
Source)
at
edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<init>(Unknown
Source)
at
edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.createMainPanel(Unknown
Source)
at
edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.initialize(Unknown
Source)
at
edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(Unknown Source)
at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
at edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown Source)
at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
at
org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(LgProtegeEditor.java:184)
at
org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(LgProtegeEditor.java:342)
at
org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run(LgProtegeEditor.java:270)

The
edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.createOntologyBrowserHeader
method looks for a current project (doesn't exist yet) and barfs:

     protected HeaderComponent createOntologyBrowserHeader() {
         String projName =
ProjectManager.getProjectManager().getCurrentProject().getName();
         JLabel label = ComponentFactory.createLabel(projName,
                                                     Icons.getProjectIcon(),
                                                     SwingConstants.LEFT);
         String forProject =
LocalizedText.getText(ResourceKey.CLASS_BROWSER_FOR_PROJECT_LABEL);
         String classBrowser = "Ontology Browser";
         HeaderComponent headerComponent = new
HeaderComponent(classBrowser, forProject, label);
         headerComponent.setColor(Colors.getFacetColor());
         return headerComponent;
     }


This was invoked (indirectly) from the call:

p = new Project(FileName, errs);

Followed by the call

pv = new ProjectView(p);

That's there the fun begins :-)

I hope that helps.

Thanks,

Mark

At 05:04 PM 10/26/2006, you wrote:

>Mark,
>
>We are considering your solution. However, if the problem is in the OWL
>Metadata Tab, I would rather fix that than change the setCurrentProject
>method.
>
>Can you please send a stack trace of the error that you get from the OWL
>Metadata Tab?
>
>The class not found exception, seem to indicate that you don't have
>protege.jar in the classpath. The FileHandler class is in protege.jar.
>But this would be strange, cause other things would also not work. Did
>you include all the jars in the owl plugins directory in your classpath?
>Like log4j? It seems the exception is caused by the java Logger which
>cannot find a log handler defined in protege.jar. This is defined in the
>logging.properties file in the Protege installation directory.
>
>I suppose that a solution would be either to delete the
>logging.properties file, or to comment out the
>edu.stanford.smi.protege.util.FileHandler from the line where it is
>defined. (the line starts with "handlers=...")
>
>Tania
>
>Mark Feblowitz wrote:
> > (Sending this again - no response to the first one...)
> >
> > I was finally able to debug the problem and to come up with a solution.
> >
> > The problem is in ProjectManager.java: setCurrentProject has the side
> > effect of displaying the project, using the standard
> > displayCurrentProject method. This is probably a fine optimization
> > for most uses of Protege. The LexGrid code wants to display the
> > project in an Eclipse environment, though. So the caller has a
> > choice: call code that doesn't set the current project (and break the
> > metadata tab code) or call the code that sets the current project and
> > have an exception in the LexGrid code when Protege tries to display
> > to a nonexistent root frame.
> >
> > My workaround is to replace the current setCurrentProject(Project
> > project, boolean remote) method with the following:
> >
> >     public void setCurrentProject(Project project, boolean remote) {
> >          setCurrentProject(project, true, false);
> >      }
> >
> > and to add the following method:
> >
> >     public void setCurrentProject(Project project, boolean remote,
> > boolean suppressDisplay) {
> >          if (closeProjectRequest()) {
> >              _currentProject = project;
> >              if (_currentProject != null && !suppressDisplay) {
> >                  _projectPluginManager.afterLoad(_currentProject);
> >                  displayCurrentProject(remote);
> >              }
> >          }
> >      }
> >
> > It might be better to factor out the call to displayCurrentProject
> > from the setCurrentProject code, but that'd be a judgement call on
> > the part of the designers.
> >
> > How could I get this accommodated an upcoming Protege build?
> >
> > Also, I am still observing the following exception when starting
> > LexGrid Protege. It's not a show stopper, but I like to make it go
> > away. Any ideas?
> >
> > Can't load log handler "edu.stanford.smi.protege.util.FileHandler"
> > _ java.lang.ClassNotFoundException_ :
> > edu.stanford.smi.protege.util.FileHandler
> > _ java.lang.ClassNotFoundException_ :
> > edu.stanford.smi.protege.util.FileHandler
> > at java.net.URLClassLoader.findClass( _URLClassLoader.java:492_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:606_ )
> > at sun.misc.Launcher$AppClassLoader.loadClass( _Launcher.java:327_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> > at java.util.logging.LogManager$7.run( _LogManager.java:916_ )
> > at java.security.AccessController.doPrivileged(
> > _AccessController.java:193_ )
> > at java.util.logging.LogManager.initializeGlobalHandlers(
> > _LogManager.java:906_ )
> > at java.util.logging.LogManager.access$900( _LogManager.java:154_ )
> > at java.util.logging.LogManager$RootLogger.getHandlers(
> > _LogManager.java:1016_ )
> > at java.util.logging.Logger.log( _Logger.java:465_ )
> > at java.util.logging.Logger.doLog( _Logger.java:491_ )
> > at java.util.logging.Logger.log( _Logger.java:514_ )
> > at java.util.logging.Logger.config( _Logger.java:1049_ )
> > at edu.stanford.smi.protege.util.SystemUtilities.logSystemInfo(Unknown
> > Source)
> > at edu.stanford.smi.protege.util.SystemUtilities.init(Unknown Source)
> > at edu.stanford.smi.protege.util.SystemUtilities.<clinit>(Unknown Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at
> >
> edu.stanford.smi.protege.util.ApplicationProperties.getApplicationDirectory(Unknown
>
> > Source)
> > at
> >
> edu.stanford.smi.protege.util.ApplicationProperties.getPropertiesDirectory(Unknown
>
> > Source)
> > at
> > edu.stanford.smi.protege.util.ApplicationProperties.<clinit>(Unknown
> > Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at
> >
> edu.stanford.smi.protege.plugin.PluginUtilities.findPluginsDirectory(Unknown
> > Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.loadPlugins(Unknown
> > Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.init(Unknown Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.<clinit>(Unknown
> > Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at org.lexgrid.ui.extension.protege.Plugin.<clinit>( _Plugin.java:61_ )
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at java.lang.Class.newInstanceImpl( _Native Method_)
> > at java.lang.Class.newInstance( _Class.java:1243_ )
> > at
> >
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(
> > _AbstractBundle.java:136_ )
> > at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
> > _BundleContextImpl.java:966_ )
> > at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
> > _BundleHost.java:317_ )
> > at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
> > _AbstractBundle.java:256_ )
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(
>
> > _EclipseLazyStarter.java:86_ )
> > at
> > org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
> > _ClasspathManager.java:402_ )
> > at
> > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(
> > _DefaultClassLoader.java:188_ )
> > at
> > org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
> > _BundleLoader.java:339_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> > _BundleLoader.java:391_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> > _BundleLoader.java:352_ )
> > at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
> > _DefaultClassLoader.java:83_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(
> > _BundleLoader.java:276_ )
> > at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(
> > _BundleHost.java:227_ )
> > at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(
> > _AbstractBundle.java:1245_ )
> > at
> >
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(
>
> > _RegistryStrategyOSGI.java:147_ )
> > at
> >
> org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(
>
> > _ExtensionRegistry.java:759_ )
> > at
> >
> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(
>
> > _ConfigurationElement.java:243_ )
> > at
> >
> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(
>
> > _ConfigurationElementHandle.java:51_ )
> > at org.eclipse.ui.internal.WorkbenchPlugin$1.run(
> > _WorkbenchPlugin.java:242_ )
> > at org.eclipse.swt.custom.BusyIndicator.showWhile(
> > _BusyIndicator.java:67_ )
> > at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(
> > _WorkbenchPlugin.java:238_ )
> > at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(
> > _EditorDescriptor.java:231_ )
> > at org.eclipse.ui.internal.EditorManager.createPart(
> > _EditorManager.java:908_ )
> > at org.eclipse.ui.internal.EditorReference.createPartHelper(
> > _EditorReference.java:549_ )
> > at org.eclipse.ui.internal.EditorReference.createPart(
> > _EditorReference.java:372_ )
> > at org.eclipse.ui.internal.WorkbenchPartReference.getPart(
> > _WorkbenchPartReference.java:566_ )
> > at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(
> > _EditorAreaHelper.java:263_ )
> > at org.eclipse.ui.internal.EditorManager.setVisibleEditor(
> > _EditorManager.java:1420_ )
> > at org.eclipse.ui.internal.EditorManager$5.run(
> > _EditorManager.java:1005_ )
> > at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> > at org.eclipse.core.runtime.Platform.run( _Platform.java:843_ )
> > at org.eclipse.ui.internal.EditorManager.restoreState(
> > _EditorManager.java:1000_ )
> > at org.eclipse.ui.internal.WorkbenchPage.restoreState(
> > _WorkbenchPage.java:2785_ )
> > at org.eclipse.ui.internal.WorkbenchWindow.restoreState(
> > _WorkbenchWindow.java:1936_ )
> > at org.eclipse.ui.internal.Workbench.doRestoreState(
> > _Workbench.java:2857_ )
> > at org.eclipse.ui.internal.Workbench.access$14( _Workbench.java:2805_ )
> > at org.eclipse.ui.internal.Workbench$19.run( _Workbench.java:1681_ )
> > at org.eclipse.ui.internal.Workbench.runStartupWithProgress(
> > _Workbench.java:1421_ )
> > at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1679_ )
> > at org.eclipse.ui.internal.Workbench.access$12( _Workbench.java:1650_ )
> > at org.eclipse.ui.internal.Workbench$17.run( _Workbench.java:1529_ )
> > at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> > at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1473_ )
> > at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(
> > _WorkbenchConfigurer.java:183_ )
> > at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(
> > _WorkbenchAdvisor.java:702_ )
> > at org.eclipse.ui.internal.Workbench.init( _Workbench.java:1085_ )
> > at org.eclipse.ui.internal.Workbench.runUI( _Workbench.java:1847_ )
> > at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
> > _Workbench.java:419_ )
> > at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
> > _PlatformUI.java:143_ )
> > at org.eclipse.ui.internal.ide.IDEApplication.run(
> > _IDEApplication.java:95_ )
> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > _PlatformActivator.java:78_ )
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
> > _EclipseAppLauncher.java:92_ )
> > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > _EclipseAppLauncher.java:68_ )
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > _EclipseStarter.java:400_ )
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > _EclipseStarter.java:177_ )
> > at sun.reflect.NativeMethodAccessorImpl.invoke0( _Native Method_)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(
> > _NativeMethodAccessorImpl.java:64_ )
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > _DelegatingMethodAccessorImpl.java:43_ )
> > at java.lang.reflect.Method.invoke( _Method.java:615_ )
> > at org.eclipse.core.launcher.Main.invokeFramework( _Main.java:336_ )
> > at org.eclipse.core.launcher.Main.basicRun( _Main.java:280_ )
> > at org.eclipse.core.launcher.Main.run( _Main.java:977_ )
> > at org.eclipse.core.launcher.Main.main( _Main.java:952_ )
> > Thanks,
> >
> > Mark
> >
> >
> > At 03:08 PM 10/24/2006, Tania Tudorache wrote:
> > >Mark,
> > >
> > >You can load a project using a call like:
> > >
> > >Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj",
> > errors);
> > >
> > >This will set the correct current project.
> > >
> > >You also got a class not found error. The class that was not found
> > >was in the jena.jar.  Did you add to your Eclipse project:
> > >
> > >- the protege.jar (or protege-cores sources)
> > >- the protege-owl.jar (or protege-owl sources)
> > >
> > >If you compile the protege-owl sources, than you need to add to the
> > >Eclipse project all the jars from the protege owl plugin directory
> > >(such as, jena.jar, owlsyntax.jar, etc.).
> > >
> > >Tania
> > >
> > >
> > >
> > >Mark Feblowitz wrote:
> > >>Since there's been radio silence on this, I'll restate my request
> > >>as I currently understand it.
> > >>
> > >>What is the best way to load a project, such that currentProject is
> > >>set correctly?  It seems like simply issuing a "new Project(...)"
> > >>doesn't do the trick.
> > >>
> > >>(Is that a bug or simply an incomplete creation/loading of the project?)
> > >>
> > >>It would help to see some code that loads a project (that is an Owl
> > project).
> > >>
> > >>Thanks,
> > >>
> > >>Mark
> > >>
> > >>
> > >>At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
> > >>>Ok -
> > >>>
> > >>>Forget all of my prior questions :-) Using ant instead of eclipse,
> > >>>I've been able to debug and diagnose the problem I'm having.
> > >>>
> > >>>You were right on the money!
> > >>>
> > >>>The LexGrid Protege in Eclipse code creates a project and project
> > >>>views, but does not set the current project.
> > >>>
> > >>>The problem comes when trying to get the current project.
> > >>>
> > >>>I assume that the LG code is using some outdated means of loading a
> > >>>project. Below is the method that appears to be flawed.
> > >>>
> > >>>Can you point me to something the does this correctly?
> > >>>
> > >>>Thanks!
> > >>>
> > >>>Mark
> > >>>
> > >>>from LgProtegeEditor.java:
> > >>>...
> > >>>public void init() throws SwingInitException {
> > >>>          try {
> > >>>                  final IFileEditorInput input = (IFileEditorInput)
> > >>>getEditorInput();
> > >>>                  if (input != null) {
> > >>>                          Collection errs = new ArrayList();
> > >>>                          p = new
> > >>>
> > >>>Project(((org.eclipse.core.internal.resources.File)
> > >>>
> > >>>input.getStorage()).getRawLocation().toString(), errs);
> > >>>                          if (!disposed) {
> > >>>                                  if (!errs.isEmpty()) {
> > >>>                                          for (Iterator errIt =
> > >>>                                         errs.iterator();
> > errIt.hasNext(); )
> > >>>
> > >>>Plugin.log(IStatus.ERROR,
> > >>>
> > >>>errIt.next().toString());
> > >>>                                              display.syncExec(new
> > >>> Runnable() {
> > >>>                                                  public void run() {
> > >>>
> > >>>MessageDialog.openError(getSite().getShell(),
> > >>>                                         "Error",
> > >>>
> > >>>"Errors occurred initializing the Protege project. Refer to the
> > >>>error log for  additional information.");
> > >>>                                                  }
> > >>>                                          });
> > >>>                                  }
> > >>>                                  if (p.hasCompleteSources()) {
> > >>>                                          // Create the
> > >>> Swing-based canvas ...
> > >>>                                          pv = new ProjectView(p);
> > >>>                                          f.setLayout(new
> > >>> java.awt.BorderLayout());
> > >>>                                          f.add(pv, "Center");
> > >>>                                          f.addWindowListener(new
> > >>> WindowAdapter() {
> > >>>                                                  public void
> > >>> windowClosing(WindowEvent event) {
> > >>>                                                          dispose();
> > >>>                                                  }
> > >>>                                          });
> > >>>                                          // Fresh starting point
> > >>> for edit tracking ...
> > >>>                                          p.clearIsDirty();
> > >>>                                  } else {
> > >>>                                          throw new
> > SwingInitException();
> > >>>                                  }
> > >>>                          }
> > >>>                  }
> > >>>...
> > >>>
> > >>>
> > >>>At 04:50 PM 10/17/2006, Tania Tudorache wrote:
> > >>> >Mark,
> > >>> >
> > >>> >I can't tell you what's going on, if I don't know in which line the
> > >>> >exception occurred. I suppose it occurred in
> > >>> >
> > >>> >String projName =
> > >>> >ProjectManager.getProjectManager().getCurrentProject().getName();
> > >>> >
> > >>> >which probably means that the project manager was not initialized
> > >>> >correctly, or that the project was not yet created.
> > >>> >
> > >>> >Maybe some things have also changed in Eclipse initialization as
> > >>> >well. I know that they support only partially Swing applications.
> > >>> >
> > >>> >Tania
> > >>> >
> > >>> >
> > >>> >
> > >>> >Mark Feblowitz wrote:
> > >>> >>I am using Java 1.5, either the IBM version or the Sun version.
> > >>> >>
> > >>> >>I'll see if I can get some help here in using eclipse to do the
> > build.
> > >>> >>
> > >>> >>I'm bringing in the Protege source to debug what's happening in
> > >>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
> > >>> >>like it occurs in the Protege code. Here's the exception:
> > >>> >>
> > >>> >>WARNING: _java.lang.NullPointerException
> > >>> >>_at
> > >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.cr
> > >>> ea teOntologyBrowserHeader(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<i
> > >>> ni t>(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.crea
> > >>> te MainPanel(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.init
> > >>> ia lize(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(
> > >>> Un known Source)
> > >>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
> > >>> >>at
> > >>> edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown
> > Source)
> > >>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
> > >>> >>at
> > >>>
> > >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
> > >>> >>_LgProtegeEditor.java:180_ )
> > >>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
> > >>> >>_LgProtegeEditor.java:338_ )
> > >>> >>at
> > >>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
> > >>> >>( _LgProtegeEditor.java:266_ )
> > >>> >>
> > >>> >>Mark
> > >>> >>
> > >>> >>
> > >>> >>
> > >>> >>At 02:48 PM 10/17/2006, you wrote:
> > >>> >>>Mark,
> > >>> >>>
> > >>> >>>If you use the latest Protege 3.2 beta, than you should use
> > Java 1.5.
> > >>> >>>
> > >>> >>>The Parser class is automatically generated by the Protege build
> > >>> >>>script. The instructions for building Protege out of the svn
> > >>> >>>repository or source code distribution are here:
> > >>> >>> http://protege.stanford.edu/doc/readme.html
> > >>> >>>
> > >>> >>>However, I don't think that you need to recompile Protege. I
> > >>> >>>suppose, you can use the Protege jars and only recompile the
> > >>> >>>Eclipse plugin code.
> > >>> >>>
> > >>> >>>Tania
> > >>> >>>
> > >>> >>>
> > >>> >>>Mark Feblowitz wrote:
> > >>> >>>>My prior questions had to do with my efforts to update the
> > >>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
> > >>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
> > >>> >>>>
> > >>> >>>>I'm trying to debug and have the need to debug the source of
> > >>> >>>>Protege. I've imported the Protege core, but have a persistent
> > >>> >>>>problem with two build errors:
> > >>> >>>>
> > >>> >>>>         The project was not built since its build path is
> > >>> >>>> incomplete. Cannot find the class file for
> > >>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
> > >>> >>>>
> > >>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
> > >>> >>>>     resolved. It is indirectly referenced from required
> > .class files
> > >>> >>>>     Protege/src/edu/stanford/smi/protege/util
> > >>> >>>>ProtegePlasticTheme.java
> > >>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
> > >>> >>>>get 4 errors about
> > >>> >>>>
> > >>> >>>>     "Parser cannot be resolved to at type"
> > >>> >>>>and 42 errors about
> > >>> >>>>
> > >>> >>>>     jThe declared package "javax.swing.plaf.metal" does not
> > match the
> > >>> >>>>     expected package "edu.stanford.smi.protege.util"
> > >>> >>>>
> > >>> >>>>I'm doing this work within ecplise 3.2.0
> > >>> >>>>
> > >>> >>>>What should I be using for my JRE? Any additional jars in the
> > >>> >>>>build path needed to reference
> > >>> javax.swing.plaf.metal.DefaultMetalTheme?
> > >>> >>>>
> > >>> >>>>Thanks,
> > >>> >>>>
> > >>> >>>>Mark
> > >>> >>>>
> > >>> >>>>
> > >>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
> > >>> >>>>>Mark,
> > >>> >>>>>
> > >>> >>>>>We are very careful not to delete or move public classes or
> > methods.
> > >>> >>>>>
> > >>> >>>>>The
> > >>> >>>>>
> > >>> >>>>>edu.stanford.smi.protege.util.FileHandler
> > >>> >>>>>
> > >>> >>>>>is in the same place :)
> > >>> >>>>>
> > >>> >>>>>In which version did Protege have a detachCurrentTab() method in
> > >>> >>>>>ProjectView? I think the method you are looking for is the
> > >>> >>>>>detachCurrentView().
> > >>> >>>>>
> > >>> >>>>>The DefaultEntry is still in the same place:
> > >>> >>>>>
> > >>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
> > >>> >>>>>
> > >>> >>>>>Are you using the right jars?
> > >>> >>>>>
> > >>> >>>>>Tania
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>Mark Feblowitz wrote:
> > >>> >>>>> > Add to that
> > >>> >>>>> >
> > >>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
> > >>> >>>>> >
> > >>> >>>>> >
> > >>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
> > >>> >>>>> > >> I was wondering what became of these two classes in
> > Protege:
> > >>> >>>>> >>
> > >>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView -
> > specifically
> > >>> >>>>> >> detachCurrentTab()
> > >>> >>>>> >>
> > >>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
> > >>> >>>>> >>
> > >>> >>>>> >> Have these been moved, removed or replaced? What would be
> > >>> >>>>> the new equivalents?
> > >>> >>>>> >>
> > >>> >>>>> >> Thanks,
> > >>> >>>>> >>
> > >>> >>>>> >> Mark
> > >>> >>>>> >> _______________________________________________
> > >>> >>>>> >> protege-discussion mailing list
> > >>> >>>>> >> [hidden email]
> > >>> >>>>> >>
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>> >>
> > >>> >>>>> >> Instructions for unsubscribing:
> > >>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>> >>>>> >>
> > >>> >>>>> >
> > >>> >>>>> > _______________________________________________
> > >>> >>>>> > protege-discussion mailing list
> > >>> >>>>> > [hidden email]
> > >>> >>>>> >
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>> >
> > >>> >>>>> > Instructions for unsubscribing:
> > >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>> >>>>> >
> > >>> >>>>> >
> > >>> >>>>>_______________________________________________
> > >>> >>>>>protege-discussion mailing list
> > >>> >>>>>[hidden email]
> > >>> >>>>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>>
> > >>> >>>>>Instructions for unsubscribing:
> > >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>>
> > >>>_______________________________________________
> > >>>protege-discussion mailing list
> > >>>[hidden email]
> > >>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>>
> > >>>Instructions for unsubscribing:
> > >>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>
> > _______________________________________________
> > protege-discussion mailing list
> > [hidden email]
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >
> > Instructions for unsubscribing:
> > http://protege.stanford.edu/doc/faq.html#01a.03
>
>_______________________________________________
>protege-discussion mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
>Instructions for unsubscribing:
>http://protege.stanford.edu/doc/faq.html#01a.03
_______________________________________________
protege-discussion mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-discussion

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

Re: Build Questions (was Re: Question on some old classes/methods)

Mark Feblowitz
In reply to this post by Tania Tudorache
Very odd about the logging exception. FileHandler is in the
protege.jar, and plugin.xml points to it and to the logging jars.

Changing logging.properties does make the exception disappear, so
I'll stick with it.

Mark

At 05:04 PM 10/26/2006, you wrote:

>Mark,
>
>We are considering your solution. However, if the problem is in the OWL
>Metadata Tab, I would rather fix that than change the setCurrentProject
>method.
>
>Can you please send a stack trace of the error that you get from the OWL
>Metadata Tab?
>
>The class not found exception, seem to indicate that you don't have
>protege.jar in the classpath. The FileHandler class is in protege.jar.
>But this would be strange, cause other things would also not work. Did
>you include all the jars in the owl plugins directory in your classpath?
>Like log4j? It seems the exception is caused by the java Logger which
>cannot find a log handler defined in protege.jar. This is defined in the
>logging.properties file in the Protege installation directory.
>
>I suppose that a solution would be either to delete the
>logging.properties file, or to comment out the
>edu.stanford.smi.protege.util.FileHandler from the line where it is
>defined. (the line starts with "handlers=...")
>
>Tania
>
>Mark Feblowitz wrote:
> > (Sending this again - no response to the first one...)
> >
> > I was finally able to debug the problem and to come up with a solution.
> >
> > The problem is in ProjectManager.java: setCurrentProject has the side
> > effect of displaying the project, using the standard
> > displayCurrentProject method. This is probably a fine optimization
> > for most uses of Protege. The LexGrid code wants to display the
> > project in an Eclipse environment, though. So the caller has a
> > choice: call code that doesn't set the current project (and break the
> > metadata tab code) or call the code that sets the current project and
> > have an exception in the LexGrid code when Protege tries to display
> > to a nonexistent root frame.
> >
> > My workaround is to replace the current setCurrentProject(Project
> > project, boolean remote) method with the following:
> >
> >     public void setCurrentProject(Project project, boolean remote) {
> >          setCurrentProject(project, true, false);
> >      }
> >
> > and to add the following method:
> >
> >     public void setCurrentProject(Project project, boolean remote,
> > boolean suppressDisplay) {
> >          if (closeProjectRequest()) {
> >              _currentProject = project;
> >              if (_currentProject != null && !suppressDisplay) {
> >                  _projectPluginManager.afterLoad(_currentProject);
> >                  displayCurrentProject(remote);
> >              }
> >          }
> >      }
> >
> > It might be better to factor out the call to displayCurrentProject
> > from the setCurrentProject code, but that'd be a judgement call on
> > the part of the designers.
> >
> > How could I get this accommodated an upcoming Protege build?
> >
> > Also, I am still observing the following exception when starting
> > LexGrid Protege. It's not a show stopper, but I like to make it go
> > away. Any ideas?
> >
> > Can't load log handler "edu.stanford.smi.protege.util.FileHandler"
> > _ java.lang.ClassNotFoundException_ :
> > edu.stanford.smi.protege.util.FileHandler
> > _ java.lang.ClassNotFoundException_ :
> > edu.stanford.smi.protege.util.FileHandler
> > at java.net.URLClassLoader.findClass( _URLClassLoader.java:492_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:606_ )
> > at sun.misc.Launcher$AppClassLoader.loadClass( _Launcher.java:327_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> > at java.util.logging.LogManager$7.run( _LogManager.java:916_ )
> > at java.security.AccessController.doPrivileged(
> > _AccessController.java:193_ )
> > at java.util.logging.LogManager.initializeGlobalHandlers(
> > _LogManager.java:906_ )
> > at java.util.logging.LogManager.access$900( _LogManager.java:154_ )
> > at java.util.logging.LogManager$RootLogger.getHandlers(
> > _LogManager.java:1016_ )
> > at java.util.logging.Logger.log( _Logger.java:465_ )
> > at java.util.logging.Logger.doLog( _Logger.java:491_ )
> > at java.util.logging.Logger.log( _Logger.java:514_ )
> > at java.util.logging.Logger.config( _Logger.java:1049_ )
> > at edu.stanford.smi.protege.util.SystemUtilities.logSystemInfo(Unknown
> > Source)
> > at edu.stanford.smi.protege.util.SystemUtilities.init(Unknown Source)
> > at edu.stanford.smi.protege.util.SystemUtilities.<clinit>(Unknown Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at
> >
> edu.stanford.smi.protege.util.ApplicationProperties.getApplicationDirectory(Unknown
>
> > Source)
> > at
> >
> edu.stanford.smi.protege.util.ApplicationProperties.getPropertiesDirectory(Unknown
>
> > Source)
> > at
> > edu.stanford.smi.protege.util.ApplicationProperties.<clinit>(Unknown
> > Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at
> >
> edu.stanford.smi.protege.plugin.PluginUtilities.findPluginsDirectory(Unknown
> > Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.loadPlugins(Unknown
> > Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.init(Unknown Source)
> > at edu.stanford.smi.protege.plugin.PluginUtilities.<clinit>(Unknown
> > Source)
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at org.lexgrid.ui.extension.protege.Plugin.<clinit>( _Plugin.java:61_ )
> > at java.lang.J9VMInternals.initializeImpl( _Native Method_)
> > at java.lang.J9VMInternals.initialize( _J9VMInternals.java:177_ )
> > at java.lang.Class.newInstanceImpl( _Native Method_)
> > at java.lang.Class.newInstance( _Class.java:1243_ )
> > at
> >
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(
> > _AbstractBundle.java:136_ )
> > at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(
> > _BundleContextImpl.java:966_ )
> > at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(
> > _BundleHost.java:317_ )
> > at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(
> > _AbstractBundle.java:256_ )
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(
>
> > _EclipseLazyStarter.java:86_ )
> > at
> > org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(
> > _ClasspathManager.java:402_ )
> > at
> > org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(
> > _DefaultClassLoader.java:188_ )
> > at
> > org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(
> > _BundleLoader.java:339_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> > _BundleLoader.java:391_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
> > _BundleLoader.java:352_ )
> > at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
> > _DefaultClassLoader.java:83_ )
> > at java.lang.ClassLoader.loadClass( _ClassLoader.java:563_ )
> > at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(
> > _BundleLoader.java:276_ )
> > at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(
> > _BundleHost.java:227_ )
> > at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(
> > _AbstractBundle.java:1245_ )
> > at
> >
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(
>
> > _RegistryStrategyOSGI.java:147_ )
> > at
> >
> org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(
>
> > _ExtensionRegistry.java:759_ )
> > at
> >
> org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(
>
> > _ConfigurationElement.java:243_ )
> > at
> >
> org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(
>
> > _ConfigurationElementHandle.java:51_ )
> > at org.eclipse.ui.internal.WorkbenchPlugin$1.run(
> > _WorkbenchPlugin.java:242_ )
> > at org.eclipse.swt.custom.BusyIndicator.showWhile(
> > _BusyIndicator.java:67_ )
> > at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(
> > _WorkbenchPlugin.java:238_ )
> > at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(
> > _EditorDescriptor.java:231_ )
> > at org.eclipse.ui.internal.EditorManager.createPart(
> > _EditorManager.java:908_ )
> > at org.eclipse.ui.internal.EditorReference.createPartHelper(
> > _EditorReference.java:549_ )
> > at org.eclipse.ui.internal.EditorReference.createPart(
> > _EditorReference.java:372_ )
> > at org.eclipse.ui.internal.WorkbenchPartReference.getPart(
> > _WorkbenchPartReference.java:566_ )
> > at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(
> > _EditorAreaHelper.java:263_ )
> > at org.eclipse.ui.internal.EditorManager.setVisibleEditor(
> > _EditorManager.java:1420_ )
> > at org.eclipse.ui.internal.EditorManager$5.run(
> > _EditorManager.java:1005_ )
> > at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> > at org.eclipse.core.runtime.Platform.run( _Platform.java:843_ )
> > at org.eclipse.ui.internal.EditorManager.restoreState(
> > _EditorManager.java:1000_ )
> > at org.eclipse.ui.internal.WorkbenchPage.restoreState(
> > _WorkbenchPage.java:2785_ )
> > at org.eclipse.ui.internal.WorkbenchWindow.restoreState(
> > _WorkbenchWindow.java:1936_ )
> > at org.eclipse.ui.internal.Workbench.doRestoreState(
> > _Workbench.java:2857_ )
> > at org.eclipse.ui.internal.Workbench.access$14( _Workbench.java:2805_ )
> > at org.eclipse.ui.internal.Workbench$19.run( _Workbench.java:1681_ )
> > at org.eclipse.ui.internal.Workbench.runStartupWithProgress(
> > _Workbench.java:1421_ )
> > at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1679_ )
> > at org.eclipse.ui.internal.Workbench.access$12( _Workbench.java:1650_ )
> > at org.eclipse.ui.internal.Workbench$17.run( _Workbench.java:1529_ )
> > at org.eclipse.core.runtime.SafeRunner.run( _SafeRunner.java:37_ )
> > at org.eclipse.ui.internal.Workbench.restoreState( _Workbench.java:1473_ )
> > at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(
> > _WorkbenchConfigurer.java:183_ )
> > at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(
> > _WorkbenchAdvisor.java:702_ )
> > at org.eclipse.ui.internal.Workbench.init( _Workbench.java:1085_ )
> > at org.eclipse.ui.internal.Workbench.runUI( _Workbench.java:1847_ )
> > at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
> > _Workbench.java:419_ )
> > at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
> > _PlatformUI.java:143_ )
> > at org.eclipse.ui.internal.ide.IDEApplication.run(
> > _IDEApplication.java:95_ )
> > at org.eclipse.core.internal.runtime.PlatformActivator$1.run(
> > _PlatformActivator.java:78_ )
> > at
> >
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
> > _EclipseAppLauncher.java:92_ )
> > at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
> > _EclipseAppLauncher.java:68_ )
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > _EclipseStarter.java:400_ )
> > at org.eclipse.core.runtime.adaptor.EclipseStarter.run(
> > _EclipseStarter.java:177_ )
> > at sun.reflect.NativeMethodAccessorImpl.invoke0( _Native Method_)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(
> > _NativeMethodAccessorImpl.java:64_ )
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > _DelegatingMethodAccessorImpl.java:43_ )
> > at java.lang.reflect.Method.invoke( _Method.java:615_ )
> > at org.eclipse.core.launcher.Main.invokeFramework( _Main.java:336_ )
> > at org.eclipse.core.launcher.Main.basicRun( _Main.java:280_ )
> > at org.eclipse.core.launcher.Main.run( _Main.java:977_ )
> > at org.eclipse.core.launcher.Main.main( _Main.java:952_ )
> > Thanks,
> >
> > Mark
> >
> >
> > At 03:08 PM 10/24/2006, Tania Tudorache wrote:
> > >Mark,
> > >
> > >You can load a project using a call like:
> > >
> > >Project prj = Project.loadProjectFromFile("/tmp/pizza/pizza.pprj",
> > errors);
> > >
> > >This will set the correct current project.
> > >
> > >You also got a class not found error. The class that was not found
> > >was in the jena.jar.  Did you add to your Eclipse project:
> > >
> > >- the protege.jar (or protege-cores sources)
> > >- the protege-owl.jar (or protege-owl sources)
> > >
> > >If you compile the protege-owl sources, than you need to add to the
> > >Eclipse project all the jars from the protege owl plugin directory
> > >(such as, jena.jar, owlsyntax.jar, etc.).
> > >
> > >Tania
> > >
> > >
> > >
> > >Mark Feblowitz wrote:
> > >>Since there's been radio silence on this, I'll restate my request
> > >>as I currently understand it.
> > >>
> > >>What is the best way to load a project, such that currentProject is
> > >>set correctly?  It seems like simply issuing a "new Project(...)"
> > >>doesn't do the trick.
> > >>
> > >>(Is that a bug or simply an incomplete creation/loading of the project?)
> > >>
> > >>It would help to see some code that loads a project (that is an Owl
> > project).
> > >>
> > >>Thanks,
> > >>
> > >>Mark
> > >>
> > >>
> > >>At 10:09 AM 10/20/2006, Mark Feblowitz wrote:
> > >>>Ok -
> > >>>
> > >>>Forget all of my prior questions :-) Using ant instead of eclipse,
> > >>>I've been able to debug and diagnose the problem I'm having.
> > >>>
> > >>>You were right on the money!
> > >>>
> > >>>The LexGrid Protege in Eclipse code creates a project and project
> > >>>views, but does not set the current project.
> > >>>
> > >>>The problem comes when trying to get the current project.
> > >>>
> > >>>I assume that the LG code is using some outdated means of loading a
> > >>>project. Below is the method that appears to be flawed.
> > >>>
> > >>>Can you point me to something the does this correctly?
> > >>>
> > >>>Thanks!
> > >>>
> > >>>Mark
> > >>>
> > >>>from LgProtegeEditor.java:
> > >>>...
> > >>>public void init() throws SwingInitException {
> > >>>          try {
> > >>>                  final IFileEditorInput input = (IFileEditorInput)
> > >>>getEditorInput();
> > >>>                  if (input != null) {
> > >>>                          Collection errs = new ArrayList();
> > >>>                          p = new
> > >>>
> > >>>Project(((org.eclipse.core.internal.resources.File)
> > >>>
> > >>>input.getStorage()).getRawLocation().toString(), errs);
> > >>>                          if (!disposed) {
> > >>>                                  if (!errs.isEmpty()) {
> > >>>                                          for (Iterator errIt =
> > >>>                                         errs.iterator();
> > errIt.hasNext(); )
> > >>>
> > >>>Plugin.log(IStatus.ERROR,
> > >>>
> > >>>errIt.next().toString());
> > >>>                                              display.syncExec(new
> > >>> Runnable() {
> > >>>                                                  public void run() {
> > >>>
> > >>>MessageDialog.openError(getSite().getShell(),
> > >>>                                         "Error",
> > >>>
> > >>>"Errors occurred initializing the Protege project. Refer to the
> > >>>error log for  additional information.");
> > >>>                                                  }
> > >>>                                          });
> > >>>                                  }
> > >>>                                  if (p.hasCompleteSources()) {
> > >>>                                          // Create the
> > >>> Swing-based canvas ...
> > >>>                                          pv = new ProjectView(p);
> > >>>                                          f.setLayout(new
> > >>> java.awt.BorderLayout());
> > >>>                                          f.add(pv, "Center");
> > >>>                                          f.addWindowListener(new
> > >>> WindowAdapter() {
> > >>>                                                  public void
> > >>> windowClosing(WindowEvent event) {
> > >>>                                                          dispose();
> > >>>                                                  }
> > >>>                                          });
> > >>>                                          // Fresh starting point
> > >>> for edit tracking ...
> > >>>                                          p.clearIsDirty();
> > >>>                                  } else {
> > >>>                                          throw new
> > SwingInitException();
> > >>>                                  }
> > >>>                          }
> > >>>                  }
> > >>>...
> > >>>
> > >>>
> > >>>At 04:50 PM 10/17/2006, Tania Tudorache wrote:
> > >>> >Mark,
> > >>> >
> > >>> >I can't tell you what's going on, if I don't know in which line the
> > >>> >exception occurred. I suppose it occurred in
> > >>> >
> > >>> >String projName =
> > >>> >ProjectManager.getProjectManager().getCurrentProject().getName();
> > >>> >
> > >>> >which probably means that the project manager was not initialized
> > >>> >correctly, or that the project was not yet created.
> > >>> >
> > >>> >Maybe some things have also changed in Eclipse initialization as
> > >>> >well. I know that they support only partially Swing applications.
> > >>> >
> > >>> >Tania
> > >>> >
> > >>> >
> > >>> >
> > >>> >Mark Feblowitz wrote:
> > >>> >>I am using Java 1.5, either the IBM version or the Sun version.
> > >>> >>
> > >>> >>I'll see if I can get some help here in using eclipse to do the
> > build.
> > >>> >>
> > >>> >>I'm bringing in the Protege source to debug what's happening in
> > >>> >>Protege. It's a problem with rendering the Metadata Tab, but looks
> > >>> >>like it occurs in the Protege code. Here's the exception:
> > >>> >>
> > >>> >>WARNING: _java.lang.NullPointerException
> > >>> >>_at
> > >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.cr
> > >>> ea teOntologyBrowserHeader(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.importstree.ImportsTreePanel.<i
> > >>> ni t>(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.crea
> > >>> te MainPanel(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab.init
> > >>> ia lize(Unknown
> > >>> >>Source)
> > >>> >>at
> > >>> >>edu.stanford.smi.protege.widget.WidgetUtilities.createTabWidget(
> > >>> Un known Source)
> > >>> >>at edu.stanford.smi.protege.ui.ProjectView.addTab(Unknown Source)
> > >>> >>at
> > >>> edu.stanford.smi.protege.ui.ProjectView.createTabbedPane(Unknown
> > Source)
> > >>> >>at edu.stanford.smi.protege.ui.ProjectView.<init>(Unknown Source)
> > >>> >>at
> > >>>
> > >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingFrameAccess.init(
> > >>> >>_LgProtegeEditor.java:180_ )
> > >>> >>at org.lexgrid.ui.extension.protege.LgProtegeEditor.getSwingFrame(
> > >>> >>_LgProtegeEditor.java:338_ )
> > >>> >>at
> > >>> >>org.lexgrid.ui.extension.protege.LgProtegeEditor$SwingInitThread.run
> > >>> >>( _LgProtegeEditor.java:266_ )
> > >>> >>
> > >>> >>Mark
> > >>> >>
> > >>> >>
> > >>> >>
> > >>> >>At 02:48 PM 10/17/2006, you wrote:
> > >>> >>>Mark,
> > >>> >>>
> > >>> >>>If you use the latest Protege 3.2 beta, than you should use
> > Java 1.5.
> > >>> >>>
> > >>> >>>The Parser class is automatically generated by the Protege build
> > >>> >>>script. The instructions for building Protege out of the svn
> > >>> >>>repository or source code distribution are here:
> > >>> >>> http://protege.stanford.edu/doc/readme.html
> > >>> >>>
> > >>> >>>However, I don't think that you need to recompile Protege. I
> > >>> >>>suppose, you can use the Protege jars and only recompile the
> > >>> >>>Eclipse plugin code.
> > >>> >>>
> > >>> >>>Tania
> > >>> >>>
> > >>> >>>
> > >>> >>>Mark Feblowitz wrote:
> > >>> >>>>My prior questions had to do with my efforts to update the
> > >>> >>>>LexGrid "Protege in Eclipse" project. All seems to be well, with
> > >>> >>>>the exception of the Protege Owl Plugin's Metadata Tab.
> > >>> >>>>
> > >>> >>>>I'm trying to debug and have the need to debug the source of
> > >>> >>>>Protege. I've imported the Protege core, but have a persistent
> > >>> >>>>problem with two build errors:
> > >>> >>>>
> > >>> >>>>         The project was not built since its build path is
> > >>> >>>> incomplete. Cannot find the class file for
> > >>> >>>> javax.swing.plaf.metal.DefaultMetalTheme.
> > >>> >>>>
> > >>> >>>>     The type javax.swing.plaf.metal.DefaultMetalTheme cannot be
> > >>> >>>>     resolved. It is indirectly referenced from required
> > .class files
> > >>> >>>>     Protege/src/edu/stanford/smi/protege/util
> > >>> >>>>ProtegePlasticTheme.java
> > >>> >>>>I'm using the IBM 1.5 JRE. When I switch to the Sun 1.5 JRE, I
> > >>> >>>>get 4 errors about
> > >>> >>>>
> > >>> >>>>     "Parser cannot be resolved to at type"
> > >>> >>>>and 42 errors about
> > >>> >>>>
> > >>> >>>>     jThe declared package "javax.swing.plaf.metal" does not
> > match the
> > >>> >>>>     expected package "edu.stanford.smi.protege.util"
> > >>> >>>>
> > >>> >>>>I'm doing this work within ecplise 3.2.0
> > >>> >>>>
> > >>> >>>>What should I be using for my JRE? Any additional jars in the
> > >>> >>>>build path needed to reference
> > >>> javax.swing.plaf.metal.DefaultMetalTheme?
> > >>> >>>>
> > >>> >>>>Thanks,
> > >>> >>>>
> > >>> >>>>Mark
> > >>> >>>>
> > >>> >>>>
> > >>> >>>>At 06:24 PM 10/13/2006, Tania Tudorache wrote:
> > >>> >>>>>Mark,
> > >>> >>>>>
> > >>> >>>>>We are very careful not to delete or move public classes or
> > methods.
> > >>> >>>>>
> > >>> >>>>>The
> > >>> >>>>>
> > >>> >>>>>edu.stanford.smi.protege.util.FileHandler
> > >>> >>>>>
> > >>> >>>>>is in the same place :)
> > >>> >>>>>
> > >>> >>>>>In which version did Protege have a detachCurrentTab() method in
> > >>> >>>>>ProjectView? I think the method you are looking for is the
> > >>> >>>>>detachCurrentView().
> > >>> >>>>>
> > >>> >>>>>The DefaultEntry is still in the same place:
> > >>> >>>>>
> > >>> >>>>>edu.stanford.smi.protege.plugin. DefaultEntry
> > >>> >>>>>
> > >>> >>>>>Are you using the right jars?
> > >>> >>>>>
> > >>> >>>>>Tania
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>
> > >>> >>>>>Mark Feblowitz wrote:
> > >>> >>>>> > Add to that
> > >>> >>>>> >
> > >>> >>>>> >          edu.stanford.smi.protege.util.FileHandler
> > >>> >>>>> >
> > >>> >>>>> >
> > >>> >>>>> > At 05:05 PM 10/13/2006, Mark Feblowitz wrote:
> > >>> >>>>> > >> I was wondering what became of these two classes in
> > Protege:
> > >>> >>>>> >>
> > >>> >>>>> >>          edu.stanford.smi.protege.ui.ProjectView -
> > specifically
> > >>> >>>>> >> detachCurrentTab()
> > >>> >>>>> >>
> > >>> >>>>> >>          edu.stanford.smi.protege.plugin.DefaultEntry
> > >>> >>>>> >>
> > >>> >>>>> >> Have these been moved, removed or replaced? What would be
> > >>> >>>>> the new equivalents?
> > >>> >>>>> >>
> > >>> >>>>> >> Thanks,
> > >>> >>>>> >>
> > >>> >>>>> >> Mark
> > >>> >>>>> >> _______________________________________________
> > >>> >>>>> >> protege-discussion mailing list
> > >>> >>>>> >> [hidden email]
> > >>> >>>>> >>
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>> >>
> > >>> >>>>> >> Instructions for unsubscribing:
> > >>> >>>>> >> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>> >>>>> >>
> > >>> >>>>> >
> > >>> >>>>> > _______________________________________________
> > >>> >>>>> > protege-discussion mailing list
> > >>> >>>>> > [hidden email]
> > >>> >>>>> >
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>> >
> > >>> >>>>> > Instructions for unsubscribing:
> > >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>> >>>>> >
> > >>> >>>>> >
> > >>> >>>>>_______________________________________________
> > >>> >>>>>protege-discussion mailing list
> > >>> >>>>>[hidden email]
> > >>> >>>>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>> >>>>>
> > >>> >>>>>Instructions for unsubscribing:
> > >>> >>>>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>>
> > >>>_______________________________________________
> > >>>protege-discussion mailing list
> > >>>[hidden email]
> > >>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> > >>>
> > >>>Instructions for unsubscribing:
> > >>> http://protege.stanford.edu/doc/faq.html#01a.03
> > >>
> > _______________________________________________
> > protege-discussion mailing list
> > [hidden email]
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >
> > Instructions for unsubscribing:
> > http://protege.stanford.edu/doc/faq.html#01a.03
>
>_______________________________________________
>protege-discussion mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
>Instructions for unsubscribing:
>http://protege.stanford.edu/doc/faq.html#01a.03

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

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