KusTa / paoding

Automatically exported from code.google.com/p/paoding
0 stars 0 forks source link

PaodingMaker类getFileLastModified方法第242行报错! #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
将paoding-analysis.jar引入项目,初始化Analyzer analyzer = new 
PaodingAnalyzer();时报错。

错误信息输出如下:

error in handler path=file:/F:/workspace/eclipse3.2 workspace/web-search/
lib/lucene-2.2.0/paoding-analysis.jar!/paoding-analysis.properties
error in handler jarPath=/F:/workspace/eclipse3.2 workspace/web-search/lib/
lucene-2.2.0/paoding-analysis.jar!/
Exception in thread "main" 
net.paoding.analysis.exception.PaodingAnalysisException: 
java.io.FileNotFoundException: F:\workspace\eclipse3.2 workspace\web-
search\lib\lucene-2.2.0\paoding-analysis.jar! 
(系统找不到指定的文件。)
    at 
net.paoding.analysis.knife.PaodingMaker.getProperties(PaodingMaker.java:138)
    at 
net.paoding.analysis.analyzer.PaodingAnalyzer.init(PaodingAnalyzer.java:70)
    at 
net.paoding.analysis.analyzer.PaodingAnalyzer.<init>(PaodingAnalyzer.java:59)
    at 
net.paoding.analysis.analyzer.PaodingAnalyzer.<init>(PaodingAnalyzer.java:52)
    at 
com.cdqss.core.searchengine.index.TxtFileIndexer.createIndex(TxtFileIndexer.java
:36)
    at 
com.cdqss.core.searchengine.index.TxtFileIndexer.main(TxtFileIndexer.java:62)
Caused by: java.io.FileNotFoundException: F:\workspace\eclipse3.2 
workspace\web-search\lib\lucene-2.2.0\paoding-analysis.jar! 
(系统找不到指定
的文件。)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at 
net.paoding.analysis.knife.PaodingMaker.getFileLastModified(PaodingMaker.java:24
2)
    at 
net.paoding.analysis.knife.PaodingMaker.loadProperties(PaodingMaker.java:207)
    at 
net.paoding.analysis.knife.PaodingMaker.getProperties(PaodingMaker.java:129)
    ... 5 more

版本:paoding-analysis-2.0.4-alpha2
环境:WINXP+JDK6.0

经调试追踪到在PaodingMaker类getFileLastModified方法第242行处报错�
��此处代码
为:jarFile = new JarFile(jarPathFile);

Original issue reported on code.google.com by aiwuy...@gmail.com on 11 Dec 2007 at 6:40

GoogleCodeExporter commented 9 years ago

Original comment by qieqie.wang on 11 Dec 2007 at 6:45

GoogleCodeExporter commented 9 years ago
我也有这个问题,我临时把目录中带空格的,都改成不带空��
�的,就可以通过了,

Original comment by xilinam...@gmail.com on 26 Dec 2007 at 9:30

GoogleCodeExporter commented 9 years ago
原因的确是由空格引起的,把第236行代码
path = path.replaceAll("%20", " ").replaceAll("\\\\", "/");
移到
第230行之后即可。
这样才能从根本上解决问题。

Original comment by aiwuy...@gmail.com on 31 Dec 2007 at 1:50

GoogleCodeExporter commented 9 years ago
已经fix到svn代码库中

Original comment by qieqie.wang on 17 Mar 2008 at 3:17

GoogleCodeExporter commented 9 years ago
PaodingMaker.java Line 238:

path = path.replaceAll("%20", " ").replaceAll("\\\\", "/");

jarIndex = path.indexOf(".jar!"); // update jarIndex position
int protocalIndex = path.indexOf(":");

String jarPath = path.substring(protocalIndex + ":".length(), jarIndex 
+ ".jar".length()); // For UNIX - file:/usr/local/xxxx/xxx.jar!xxxx.properties
if (jarPath.indexOf(":") != -1) // For MS Windows - file:/C:/Programe 
Files/xxxx/xxx.jar!xxxx.properties
    jarPath = path.substring(protocalIndex + ":/".length(), jarIndex 
+ ".jar".length());

Original comment by tommych...@gmail.com on 14 Apr 2008 at 4:40