Search Mailing List Archives
[protege-discussion] nullpointer exception in theloadKnowledgeBase method
Olivier Mocquais RD-BIZZ
olivier.mocquais at orange-ftgroup.com
Mon Mar 26 06:01:05 PDT 2007
Tania,
Thank you for your help. it works fine.
Regards.
Olivier
Tania Tudorache wrote:
> Olivier,
>
> I have documented on the wiki how to load an ontology stored in a
> Protege frames database:
>
> http://protege.cim3.net/cgi-bin/wiki.pl?HowToUseDatabaseBackend
>
> Tania
>
> Olivier Mocquais RD-BIZZ wrote:
>
>> Hi,
>>
>> I want to save a jdbc knowledge base into a pprj file.
>>
>> I use the Protégé API and this java code, but it doesn't work, I have a
>> NullPointerException when the loadKnowledgeBase method is called. The
>> database and the table exists with many information.
>>
>> WARNING: Unable to load knowledgebase jdbc:mysql://localhost/protege --
>> java.lang.NullPointerException
>> at
>> edu.stanford.smi.protege.storage.database.DatabaseKnowledgeBaseFactory.initializeKB(Unknown
>> Source)
>> at
>> edu.stanford.smi.protege.storage.database.DatabaseKnowledgeBaseFactory.loadKnowledgeBase(Unknown
>> Source)
>>
>> String username = "root";
>> String password = "system";
>> String driver = "com.mysql.jdbc.Driver";
>> String tablename = "protegekb";
>> Collection errors = new ArrayList();
>> DatabaseKnowledgeBaseFactory myFactory = new DatabaseKnowledgeBaseFactory();
>> Project prj = Project.createNewProject(myFactory, errors);
>> prj.setProjectFilePath("myproject.pprj");
>> prj.setKnowledgeBaseFactory(myFactory);
>> KnowledgeBase kb = prj.getKnowledgeBase();
>> myFactory.loadKnowledgeBase(kb, driver,
>> "jdbc:mysql://localhost/protege", username, password, tablename, errors);
>> errors = new ArrayList();
>> prj.save(errors);
>>
>> Thanks for any help in order to resolve my problem.
>>
>> Regards
>>
>> Olivier
>>
>>
>> The full Trace:
>> CONFIG: Protege 3.2.1 Build 365, JVM 1.5.0_10-b03, memory=66M, Windows
>> XP, encoding=UTF-8, language=fr, country=FR
>> WARNING: Look and feel not found:
>> com.jgoodies.looks.plastic.PlasticLookAndFeel --
>> SystemUtilities.setLookAndFeel()
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.owl - OWL Plugin
>> CONFIG: Loaded plugin ca.uvic.cs.chisel.jambalaya - Jambalaya
>> CONFIG: Loaded plugin dfki.protege.ontoviz
>> CONFIG: Loaded plugin edu.stanford.smi.protege.script - Script Plugin
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.standard_extensions -
>> Graph Widget, Table Widget
>> CONFIG: Loaded plugin edu.stanford.smi.protege.stringsearch - String
>> Search Tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.rdf_backend - RDF Backend
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.storage.rdf.configurable.RDFExportPlugin --
>> PluginUtilities.checkPlugin()
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.widget.oil.ExpressionFieldWidget --
>> PluginUtilities.checkPlugin()
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.storage.rdf.configurable.RDFCreateProjectPlugin
>> -- PluginUtilities.checkPlugin()
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.storage.rdf.configurable.RDFExportProjectPlugin
>> -- PluginUtilities.checkPlugin()
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.widget.oil.ExpressionListWidget --
>> PluginUtilities.checkPlugin()
>> WARNING: Duplicate plugin:
>> edu.stanford.smi.protegex.storage.rdf.configurable.RDFCBackend --
>> PluginUtilities.checkPlugin()
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.changes - Changes tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.pal_tabs - PAL Tabs
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.ezpal - EZPal Tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.facets_tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.instance_tree
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.prompt - PROMPT Tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.psm - PSM Librarian
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.umls_tab - UMLS Tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.wordnet - WordNet Tab
>> CONFIG: Loaded plugin edu.stanford.smi.protegex.xml_tab - XML Tab
>> CONFIG: Loaded plugin edu.washington.datagenie
>> CONFIG: Loaded plugin org.algernon - Algernon
>> CONFIG: Loaded plugin se.liu.ida.JessTab - JessTab Plugin
>> CONFIG: Loaded plugin uk.ac.iam.soton.akt.tgviztab - TGVizTab
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.debugger
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.manchesterowlsyntaxeditor
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owldoc
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owlindividualstab
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owlunittest
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owlviz
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard - Basic Wizards
>> CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard.owl - OWL
>> Wizards
>> WARNING: Unable to load knowledgebase jdbc:mysql://localhost/protege --
>> java.lang.NullPointerException
>> at
>> edu.stanford.smi.protege.storage.database.DatabaseKnowledgeBaseFactory.initializeKB(Unknown
>> Source)
>> at
>> edu.stanford.smi.protege.storage.database.DatabaseKnowledgeBaseFactory.loadKnowledgeBase(Unknown
>> Source)
>>
>> _______________________________________________
>> protege-discussion mailing list
>> protege-discussion at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>
>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>>
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
>
--
*Olivier Mocquais*
ft/nsm/rd/bizz/cil/ais
ingénieur développements avancés j2ee
tél. 01 45 29 47 22
olivier.mocquais at orange-ftgroup.com
<mailto:olivier.mocquais at orange-ftgroup.com>
More information about the protege-discussion
mailing list