GitHub user tdas opened a pull request:
https://github.com/apache/spark/pull/1797
[SPARK-1022][Streaming][HOTFIX] Fixed zookeeper dependency of Kafka
https://github.com/apache/spark/pull/1751 caused maven builds to fail.
```
~/Apache/spark(branch-1.1|â) ⤠mvn -U -DskipTests clean install
.
.
.
[error]
Apache/spark/external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaStreamSuite.scala:36:
object NIOServerCnxnFactory is not a member of package
org.apache.zookeeper.server
[error] import org.apache.zookeeper.server.NIOServerCnxnFactory
[error] ^
[error]
Apache/spark/external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaStreamSuite.scala:199:
not found: type NIOServerCnxnFactory
[error] val factory = new NIOServerCnxnFactory()
[error] ^
[error] two errors found
[error] Compile failed at Aug 5, 2014 1:42:36 PM [0.503s]
```
The problem is how SBT and Maven resolves multiple versions of the same
library, which in this case, is Zookeeper. Observing and comparing the
dependency trees from Maven and SBT showed this. Spark depends on ZK 3.4.5
whereas Apache Kafka transitively depends on upon ZK 3.3.4. SBT decides to
evict 3.3.4 and use the higher version 3.4.5. But Maven decides to stick to the
closest (in the tree) dependent version of 3.3.4. And 3.3.4 does not have
NIOServerCnxnFactory.
The solution in this patch excludes zookeeper from the apache-kafka
dependency in streaming-kafka module so that it just inherits zookeeper from
Spark core.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tdas/spark kafka-zk-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/1797.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1797
----
commit 94b39319a9c75d23e09849eb6f23e3becdb1427a
Author: Tathagata Das <[email protected]>
Date: 2014-08-06T01:29:41Z
Fixed zookeeper dependency of Kafka
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]