Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,不知道为什么运行有这样的错误 #1

Open
TaylorWPY opened this issue Jan 16, 2019 · 4 comments
Open

你好,不知道为什么运行有这样的错误 #1

TaylorWPY opened this issue Jan 16, 2019 · 4 comments

Comments

@TaylorWPY
Copy link

控制台报错Exception in thread "pool-1-thread-1" java.lang.ExceptionInInitializerError
at cn.lcy.ontologyconstruction.crawler.OntologyConstructionPageProcessor.process(OntologyConstructionPageProcessor.java:77)
at us.codecraft.webmagic.Spider.processRequest(Spider.java:421)
at us.codecraft.webmagic.Spider$1.run(Spider.java:322)
at us.codecraft.webmagic.thread.CountableThreadPool$1.run(CountableThreadPool.java:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at java.io.Reader.(Unknown Source)
at java.io.InputStreamReader.(Unknown Source)
at cn.lcy.ontologyconstruction.util.Configuration.propertiesLoader(Configuration.java:21)
at cn.lcy.ontologyconstruction.config.Config.(Config.java:55)
... 7 more

@YueHub
Copy link
Owner

YueHub commented Jan 16, 2019

你好,
先确认本地环境用 maven 下载好了所有的依赖包,然后执行一下 mvn clean 和 mvn install 命令。
另外把 data 目录下的 AnswerDict 和 Ontologies 目录复制到指定目录,目录相关配置在 ontology-construction.properties 文件里。

@TaylorWPY
Copy link
Author

你好,我这样操作之后错误信息依然没有变

@YueHub
Copy link
Owner

YueHub commented Jan 16, 2019

你用的是哪个 IDE,有在 IDE 里面将项目的 resources 目录设置成 resource 类型目录吗。例如在 eclipse 可以右键项目选择 Properties 再在 "Java Build Path" 栏的 "Source" Tab 添加 resources 目录,在 idea 里可以直接右键目录选择 Make Directory as - "Resources Root"

@TaylorWPY
Copy link
Author

可以了,太感谢了,是个很好的学习代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants