MyEclipse运行nutch时出现log4j错误

时间:2021-01-06 09:35:33
用MyEclipse配置了nutch0.9,运行后出现错误:
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: \ (系统找不到指定的路径。)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:215)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.nutch.crawl.Crawl.<clinit>(Crawl.java:40)
log4j:ERROR Either File or DatePattern options are not set for appender [DRFA].



但是紧接其后还是进行了爬取:
crawl started in: testData/out
rootUrlDir = testData/urls.txt
threads = 2
depth = 1
topN = 10
Injector: starting
Injector: crawlDb: testData/out/crawldb
Injector: urlDir: testData/urls.txt
Injector: Converting injected urls to crawl db entries.
Injector: Merging injected urls into crawl db.
Injector: done
Generator: Selecting best-scoring urls due for fetch.
Generator: starting
Generator: segment: testData/out/segments/20130413152938
Generator: filtering: false
Generator: topN: 10
Generator: jobtracker is 'local', generating exactly one partition.
Generator: Partitioning selected urls by host, for politeness.
Generator: done.
Fetcher: starting
Fetcher: segment: testData/out/segments/20130413152938
Fetcher: threads: 2
fetching http://www.hao123.com.cn/
fetching http://www.sina.com.cn/
fetch of http://www.hao123.com.cn/ failed with: java.net.SocketTimeoutException: connect timed out
Fetcher: done
CrawlDb update: starting
CrawlDb update: db: testData/out/crawldb
CrawlDb update: segments: [testData/out/segments/20130413152938]
CrawlDb update: additions allowed: true
CrawlDb update: URL normalizing: true
CrawlDb update: URL filtering: true
CrawlDb update: Merging segment data into db.
CrawlDb update: done
LinkDb: starting
LinkDb: linkdb: testData/out/linkdb
LinkDb: URL normalize: true
LinkDb: URL filter: true
LinkDb: adding segment: testData/out/segments/20130413152938
LinkDb: done
Indexer: starting
Indexer: linkdb: testData/out/linkdb
Indexer: adding segment: testData/out/segments/20130413152938
 Indexing [http://www.sina.com.cn/] with analyzer org.apache.nutch.analysis.NutchDocumentAnalyzer@c06258 (null)
Optimizing index.
merging segments _ram_0 (1 docs) into _0 (1 docs)
Indexer: done
Dedup: starting
Dedup: adding indexes in: testData/out/indexes
Dedup: done
merging indexes to: testData/out/index
Adding testData/out/indexes/part-00000
done merging
crawl finished: testData/out

这是什么情况?对爬取结果有什么影响?怎么样解决这个错误啊?

5 个解决方案

#1


我也遇到了同样的问题,不过我比你还惨……我的提示完错误后就停止了,连爬取都没有进行…… MyEclipse运行nutch时出现log4j错误,你的问题解决了吗?是怎么解决的??

#2


java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

#3


引用 2 楼 huxiweng 的回复:
java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

不知道,如果是路径问题,应该怎么该?可能哪里的路径配置不对?求大神啊……

#4


引用 3 楼 ouyangtijin 的回复:
Quote: 引用 2 楼 huxiweng 的回复:

java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

不知道,如果是路径问题,应该怎么该?可能哪里的路径配置不对?求大神啊……

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: \ (系统找不到指定的路径。)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:215)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.nutch.crawl.Crawl.<clinit>(Crawl.java:39)
log4j:ERROR Either File or DatePattern options are not set for appender [DRFA].
[Fatal Error] nutch-site.xml:8:8: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:553)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:472)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:454)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:201)
at org.apache.hadoop.conf.Configuration.getInt(Configuration.java:229)
at org.apache.nutch.crawl.Crawl.main(Crawl.java:61)
Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:497)
... 5 more

谁来拯救我……

#5


http://blog.csdn.net/luxiaoruo/article/details/8554175

#1


我也遇到了同样的问题,不过我比你还惨……我的提示完错误后就停止了,连爬取都没有进行…… MyEclipse运行nutch时出现log4j错误,你的问题解决了吗?是怎么解决的??

#2


java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

#3


引用 2 楼 huxiweng 的回复:
java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

不知道,如果是路径问题,应该怎么该?可能哪里的路径配置不对?求大神啊……

#4


引用 3 楼 ouyangtijin 的回复:
Quote: 引用 2 楼 huxiweng 的回复:

java.io.FileNotFoundException: \ (系统找不到指定的路径。)

路径问题?

不知道,如果是路径问题,应该怎么该?可能哪里的路径配置不对?求大神啊……

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: \ (系统找不到指定的路径。)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:215)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.nutch.crawl.Crawl.<clinit>(Crawl.java:39)
log4j:ERROR Either File or DatePattern options are not set for appender [DRFA].
[Fatal Error] nutch-site.xml:8:8: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception in thread "main" java.lang.RuntimeException: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:553)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:472)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:454)
at org.apache.hadoop.conf.Configuration.get(Configuration.java:201)
at org.apache.hadoop.conf.Configuration.getInt(Configuration.java:229)
at org.apache.nutch.crawl.Crawl.main(Crawl.java:61)
Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:497)
... 5 more

谁来拯救我……

#5


http://blog.csdn.net/luxiaoruo/article/details/8554175