메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


1. assembly에 전체 jar를 포함하지 않도록 하는 경우

가. 메세지 내용

[error] deduplicate: different file contents found in the following:

[error] 

C:Usersgooper.ivy2cacheorg.springframeworkspring-webjarsspring-web-4.0.5.RELEASE.jar:org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.class

[error] C:Usersgooper.ivy2cacheorg.springframeworkspring-webmvcjarsspring-webmvc-2.5.4.jar:org/springframework/web/multipart/support/DefaultMultipartHttpServletRequest.class


나. 조치사항

libraryDependencies에서 "provided"를 지정해서 assembly에 포함되지 않도록 함


"org.springframework" % "spring-web" % "4.0.5.RELEASE" % "provided" ,

"org.springframework" % "spring-webmvc" % "4.0.5.RELEASE" % "provided",


2. provided를 지정해서 assembly에서 제외할 수는 없고 일부 jar파일만 제외해야 하는 상황

가. 메세지 내용

java.lang.RuntimeException: deduplicate: different file contents found in the following:

C:Usersgooper.ivy2cachestaxstax-apijarsstax-api-1.0.1.jar:javax/xml/XMLConstants.class

C:Usersgooper.ivy2cachexml-apisxml-apisjarsxml-apis-1.4.01.jar:javax/xml/XMLConstants.class

deduplicate: different file contents found in the following:

C:Usersgooper.ivy2cachestaxstax-apijarsstax-api-1.0.1.jar:javax/xml/namespace/NamespaceContext.class

C:Usersgooper.ivy2cachexml-apisxml-apisjarsxml-apis-1.4.01.jar:javax/xml/namespace/NamespaceContext.class

deduplicate: different file contents found in the following:

C:Usersgooper.ivy2cachestaxstax-apijarsstax-api-1.0.1.jar:javax/xml/namespace/QName.class

C:Usersgooper.ivy2cachexml-apisxml-apisjarsxml-apis-1.4.01.jar:javax/xml/namespace/QName.class

....

나. 조치사항

: 포함되는 jar를 찾아서 exclude를 지정한다.

libraryDependencies에서 ("org.apache.jena" % "jena-core" % "3.1.0").exclude("stax", "stax-apis").exclude("xml-apis", "xml-apis")를 지정해준다.


*참고 : https://mvnrepository.com에서 "stax-api"를 검색하며 해당 jar의 groupId와 artifactId를 확인해서 

exclude(groupId, artifactId)를 지정해주면된다.

*어떤 jar가 문제되는 jar를 포함하고 있는지 확인하기가 힘든데.. provided로 지정되지 않은 jar에 exclude를 지정해서 "sbt assembly"를 

수행해서 정상적으로 assembly되는 케이스를 반복해서 찾아야함.



번호 제목 날짜 조회 수
261 servlet-api를 jar형태로 build할때 포함하지 말고 java 설치 위치의 jre/lib/ext에 복사하여 사용하는것이 좋다. 2016.08.10 538
260 [Elephas] Jena Elephas를 이용하여 Spark에서 rdfTriples의 RDD를 만들고 RDD관련 작업하는 샘플소스 2016.08.10 203
259 로컬의 라이브러리파일들을 dependency에 포함시키는 방법 2016.08.09 320
258 gradle을 이용하여 jar파일 생성시 provided속성을 지정할 수 있게 설정하는 방법 2016.08.09 359
» [SBT] assembly시 "[error] deduplicate: different file contents found in the following:"오류 발생시 조치사항 2016.08.04 736
256 [SBT] SBT 사용법 정리(링크) 2016.08.04 959
255 [SBT] project.sbt에 libraryDependencies에 필요한 jar를 지정했으나 sbt compile할때 클래스를 못찾는 오류가 발생했을때 조치사항 2016.08.03 159
254 build할때 unmappable character for encoding MS949 에러 발생시 조치사항 2016.08.03 417
253 kafkaWordCount.scala의 producer와 consumer 클래스를 이용하여 kafka를 이용한 word count 테스트 하기 2016.08.02 275
252 bin/start-hbase.sh실행시 org.apache.hadoop.hbase.util.FileSystemVersionException: HBase file layout needs to be upgraded오류가 발생하면 조치사항 2016.08.01 427
251 start-all.sh로 spark데몬 기동시 "JAVA_HOME is not set"오류 발생시 조치사항 2016.08.01 317
250 hadoop클러스터를 구성하던 서버중 HA를 담당하는 서버의 hostname등이 변경되어 문제가 발생했을때 조치사항 2016.07.29 408
249 Journal Storage Directory /data/hadoop/journal/data/mycluster not formatted 오류시 조치사항 2016.07.29 1603
248 슬라이딩 윈도우 예제 2016.07.28 189
247 거침없이 배우는 Drools 책의 샘플소스 file 2016.07.22 1369
246 drools를 이용한 로그,rule matching등의 테스트 java프로그램 file 2016.07.21 237
245 ServerInfo객체파일 2016.07.21 150
244 drools에서 drl관련 로그를 기록하기 위한 클래스 파일 2016.07.21 386
243 워킹 메모리에 대한 정보를 처리하는 클래스 파일 2016.07.21 425
242 커리 변경 이벤트를 처리하기 위한 구현클래스 2016.07.21 586
위로