Trying to use JWNL, getting NullPointerExcept

  • savio spiteri

    savio spiteri - 2008-03-14

    Hi all,

    I am using JWNL 1.4, database backend (MySQL), wordnet 2.1, windows vista. After somehow managing to import the data into my database, I am trying to do the following code:

    try {
                //initialise jwnl
                FileInputStream properties = new FileInputStream(WNPROPFILE);
                if (!JWNL.isInitialized())JWNL.initialize(properties);
                IndexWord iw = Dictionary.getInstance().getIndexWord(POS.NOUN, "tank");
    } catch (Exception ex) {

    JWNL is being initialised correctly but I am getting the following:

    Mar 14, 2008 10:17:03 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Installing dictionary net.didion.jwnl.dictionary.DatabaseBackedDictionary@64ab4d
            at net.didion.jwnl.dictionary.DatabaseBackedDictionary.getIndexWord(
            at acrosstheweb.Main.testWordnet(
            at acrosstheweb.Main.main(

    I have searched all this forum, and found numerous fixes for wordnet 2.1 problems. However, my code already contains these fixes. Hence, I have no idea what is going wrong, but I am getting desperate!

    Thanks for all your help...

    • Brett Walenz

      Brett Walenz - 2008-03-18

      My initial guess would be that the database isn't populated correctly, as it looks like it's failing on a query being null, which shouldn't be the case (obviously).

      I'll look at this today and see if I can replicate...

    • savio spiteri

      savio spiteri - 2008-03-19

      Thanks a lot for your time.

      It certainly could be an error in the database population. In fact, I did not manage to import wordnet using JWNL itself, but did so using another project called WordnetSQLBuilder. Could it be that the schema database (or whatever) is somewhat different?

      Anyways, if you could give me instructions on how to import Wordnet using JWNL itself, I will try again.

      Thanks a lot for your help...


Log in to post a comment.