Six Stars

Spark Streaming: Exception in tRestWebServiceOutput

I'm trying to send a simple string to a web service using an HTTP POST in tRestWebServiceOutput. All I get is the following exception:

 

[ERROR]: org.apache.spark.executor.Executor - Exception in task 3.0 in stage 0.0 (TID 3)
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jersey.core.header.MediaTypes
	at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:182)
	at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
	at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
	at com.sun.jersey.api.client.Client.init(Client.java:342)
	at com.sun.jersey.api.client.Client.access$000(Client.java:118)
	at com.sun.jersey.api.client.Client$1.f(Client.java:191)
	at com.sun.jersey.api.client.Client$1.f(Client.java:187)
	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
	at com.sun.jersey.api.client.Client.<init>(Client.java:187)
	at com.sun.jersey.api.client.Client.<init>(Client.java:170)
	at com.sun.jersey.api.client.Client.create(Client.java:679)
	at talend_proj.readmessage_tkafkainputavro_0_1.ReadMessage_tKafkaInputAvro$tRestWebServiceOutput_1_OutputFunction.call(ReadMessage_tKafkaInputAvro.java:473)
	at talend_proj.readmessage_tkafkainputavro_0_1.ReadMessage_tKafkaInputAvro$tRestWebServiceOutput_1_OutputFunction.call(ReadMessage_tKafkaInputAvro.java:1)
	at org.apache.spark.api.java.JavaRDDLike$$anonfun$foreachPartition$1.apply(JavaRDDLike.scala:218)
	at org.apache.spark.api.java.JavaRDDLike$$anonfun$foreachPartition$1.apply(JavaRDDLike.scala:218)
	at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$28.apply(RDD.scala:883)
	at org.apache.spark.rdd.RDD$$anonfun$foreachPartition$1$$anonfun$apply$28.apply(RDD.scala:883)
	at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1897)
	at org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1897)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
	at org.apache.spark.scheduler.Task.run(Task.scala:85)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
2 REPLIES
Moderator

Re: Spark Streaming: Exception in tRestWebServiceOutput

Hello,

It looks like a dependency issue. Could you please let us know on which talend build version you got this issue?

Best regars

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Spark Streaming: Exception in tRestWebServiceOutput

Sure it's:

Version: 6.4.1
Build id: 20170623_1246