[resolved] Execution Failed: JVM Compatibility

One Star

[resolved] Execution Failed: JVM Compatibility

I'm trying to send messages to a Kafka topic but I get the following error: 
Execution failed : Job compile errors 
At least job "OnBoardingDemoJob" has a compile errors, please fix and export again.
Error Line: 1788
Detail Message: The constructor ProducerRecord<byte[],byte[]>(String, String) is undefined
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.

I've checked and everywhere it seems that I correctly use JDK 1.8 (Installed JREs; Compiler and Talend Java Interpreter).
My job is as follows:




When I look at the code, the error on line 1788 the code is
tKafkaOutput_1_kafkaProducer.send(
   new org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>("code", row5.code)
);

There is an error indicating that "The constructor ProducerRecord<byte[],byte[]>(String, String) is undefined". And when I open the class ProducerRecord it seems that this class was compiled for java 1.7 ("Compiled from ProducerRecord.java (version 1.7 : 51.0, super bit)").

Is it a Maven configuration issue or am I missing a configuration somewhere ?

Accepted Solutions
One Star

Re: [resolved] Execution Failed: JVM Compatibility

Sorry, the problem was that the output of the ExcelInputFile ("row5.code") was a string and kafka needs byte[].
I changed the type of row5.code to byte[] and it works !
Thank you,
- Etienne

All Replies
Moderator

Re: [resolved] Execution Failed: JVM Compatibility

Hi,
Could you please indicate on which talend build version you are using? Does this JVM compatibility issue repro on all your jobs or a specific job(send messages to a Kafka topic)?
Best regards
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.
One Star

Re: [resolved] Execution Failed: JVM Compatibility

Sorry, the problem was that the output of the ExcelInputFile ("row5.code") was a string and kafka needs byte[].
I changed the type of row5.code to byte[] and it works !
Thank you,
- Etienne
Moderator

Re: [resolved] Execution Failed: JVM Compatibility

Hi,
Great this issue has been fixed. Could you please mark this topic as resolved?
Best regards
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.