2017-04-24 16 views
0

以下は私のsbtファイルです。 IDEから実行しているとき、すべてのレコードが弾性検索でインデックスに登録されています。しかし、私がsbtアセンブリを実行し、クラスタを起動するためにfatjarを送信すると、それはエラー以下にスローされます。組み立てたお粥の問題点を教えてください。弾性検索クライアント:原因:java.lang.NoSuchMethodError:io.netty.buffer.CompositeByteBuf.addComponents

Caused by: java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf; 
    at org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:78) 
    at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:449) 
    at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:91) 
    at org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:976) 
    at org.elasticsearch.transport.TcpTransport.sendRequest(TcpTransport.java:958) 
    at org.elasticsearch.transport.TransportService.sendRequestInternal(TransportService.java:520) 
    at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:465) 

私のプロジェクトのためのSBTファイル

import sbt.Keys._ 

name := "compute-layer" 

version := "1.0" 

scalaVersion := "2.10.6" 

libraryDependencies += "org.apache.spark" % "spark-core_2.10" % "1.6.1" excludeAll(ExclusionRule(organization = "org.apache.logging")) 
libraryDependencies += "org.apache.spark" % "spark-streaming_2.10" % "1.6.1" excludeAll(ExclusionRule(organization = "org.apache.logging")) 
libraryDependencies += "org.apache.spark" % "spark-streaming-kafka_2.10" % "1.6.0" excludeAll(ExclusionRule(organization = "org.apache.logging")) 
libraryDependencies += "org.elasticsearch.client" % "transport" % "5.1.1" excludeAll(ExclusionRule(organization = "org.apache.logging")) 
libraryDependencies += "org.apache.logging.log4j" % "log4j-api" % "2.7" 
libraryDependencies += "org.apache.logging.log4j" % "log4j-core" % "2.7" 
libraryDependencies += "com.typesafe" % "config" % "1.2.1" 
libraryDependencies += "io.netty" % "netty-all" % "4.0.4.Final" 

resolvers ++= Seq("clojars" at "https://clojars.org/repo", 
    "conjars" at "http://conjars.org/repo", 
    "plugins" at "http://repo.spring.io/plugins-release", 
    "sonatype" at "http://oss.sonatype.org/content/groups/public/", 
    "Online Play Repository" at "http://repo.typesafe.com/typesafe/simple/maven-releases/" 
) 


assemblyMergeStrategy in assembly := { 
    case PathList("META-INF", xs @ _*) => MergeStrategy.discard 
    case x => MergeStrategy.first 
} 


//libraryDependencies += "org.apache.logging.log4j" % "log4j-core" % "2.6.2" 

答えて

2

私は次のように、同様の問題を解決:

 <dependency> 
     <groupId>org.apache.hbase</groupId> 
     <artifactId>hbase-client</artifactId> 
     <version>1.3.0</version> 
     <exclusions> 
      <exclusion> 
       <groupId>io.netty</groupId> 
       <artifactId>netty-all</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency>