【发布时间】:2014-04-11 19:24:25
【问题描述】:
当我从 server 读取文件时,我得到 file not found 异常,但是当我从 main,请告诉我这个问题的建议。 提前致谢。
static Ontology ontology = new SingleFileOntologyImpl("data/Thesaurus_V21.ontology");
System.err.println("Ontology file read!");
tokenizerFactory = TokenizerFactoryImpl.createDefaultTokenizerFactory(new UMLSGeneChemTokenizer());
normalizerFactory = NormalizerFactoryImpl.createDefaultNormalizerFactory(new LVGNormalizer("/home/rajendraprasad.yk/projects/FSTA/FSTA_NLP/tools/lvg2006/data/config/lvg.properties"));
System.err.println("LVG initialized");
disambiguator = new TypeDisambiguatorImpl(new RuleDisambiguator[] { new StrictDisambiguator(),new LooseDisambiguator() });
disambiguationDecisionMaker = new ThresholdDisambiguationDecisionMakerImpl();
String ontologyLanguageToLoad = null;
System.out.println(new Date());
peregrine = new PeregrineImpl(ontology, tokenizerFactory,normalizerFactory, disambiguator,disambiguationDecisionMaker, ontologyLanguageToLoad);
System.err.println("Peregrine Initialized ! "+ new Date());
例外是:java.lang.RuntimeException: java.io.FileNotFoundException: data/Thesaurus_V21.ontology (No such file or directory)
【问题讨论】:
-
你能发布一些与问题相关的代码吗?您的路径似乎有问题
-
这取决于您如何从服务器读取它。显示一些代码。
标签: java web-services filenotfoundexception