0

I've installed WSO2 Integration Studio version 6.5.0 in my Windows workstation and created a project using the Kafka Consumer and Producer built-in template.

Then I configured the project with my own Kafka server settings (topic name "myTopic").

I then right-clicked the composite application and chose Export Project Artifacts and Run.

The Console window displayed at the very top the following messages:

[2019-06-25 09:23:45,499] [micro-integrator]  INFO - LibraryArtifactDeployer Synapse Library named '{org.wso2.carbon.connector}kafkaTransport' has been deployed from file : C:\IntegrationStudio\runtime\microesb\tmp\carbonapps\-1234\1561465425230TestCompositeApplication_1.0.0.car\kafkaTransport-connector_2.0.6\kafkaTransport-connector-2.0.6.zip
[2019-06-25 09:23:45,517] [micro-integrator]  INFO - SynapseImportFactory Successfully created Synapse Import: kafkaTransport
[2019-06-25 09:23:45,533] [micro-integrator] ERROR - ClassMediatorFactory 
Error in instantiating class : 
org.wso2.carbon.connector.KafkaProduceConnector
java.lang.NoClassDefFoundError: org/apache/kafka/common/header/Headers
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)

[snipped rest for clarity]

I've tried uninstalling Integrator Studio and running it with elevated right to no avail.

I expected the project to be deployed normally.

EDIT: after copying:

  • kafka_2.11-2.2.1.jar
  • metrics-core-2.2.0.jar
  • zkclient-0.11.jar
  • kafka-clients-2.2.1.jar
  • scala-library-2.11.12.jar
  • zookeeper-3.4.13.jar

to the EI_HOME/lib directory, the exception changed to:

org.apache.axis2.deployment.DeploymentException: kafka/consumer/ConsumerTimeoutException
    at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:219)
    at org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifactType(SynapseAppDeployer.java:1099)
    at org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifacts(SynapseAppDeployer.java:114)
    at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:272)
    at org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:72)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
    at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
    at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
[snipped for clarity]

Caused by: org.apache.axis2.deployment.DeploymentException: kafka/consumer/ConsumerTimeoutException
    at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:207)
    ... 87 more
Caused by: java.lang.NoClassDefFoundError: kafka/consumer/ConsumerTimeoutException
    at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAPollingConsumer.startsMessageListener(KAFKAPollingConsumer.java:90)
    at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAProcessor.init(KAFKAProcessor.java:96)
    at org.apache.synapse.inbound.InboundEndpoint.init(InboundEndpoint.java:79)
    at org.apache.synapse.deployers.InboundEndpointDeployer.deploySynapseArtifact(InboundEndpointDeployer.java:57)
    at org.apache.synapse.deployers.AbstractSynapseArtifactDeployer.deploy(AbstractSynapseArtifactDeployer.java:197)
    ... 87 more
Caused by: java.lang.ClassNotFoundException: kafka.consumer.ConsumerTimeoutException cannot be found by synapse-core_2.1.7.wso2v111
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:475)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 92 more

3 Answers 3

1

Have you copied the required jars from kafka_home/libs folder to EI_home/lib, if yes then share your code to get the issue detail

2
  • Hello, thank you for your answer. I've copied the required jar files to EI_HOME/lib, and the exception changed a little bit. Now it says: java.lang.ClassNotFoundException: kafka.consumer.ConsumerTimeoutException cannot be found by synapse-core_2.1.7.wso2v111. Commented Jun 26, 2019 at 17:15
  • 1
    use kafka 2.12 and it will work that version worked for me as well,, going forward 2.11 is not compatible you can check the available compabilities here
    – Rider
    Commented Jun 27, 2019 at 11:41
1

According to this documentation https://docs.wso2.com/display/EI650/Kafka+Inbound+Protocol, the recommended versions for Kafka is kafka_2.9.2-0.8.1.1. You can download it in the below link. http://kafka.apache.org/downloads.html. Please use those jars and copy them to the EI_HOME/lib. There is an github issue for this as well. https://github.com/wso2/product-ei/issues/2239

15
  • I too tried same kafka built in sample i am also facing the same issue. Please help me to proceed further. I followed the documentation Steps only. My kafka version 2.9.2-0.8.1.1 copied all needed jars into <EI_Home>\lib
    – Sumathi
    Commented Feb 21, 2020 at 10:37
  • Can you try out this custom inbound endpoint github.com/wso2-extensions/esb-inbound-kafka/blob/master/docs/…
    – Arunan
    Commented Feb 21, 2020 at 11:08
  • I have tried that sample with EI 6.5 & EI 6.6. In both instances I am facing following issue org.apache.synapse.SynapseException: Inbound Endpoint name cannot be null
    – Sumathi
    Commented Feb 21, 2020 at 11:54
  • This error comes up when the name attribute is not present in the inbound endpoint configuration. Can you recheck?
    – Arunan
    Commented Feb 21, 2020 at 17:34
  • hi,now i am trying same kafka inbound endpoint with micro integrator 1.1.0 in integration studio but error only coming.I have followed the mentioned step [ei.docs.wso2.com/en/latest/micro-integrator/use-cases/examples/… only
    – Sumathi
    Commented Mar 2, 2020 at 11:03
0

I may be a bit too late but we have been using Custom inbound endpoint for Kafka. We also faced exactly same issue and that was the only way to fix it. You could use https://github.com/wso2-extensions/esb-inbound-kafka/blob/master/docs/config.md to configure it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.