Problems with 1.4 RC2 and NPE in 1.3 RC3

Help
2009-10-14
2013-04-29
  • Aaron Braeckel

    Aaron Braeckel - 2009-10-14

    Hello,

    I have two different problems with two different versions of JWNL.  When I call JWNL.initialize() in JWNL 1.4 RC2, it results in a Stack Overflow after many log messages starting with "Installing dictionary…":

        INFO: Installing dictionary net.didion.jwnl.dictionary.FileBackedDictionary@25ef73
        Oct 14, 2009 12:02:34 PM net.didion.jwnl.util.MessageLog doLog
        INFO: Installing dictionary net.didion.jwnl.dictionary.FileBackedDictionary@16e334a
        Exception in thread "main" java.lang.StackOverflowError
        at net.didion.jwnl.data.list.PointerTargetNodeList.<init>(PointerTargetNodeList.java:50)
        at net.didion.jwnl.data.list.PointerTargetTreeNodeList.<init>(PointerTargetTreeNodeList.java:38)
        at net.didion.jwnl.data.list.PointerTargetTreeNodeList.<init>(PointerTargetTreeNodeList.java:34)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:520)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:534)

    The same call to initialize (with a different properties file and appropriate JAR) in JWNL 1.3 RC3 works fine.

    However, while 1.3 RC3 initializes properly I have a different issue.  With certain Synset combinations (not all) I am getting a NullPointerException when I call:

        RelationshipFinder.getInstance().findRelationships(synset1, synset2, relationshipType). 
    The resulting NPE is:

        java.lang.NullPointerException
        at net.didion.jwnl.data.PointerTarget.getPointers(PointerTarget.java:39)
        at net.didion.jwnl.data.PointerTarget.getTargets(PointerTarget.java:55)
        at net.didion.jwnl.data.SynsetProxy.getTargets(SynsetProxy.java:47)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:523)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:477)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:444)
        at net.didion.jwnl.data.PointerUtils.makePointerTargetTreeList(PointerUtils.java:430)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findAsymmetricRelationships(RelationshipFinder.java:90)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findAsymmetricRelationships(RelationshipFinder.java:74)
        at net.didion.jwnl.data.relationship.RelationshipFinder.findRelationships(RelationshipFinder.java:49)
        at features.lexical.LexicalChain.relationshipDistance(LexicalChain.java:95)
        at features.lexical.LexicalChain.calcLexicalChain(LexicalChain.java:57)
        at weka.WekaSebastianFeaturesDatasetWriter.write(Unknown Source)
        at weka.WekaSebastianFeaturesDatasetWriter.main(Unknown Source)

    For example, a case where this happens is with:

        [Synset:   Words: intensity, strength, intensity_level - (the amount of energy transmitted (as by acoustic or electromagnetic radiation); "he adjusted the intensity of the sound"; "they measured the station's signal strength")]
        [Synset:   Words: Africa - (the second largest continent; located to the south of Europe and bordered to the west by the South Atlantic and to the east by the Indian Ocean)]
        [PointerType:   Applies To: noun, verb]

    and:

        [Synset:   Words: shake, agitate - (move or cause to move back and forth; "The chemist shook the flask vigorously"; "My hands were shaking")]
        [Synset:   Words: continent - (one of the large landmasses of the earth; "there are seven continents"; "pioneers had to cross the continent on foot")]
        [PointerType:   Applies To: noun, verb]

    Help with either problem is greatly appreciated.  However, since I have not yet been able to initialize 1.4 properly, it's not clear that it will help with the 1.3 NPE issue.

     
  • Aaron Braeckel

    Aaron Braeckel - 2009-10-14

    Nevermind, it appears that I had faulty logic in my code that was re-initializing the dictionary multiple times.  Running into a separate issue in 1.4 but will post on a separate thread if needed

     

Log in to post a comment.