Eclipse中导入Heritrix,报错找不到类 sun.net.www.protocol.file.FileURLConnection

Eclipse中导入Heritrix,报错找不到类 sun.net.www.protocol.file.FileURLConnection

sun包是受保护的包,默认只有sun公司的软件才能使用。Eclipse会报错,把对保护使用waring就可以了。

步骤:Windows -> Preferences -> Java -> Compiler -> Errors/Warnings-> Deprecated and trstricted API -> Forbidden reference (access rules): -> change to warning


运行heritrix1.14.4报错 thread-10 org.archive.util.ArchiveUtils.() TLD list unavailable

运行heritrix1.14.4报错 thread-10 org.archive.util.ArchiveUtils.() TLD list unavailable

最近需要用到heritrix做一个需求,下来研究了一下。

根据网上的文章在eclipse中启动报了下面的错误

10:02:59.968 EVENT Starting Jetty/4.2.23
10:03:00.765 EVENT Started WebApplicationContext[/,Heritrix Console]
10:03:00.859 EVENT The scratchDir you specified: F:/project3.5/heritrix/target/jsp-compiled-development is unusable.
10:03:01.000 EVENT Started SocketListener on 127.0.0.1:8088
10:03:01.000 EVENT Started
2010-07-10 10:03:01.250 严重 thread-10 org.archive.util.ArchiveUtils.() TLD list unavailable
java.lang.NullPointerException
at java.io.Reader.(Unknown Source)
at java.io.InputStreamReader.(Unknown Source)
at org.archive.util.ArchiveUtils.(ArchiveUtils.java:759)
at org.archive.crawler.settings.CrawlSettingsSAXHandler$DateHandler.endElement(CrawlSettingsSAXHandler.java:385)
at org.archive.crawler.settings.CrawlSettingsSAXHandler.endElement(CrawlSettingsSAXHandler.java:248)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.archive.crawler.settings.XMLSettingsHandler.readSettingsObject(XMLSettingsHandler.java:298)
at org.archive.crawler.settings.XMLSettingsHandler.readSettingsObject(XMLSettingsHandler.java:339)
at org.archive.crawler.settings.SettingsHandler.initialize(SettingsHandler.java:130)
at org.archive.crawler.settings.XMLSettingsHandler.initialize(XMLSettingsHandler.java:124)
at org.archive.crawler.admin.CrawlJobHandler.loadProfile(CrawlJobHandler.java:385)
at org.archive.crawler.admin.CrawlJobHandler.loadProfiles(CrawlJobHandler.java:348)
at org.archive.crawler.admin.CrawlJobHandler.(CrawlJobHandler.java:217)
at org.archive.crawler.admin.CrawlJobHandler.(CrawlJobHandler.java:186)
at org.archive.crawler.Heritrix.(Heritrix.java:405)
at org.archive.crawler.Heritrix.(Heritrix.java:393)
at org.archive.crawler.Heritrix.doCmdLineArgs(Heritrix.java:718)
at org.archive.crawler.Heritrix.main(Heritrix.java:556)

虽然报错,但是可以进入登陆页面,UI已经正常启动。

这个东西没有用过,前一天刚刚使用cmd命令运行成功,今天在eclipse中建工程又碰到新问题。

一步一坎啊。

昨天运行的时候后台是没有报这个错误的,但是今天在eclipse下配置文件位置不对也报过NullPointerException的错误。

因此分析还是少了某个文件。

经过几个小时调试,发现是少了一个名字为tlds-alpha-by-domain.txt的文件。

发布包中对应位置是有该文件的,具体位置为org/archive/util,在该路径下补充该文件就不报错了。

至于该文件的用途还不清楚,有高手可以指点一下。

该文件可以在源文件包src/resources路径下找到。



你可能感兴趣的:(Activiti)