Unable to install FileBackedDictionary

Help
2003-06-25
2003-06-25
  • Harry Delugach

    Harry Delugach - 2003-06-25

    I am just starting out with JWNL, so this may be a simple problem. I am running a pure Java application that works fine under Mac OS X but does not seem to work under Windows 2000.

    The problem occurs when I invoke JWNL.initialize(). I get the exception: Unable to install net.didionn.jwnl.dictionary.FileBackedDictionary

    I have edited the file_properties.xml file correctly (I think), though the dictionary paths are obviously different on the two platforms, I have used the properties file from the distribution as a guide. I only changed the dictionary_path parameter in the file, and left the others unchanged.

    If it helps, I am using JDK 1.4.1 on both platforms. I copied all the files in the "dict" directory from the Mac to the PC.

    I'd appreciate any advice or assistance. Thanks.

    Harry

     
    • Marin Dimitrov

      Marin Dimitrov - 2003-06-25

      could you provide us with more information (the two versions of file_properties for example)

       
    • Harry Delugach

      Harry Delugach - 2003-06-25

      private static void initializeWordNet()
      {
          try {
              String propsFile = "file_properties.xml";
                          System.out.println( "before making file input stream" );
              FileInputStream fis = new FileInputStream( propsFile );
                          System.out.println( "before initialize() call" );
              net.didion.jwnl.JWNL.initialize( fis );        // <=== this call produces exception
                                      // the call to initialize results in JWNL exception:
                                      //  Unable to install net.didion.jwnl.dictionary.FileBackedDictionary
                                      // on the PC
                          System.out.println( "after initialize() call" );
              dict = net.didion.jwnl.dictionary.Dictionary.getInstance();
                  ....
          } catch ( FileNotFoundException fe )
          {
                  System.out.println( "File not found : " + fe.getMessage() );
          }
          catch ( net.didion.jwnl.JWNLException je )
          {
              System.out.println( "JWNL Exception: " + je.getMessage() );
          }
      }
      -------------------------------------------------------
      OUTPUT under Windows 2000 Server is as follows:

      before making file input stream
      before initialize() call
      JWNL Exception: unable to install Unable to install net.didion.jwnl.dictionary.FileBackedDictionary

      OUTPUT under Mac OS X is as follows:
      before making file input stream
      before initialize() call
      after initialize() call

      ----------------------------------------
      "file_properties.xml file" on OS X:

      <?xml version="1.0" encoding="UTF-8"?>
      <jwnl_properties language="en">
          <version publisher="Princeton" number="1.7" language="en"/>
          <dictionary class="net.didion.jwnl.dictionary.FileBackedDictionary">
              <param name="morphological_processor" value="net.didion.jwnl.dictionary.DefaultMorphologicalProcessor"/>
              <param name="file_manager" value="net.didion.jwnl.dictionary.file_manager.FileManagerImpl">
                  <param name="file_type" value="net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile"/>
                  <param name="dictionary_path" value="/Applications/WordNet-1.7.1.1/dict"/>
              </param>
          </dictionary>
          <dictionary_element_factory class="net.didion.jwnl.princeton.data.PrincetonWN17DictionaryElementFactory"/>
          <resource class="PrincetonResource"/>
      </jwnl_properties>
      -----------------------------------
      "file_properties.xml" file on Windows 2000 Server:

      <?xml version="1.0" encoding="UTF-8"?>
      <jwnl_properties language="en">
          <version publisher="Princeton" number="1.7" language="en"/>
          <dictionary class="net.didion.jwnl.dictionary.FileBackedDictionary">
              <param name="morphological_processor" value="net.didion.jwnl.dictionary.DefaultMorphologicalProcessor"/>
              <param name="file_manager" value="net.didion.jwnl.dictionary.file_manager.FileManagerImpl">
                  <param name="file_type" value="net.didion.jwnl.princeton.file.PrincetonRandomAccessDictionaryFile"/>
                  <param name="dictionary_path" value="c:\inetpub\ftproot\dict"/>
              </param>
          </dictionary>
          <dictionary_element_factory class="net.didion.jwnl.princeton.data.PrincetonWN17DictionaryElementFactory"/>
          <resource class="PrincetonResource"/>
      </jwnl_properties>
      -------------------------------------------
      OTHER INFORMATION:
      Java is finding the properties file successfully.
      If I use a dummy file name for the properties file, I get this output:

      before making file input stream
      File not found : file_propertiesXXX.xml (No such file or directory)

      --------------------------

       

Log in to post a comment.