sourish-rygbee / dkpro-similarity-asl

Automatically exported from code.google.com/p/dkpro-similarity-asl
0 stars 0 forks source link

Loading Resources from JAR fails in experiments.sts2013baseline.util.StopwordFilter #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download the 1.0.1 stable version of the sts2013baseline (gpl package)
2. Run Pipeline -D

Run terminates with Exception:

Caused by: java.io.FileNotFoundException: class path resource 
[stopwords/stopwords_english_punctuation.txt] cannot be resolved to absolute 
file path because it does not reside in the file system: 
jar:file:/home/someuser/.m2/repository/de/tudarmstadt/ukp/similarity/dkpro/de.tu
darmstadt.ukp.similarity.dkpro.data-asl/1.0.1/de.tudarmstadt.ukp.similarity.dkpr
o.data-asl-1.0.1.jar!/stopwords/stopwords_english_punctuation.txt
    at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
    at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
    at de.tudarmstadt.ukp.similarity.experiments.sts2013baseline.util.StopwordFilter.initialize(StopwordFilter.java:75)
    ... 15 more

Suggested Bugfix:

Replace res.getFile(); with res.getInputStream(); in
de.tudarmstadt.ukp.similarity.experiments.sts2013baseline.util.StopwordFilter.in
itialize(StopwordFilter.java:75)

Original issue reported on code.google.com by mich...@informatik.uni-mannheim.de on 19 Aug 2013 at 2:46

Attachments:

GoogleCodeExporter commented 9 years ago
There is actually at least one more bug of the same type...

Figured out it an easier work-around is to copy the data needed (datasets, 
goldstandards, stopwords) from the jar file into a separate folder and add it 
manually to the class path...

Cheers Michael

Original comment by mich...@informatik.uni-mannheim.de on 19 Aug 2013 at 3:51

GoogleCodeExporter commented 9 years ago
Yes, this will certainly work, too.

Could you point out the other location, where the same error occurs, so that we 
can fix that, too?

ps: And thanks for the patch.

Original comment by torsten....@gmail.com on 19 Aug 2013 at 3:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Next one was caused by 
sts2013baseline.util.Features2Arff.toArffFile(Features2Arff.java:49)
Same res.getFile() problem

----
Exception in thread "main" java.io.FileNotFoundException: class path resource 
[goldstandards/semeval-2012/train/STS.gs.ALL.txt] cannot be resolved to 
absolute file path because it does not reside in the file system: 
jar:file:/home/mschuhma/.m2/repository/de/tudarmstadt/ukp/similarity/dkpro/de.tu
darmstadt.ukp.similarity.dkpro.data-asl/1.0.1/de.tudarmstadt.ukp.similarity.dkpr
o.data-asl-1.0.1.jar!/goldstandards/semeval-2012/train/STS.gs.ALL.txt
    at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
    at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
    at de.tudarmstadt.ukp.similarity.experiments.sts2013baseline.util.Features2Arff.toArffFile(Features2Arff.java:49)
    at de.tudarmstadt.ukp.similarity.experiments.sts2013baseline.Pipeline.runTest(Pipeline.java:155)
    at de.tudarmstadt.ukp.similarity.experiments.sts2013baseline.Pipeline.main(Pipeline.java:101)

Original comment by mich...@informatik.uni-mannheim.de on 19 Aug 2013 at 4:03

GoogleCodeExporter commented 9 years ago
I fixed the issue at those two locations.
Hopefully that fixed it.

Original comment by torsten....@gmail.com on 20 Aug 2013 at 3:06