[ 
https://issues.apache.org/jira/browse/CAMEL-10087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15348190#comment-15348190
 ] 

Jay mann edited comment on CAMEL-10087 at 6/24/16 12:18 PM:
------------------------------------------------------------

Unfortunately, Latest code does not work, you can view the Kafka change i'm 
trying to work around here.  

https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L652

You can see that if the Thead classloader is not null, it will use it, and 
since bundles run in different threads it won't be able to find the 
ProducerConfig and you will get an error like this:

Exception in thread "pool-136-thread-1" java.lang.NoClassDefFoundError: Could 
not initialize class org.apache.kafka.clients.producer.ProducerConfig
at 
org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:194)

To reproduce just create a kafka producer in Karaf, it will fail on bundle 
startup.



was (Author: jmandawg):
Unfortunately, Latest code does not work, you can view the Kafka change i'm 
trying to work around here.  

https://github.com/omkreddy/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L652

You can see that if the Thead classloader is not null, it will use it, and 
since bundles run in different threads it won't be able to find the 
ProducerConfig and you will get an error like this:

Exception in thread "pool-136-thread-1" java.lang.NoClassDefFoundError: Could 
not initialize class org.apache.kafka.clients.producer.ProducerConfig
at 
org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:194)

To reproduce just create a kafka producer in Karaf, it will fail on bundle 
startup.


> camel-kafka does not work in OSGI container
> -------------------------------------------
>
>                 Key: CAMEL-10087
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10087
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-kafka
>    Affects Versions: 2.17.1
>            Reporter: Jay mann
>
> Currently this component is broken in OSGI environment due to this:
> https://issues.apache.org/jira/browse/KAFKA-3218
> We can leave it broken until they get their bugs worked out.  Or i can submit 
> a PR with an intermediate fix that should work, as described in the jira 
> noted above.
> https://github.com/apache/camel/pull/1049



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to