Skip to content

Suggestors causing java.lang.NoClassDefFoundError: java.nio.file.Paths is a restricted class error #9

@aabdolla

Description

@aabdolla

I am currently running into this error trying to use certain suggestors.

I am mainly copying the examples from here:

AutoSuggestTest.java

Of course I am changing the Directory to GaeDirctory but I am getting this error when the suggestor is trying to build the dictionary like on line 63 of the AutoSuggestTest.

I have successfully used the SpellChecker before but it indexes the dictionary a different way than the suggestors:

try (GaeDirectory directory = new GaeDirectory(indexPhraseName);
    GaeDirectory suggestDirectory = new GaeDirectory(indexPhraseSuggestionName)) {
    SpellChecker phraseRecommender = new SpellChecker(suggestDirectory);
    IndexReader reader = DirectoryReader.open(directory);
    phraseRecommender.indexDictionary(new LuceneDictionary(reader, "title"), getIndexWriterConfig(new StandardAnalyzer()), true);
    phraseRecommender.close();
    reader.close();
} catch (LockObtainFailedException e) {
    request.setError("Cannot acquire lock to the :'" + indexPhraseName + "' or '" + indexPhraseSuggestionName + "'. Other indexing operation are executing please try again later.");
} catch (IOException e) {
    request.setError("IO exception:'" + indexPhraseName + "' or '" + indexPhraseSuggestionName + "', cause:" + e.getMessage());
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions