Spark Jersey dependency 충돌
이슈 : 2020-03-23 16:21:03.349 [SparkUI-28] WARN o.s.jetty.servlet.ServletHandler - Error for /api/v1/applications
java.lang.NoSuchFieldError: INCLUDE_ALL
Jersey 라이브러리와 충돌이 나서 발생했던것
2020-03-23 16:21:03.349 [SparkUI-28] WARN o.s.jetty.servlet.ServletHandler - Error for /api/v1/applications
java.lang.NoSuchFieldError: INCLUDE_ALL
at org.glassfish.jersey.server.ResourceConfig$State.<init>(ResourceConfig.java:114)
at org.glassfish.jersey.server.ResourceConfig.<init>(ResourceConfig.java:356)
at org.glassfish.jersey.servlet.WebComponent.createResourceConfig(WebComponent.java:578)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:356)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.spark_project.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:643)
at org.spark_project.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:499)
at org.spark_project.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:791)
at org.spark_project.jetty.servlet.ServletHolder.prepare(ServletHolder.java:776)
at org.spark_project.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:580)
at org.spark_project.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.spark_project.jetty.servlet.ServletHandler.doScope(ServletHandler.java:513)
at org.spark_project.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.spark_project.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.spark_project.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:493)
at org.spark_project.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.spark_project.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.spark_project.jetty.server.Server.handle(Server.java:539)
at org.spark_project.jetty.server.HttpChannel.handle(HttpChannel.java:333)
at org.spark_project.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.spark_project.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
at org.spark_project.jetty.io.FillInterest.fillable(FillInterest.java:108)
at org.spark_project.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.spark_project.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.spark_project.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.spark_project.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
해결 방법
기존의 build.gradle에 Jetty를 별도로추가해서 충돌이 일어나 발생하는것 같다.
예전 gradle.build
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'org.apache.spark:spark-core_2.11:2.4.5'
implementation 'org.apache.spark:spark-sql_2.11:2.4.5'
implementation 'org.apache.spark:spark-hive_2.11:2.4.5'
implementation 'org.codehaus.janino:janino:3.0.8'
implementation 'org.slf4j:integration:1.7.29'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.postgresql:postgresql:42.2.10.jre7'
//요부분 jersey
implementation 'org.glassfish.jersey.inject:jersey-hk2:2.30'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
}
해결한 gradle.build
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'org.apache.spark:spark-core_2.11:2.4.5'
implementation 'org.apache.spark:spark-sql_2.11:2.4.5'
implementation 'org.apache.spark:spark-hive_2.11:2.4.5'
implementation 'org.codehaus.janino:janino:3.0.8'
implementation 'org.slf4j:integration:1.7.29'
implementation 'ch.qos.logback:logback-classic:1.2.3'
compile 'org.postgresql:postgresql:42.2.10.jre7'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
}
'BackEnd > Spark' 카테고리의 다른 글
[Spark] org.apache.spark.SparkException: Unable to create database default as failed to create its directory ... (0) | 2020.03.30 |
---|---|
SparkSQL JDBC 사용해서 데이터 불러오기 (0) | 2020.03.29 |
log 로 살펴본 Spark 동작 과정 알아보기 프로젝트 (0) | 2020.03.23 |
[Spark]Spark에서 서버의 메모리보다 더 큰 데이터를 불러와서 작업을 할수 있는데 어떻게 할까 ? (0) | 2020.03.22 |
[Spark]Apache Spark 란? 특징 , 왜 쓸까? (0) | 2020.03.22 |