Search Mailing List Archives


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

[protege-discussion] NullPointerException when logging

Mansour, Michel michel.mansour at emory.edu
Fri Feb 10 07:57:44 PST 2012


Hello,

Protege 3.4.8 is throwing a NullPointerException when the logging level is set to FINE or lower (i.e., FINER, FINEST, ALL). This only seems to happen when opening a project using the Java API by specifying a .pprj file, which contains the database connection information. The relevant portion of the stack trace is:

java.lang.NullPointerException
    at edu.stanford.smi.protege.storage.database.pool.DatabaseParam.hashCode(Unknown Source)
    at java.util.HashMap.get(HashMap.java:300)
    at edu.stanford.smi.protege.storage.database.pool.ConnectionPool.getConnectionPool(Unknown Source)
    at edu.stanford.smi.protege.storage.database.RobustConnection.<init>(Unknown Source)
    at edu.stanford.smi.protege.storage.database.AbstractDatabaseFrameDb.createConnection(Unknown Source)
    at edu.stanford.smi.protege.storage.database.AbstractDatabaseFrameDb.getCurrentConnection(Unknown Source)
    at edu.stanford.smi.protege.storage.database.IdleConnectionNarrowFrameStore.setIdle(Unknown Source)
    at edu.stanford.smi.protege.storage.database.IdleConnectionNarrowFrameStore.getName(Unknown Source)
    at edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore.dumpFrameStores(Unknown Source)
    at edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore.addActiveFrameStore(Unknown Source)
    at edu.stanford.smi.protege.model.Project.loadDomainKB(Unknown Source)
    at edu.stanford.smi.protege.model.Project.createDomainKnowledgeBase(Unknown Source)
    at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)
    at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)
    at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)
    at edu.stanford.smi.protege.model.Project.<init>(Unknown Source)

(The initial Project constructor being called is Project(String, Collection).)

And it seems to come down to this block of code in edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore#addActiveFrameStore(NarrowFrameStore, Collection) (lines 262-265):

        if (log.isLoggable(Level.FINE)) {
            log.fine("Added new active frame store");
            dumpFrameStores(Level.FINE);
        }

By the time it tries to create the connection in AbstractDatabaseFrameDb, all of the connection parameters are null, resulting in the NPE in DatabaseParam's hashCode() method. If logging is turned off (or set to a level higher than FINE), this error doesn't occur.

Please let me know if you need any more information.

Thank you,
Michel

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20120210/179bd864/attachment.html>


More information about the protege-discussion mailing list