Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Cannot Load MapBackedDictionary

Help
imei
2005-07-03
2013-04-29
  • imei
    imei
    2005-07-03

    Hi,

    I'm running into a strange issue with MapBackedDictionary.

    I was able to successfully generate the Serialized dictionary files using the following command:
    java net.didion.jwnl.utilities.DictionaryToMap $WORD_NET_DIR/dict/serialized file_properties.xml

    However, when I tried to use a MapBackedDictionary, JWNL was able to load all of the .idx files, but when it tried to load the noun.data file, it gave a NullPointerException.  I don't think it's a code issue, because I get the same error when I test the serialized files by running the DictionaryToMap utility again, this time using the map_properties file:
    java net.didion.jwnl.utilities.DictionaryToMap $WORD_NET_DIR/dict/serialized map_properties.xml

    Has anyone seen a similar issue before?  I'm running windows XP. 

    Any advice would be greatly appreciated.

    The output/exception stack is:
    C:\Dir>java -Xmx256m -cp jwnl.jar;util
    ities.jar;commons-logging.jar net.didion.jwnl.utilities.DictionaryToMap "./seria
    lized2"  map_properties.xml
    Jul 3, 2005 12:14:46 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading MapBackedDictionary
    Jul 3, 2005 12:14:46 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading [POS: noun] [DictionaryFile: index]
    Jul 3, 2005 12:14:51 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading [POS: verb] [DictionaryFile: index]
    Jul 3, 2005 12:14:52 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading [POS: adjective] [DictionaryFile: index]
    Jul 3, 2005 12:14:52 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading [POS: adverb] [DictionaryFile: index]
    Jul 3, 2005 12:14:53 AM net.didion.jwnl.util.MessageLog doLog
    INFO: Loading [POS: noun] [DictionaryFile: data]
    net.didion.jwnl.JWNLException: Unable to install net.didion.jwnl.dictionary.MapB
    ackedDictionary
            at net.didion.jwnl.util.factory.Element.install(Element.java:34)
            at net.didion.jwnl.JWNL.initialize(JWNL.java:153)
            at net.didion.jwnl.utilities.DictionaryToMap.<init>(DictionaryToMap.java
    :37)
            at net.didion.jwnl.utilities.DictionaryToMap.main(DictionaryToMap.java:1
    28)
    Caused by: net.didion.jwnl.JWNLException: Error loading serialized object(s) fro
    m file c:\program files\wordnet\2.0\dict\serialized\noun.dat
            at net.didion.jwnl.dictionary.MapBackedDictionary.loadDictFile(MapBacked
    Dictionary.java:184)
            at net.didion.jwnl.dictionary.MapBackedDictionary.<init>(MapBackedDictio
    nary.java:112)
            at net.didion.jwnl.dictionary.MapBackedDictionary.install(MapBackedDicti
    onary.java:57)
            at net.didion.jwnl.dictionary.MapBackedDictionary.install(MapBackedDicti
    onary.java:81)
            at net.didion.jwnl.util.factory.Element.install(Element.java:32)
            ... 3 more
    Caused by: java.lang.NullPointerException
            at net.didion.jwnl.data.Pointer.readObject(Pointer.java:134)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readArray(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
            at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
            at net.didion.jwnl.data.Synset.readObject(Synset.java:150)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at java.util.HashMap.readObject(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at net.didion.jwnl.princeton.file.PrincetonObjectDictionaryFile.readObje
    ct(PrincetonObjectDictionaryFile.java:90)
            at net.didion.jwnl.dictionary.MapBackedDictionary.loadDictFile(MapBacked
    Dictionary.java:182)
            ... 7 more

     
    • imei
      imei
      2005-07-03

      Forgot to mention, I'm using JWNL 1.3.