简体   繁体   English

尝试使用MongoDB编译Nutch 2.2.1时出错,无法从sonar / ant / antlib.xml加载定义

[英]Errors when trying to compile Nutch 2.2.1 with MongoDB, could not load definitions from sonar/ant/antlib.xml

I want to compile Nutch 2.2.1 to use with MongoDB for data storage. 我想编译Nutch 2.2.1以与MongoDB一起用于数据存储。

I changed gora-core to 0.5 in file ivy.xml: 我在文件ivy.xml中将gora-core更改为0.5:

<dependency org="org.apache.gora" name="gora-core" rev="0.5" conf="*->default"/>

Also added dependency for mongodb in ivy/ivy.xml file: 还在ivy / ivy.xml文件中添加了对mongodb的依赖关系:

<dependency org="org.apache.gora" name="gora-mongodb" rev="0.5" conf="*->default" />

Added mongodb config in conf/gora.properties: 在conf / gora.properties中添加了mongodb配置:

############################
# MongoDBStore properties  #
############################
gora.datastore.default=org.apache.gora.mongodb.store.MongoStore
gora.mongodb.override_hadoop_configuration=false
gora.mongodb.mapping.file=/gora-mongodb-mapping.xml
gora.mongodb.servers=localhost:27017
gora.mongodb.db=nutch

Added gora-mongodb-mapping.xml to conf directory from Nutch-2.3-SNAPSHOT. 从Nutch-2.3-SNAPSHOT将gora-mongodb-mapping.xml添加到conf目录中。

When I am trying to compile I get error: 当我尝试编译时出现错误:

Could not load definitions from resource org/sonar/ant/antlib.xml. It could not be found.

After which I get many compiler errors. 之后,我得到许多编译器错误。

When I try to configure and compile Nutch with MySQL every compiles and work perfectly. 当我尝试使用MySQL配置和编译Nutch时,每个编译器都能正常工作。

I am trying to compile on Debian. 我正在尝试在Debian上进行编译。

The error is being thrown because the sonar jar is not present in one of the classpaths (see build.xml, line 883 ) 由于声纳罐不在类路径之一中而引发错误(请参见build.xml,第883行

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
    <classpath path="${ant.library.dir}"/>
    <classpath path="${mysql.library.dir}"/>
</taskdef>

It looks like the warning can be safely ignored, because it's only required when running the "sonar" target. 看起来警告可以安全地忽略,因为只有在运行“声纳”目标时才需要警告。

One simple solution would be to move the taskdef within the "sonar" target. 一种简单的解决方案是将taskdef在“声纳”目标内移动。 That would avoid the error message. 这样可以避免出现错误信息。

I would suggest raising a JIRA issue to get this fixed. 我建议提出JIRA问题以解决此问题。

After correcting this error I got another ;-). 更正此错误后,我得到了另一个;-)。 After research I found what it is not possible to compile Nutch 2.2.1 with Gora 0.5 to use MongoDB (gora-mongodb rev=0.5). 经过研究,我发现无法使用Gora 0.5编译Nutch 2.2.1以使用MongoDB(gora-mongodb rev = 0.5)。

I have cloned Nutch 2.3 and successfully compiled it. 我已经克隆了Nutch 2.3并成功编译了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM