You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nicola Cisternino <nc...@gmail.com> on 2021/05/17 16:42:10 UTC

Apacke Karaf, Camel and Kafka component

Hi all
I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:

cat > deploy/example.xml <<END
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="kafka">
        <route id="kafka">
            <from uri="mina:tcp://0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
            <to uri="kafka:users?brokers=192.168.1.231:9092"/>
        </route>
    </camelContext>
</blueprint>
END

Using Camel 3.5.0 all works fine (from gogo shell):
feature:install http webconsole         
feature:repo-add camel 3.5.0
feature:install camel camel-netty camel-kafka

Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same features:
feature:install http webconsole
feature:repo-add camel 3.7.3
feature:install camel camel-netty camel-kafka

.. the following error occurs:

16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId: 62abe01bee039651
16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs: 1621269219663
16:33:39.665 ERROR [kafka-producer-network-thread | producer-2] Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
java.lang.NoClassDefFoundError: Could not initialize class org.apache.kafka.common.requests.ApiVersionsRequest$Builder
	at org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910) ~[!/:?]
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) ~[!/:?]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) ~[!/:?]
	at java.lang.Thread.run(Unknown Source) [?:?]

Any idea ?





Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
Errata corrige (route):
cat > deploy/example.xml <<END
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="kafka">
        <route id="kafka">
	    <from uri="netty:tcp://0.0.0.0:9999"/>
            <to uri="kafka:users?brokers=192.168.1.231:9092"/>
        </route>
    </camelContext>
</blueprint>
END


On 2021/05/17 16:42:10, Nicola Cisternino <nc...@gmail.com> wrote: 
> Hi all
> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
> 
> cat > deploy/example.xml <<END
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="kafka">
>         <route id="kafka">
>             <from uri="mina:tcp://0.0.0.0:8888?decoderMaxLineLength=8192&textline=true&sync=false"/>
>             <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>         </route>
>     </camelContext>
> </blueprint>
> END
> 
> Using Camel 3.5.0 all works fine (from gogo shell):
> feature:install http webconsole         
> feature:repo-add camel 3.5.0
> feature:install camel camel-netty camel-kafka
> 
> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same features:
> feature:install http webconsole
> feature:repo-add camel 3.7.3
> feature:install camel camel-netty camel-kafka
> 
> .. the following error occurs:
> 
> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId: 62abe01bee039651
> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs: 1621269219663
> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2] Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.kafka.common.requests.ApiVersionsRequest$Builder
> 	at org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910) ~[!/:?]
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
> 	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) ~[!/:?]
> 	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) ~[!/:?]
> 	at java.lang.Thread.run(Unknown Source) [?:?]
> 
> Any idea ?
> 
> 
> 
> 
> 

Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
Hi Andrea

I've downgraded Apache Karaf to 4.3.1 (image from dockerhub: 
apache/karaf:4.3.1) and applied 3.9.0 Camel features:
feature:install http webconsole
feature:repo-add camel 3.9.0
feature:install camel camel-netty camel-kafka

All works fine (camel route correctly messages to kafka)
Now, trying to install camel-sql with:
feature:install camel-sql

The error is:

karaf@root()> feature:install camel-sql
21:52:47.505 INFO  [pipe-feature:install camel-sql] Adding features: 
camel-sql/[3.9.0,3.9.0]
21:52:47.604 ERROR [Karaf ssh console user karaf] Exception caught while 
executing command
org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
root: missing requirement [root] osgi.identity; 
osgi.identity=webconsole; type=karaf.feature; version="[4.3.1,4.3.1]"; 
filter:="(&(osgi.identity=webconsole)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" 
[caused by: Unable to resolve webconsole/4.3.1: missing requirement 
[webconsole/4.3.1] osgi.identity; 
osgi.identity=org.apache.felix.metatype; type=osgi.bundle; 
version="[1.2.4,1.2.4]"; resolution:=mandatory [caused by: Unable to 
resolve org.apache.felix.metatype/1.2.4: missing requirement 
[org.apache.felix.metatype/1.2.4] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))"]]
     at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
     at 
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
     at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
     at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
     at 
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
     at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
     at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
     at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
     at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
     at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
     at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
     at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
resolve webconsole/4.3.1: missing requirement [webconsole/4.3.1] 
osgi.identity; osgi.identity=org.apache.felix.metatype; 
type=osgi.bundle; version="[1.2.4,1.2.4]"; resolution:=mandatory [caused 
by: Unable to resolve org.apache.felix.metatype/1.2.4: missing 
requirement [org.apache.felix.metatype/1.2.4] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))"]
     at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
     ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
resolve org.apache.felix.metatype/1.2.4: missing requirement 
[org.apache.felix.metatype/1.2.4] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))"
     at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
     ... 13 more
Error executing command: Unable to resolve root: missing requirement 
[root] osgi.identity; osgi.identity=webconsole; type=karaf.feature; 
version="[4.3.1,4.3.1]"; 
filter:="(&(osgi.identity=webconsole)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" 
[caused by: Unable to resolve webconsole/4.3.1: missing requirement 
[webconsole/4.3.1] osgi.identity; 
osgi.identity=org.apache.felix.metatype; type=osgi.bundle; 
version="[1.2.4,1.2.4]"; resolution:=mandatory [caused by: Unable to 
resolve org.apache.felix.metatype/1.2.4: missing requirement 
[org.apache.felix.metatype/1.2.4] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))"]]




On 5/17/21 10:21 PM, Andrea Cosentino wrote:
> 3.9.0 has been tested only with 4.3.1
>
> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
> scritto:
>
>> Thank you JB
>>
>> I've tried to update all to last versions.
>>
>> So I've installed:
>> - Apache Karaf *4.3.2*
>> - Camel *3.9.0* features
>>
>> In features terms:
>> *feature:install http webconsole**
>> **feature:repo-add camel 3.9.0**
>> **feature:install camel camel-netty camel-kafka**
>> *
>> ... and all works fine ;-)
>> ... but ... trying to install some other camel feature (for example
>> camel-sql or camel-stream) occurs the following error:
>>
>> karaf@root()> *feature:install camel-sql*
>> Error executing command: Unable to resolve root: missing requirement
>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>> version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>> karaf@root()>
>>
>> In the log:
>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>> 4.3.2 | Exception caught while executing command
>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>> type=karaf.feature; version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>
>> ~[?:?]
>>           at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>> Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source) ~[?:?]
>>           at java.lang.Thread.run(Unknown Source) [?:?]
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>>
>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>
>>
>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>> Hi,
>>>
>>> The error seems related to Kafka bundle.
>>>
>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>
>>> Regards
>>> JB
>>>
>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>> écrit :
>>>> Hi all
>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>
>>>> cat > deploy/example.xml <<END
>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>> id="kafka">
>>>>          <route id="kafka">
>>>>              <from uri="mina:tcp://
>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>              <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>          </route>
>>>>      </camelContext>
>>>> </blueprint>
>>>> END
>>>>
>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.5.0
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>> features:
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.7.3
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> .. the following error occurs:
>>>>
>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>> 62abe01bee039651
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>> 1621269219663
>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>       at
>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>> ~[!/:?]
>>>>       at java.lang.Thread.run(Unknown Source) [?:?]
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>>
>>


Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
After some (many) tests using Karaf 4.3.1 and Camel 3.9.0 features, I've 
realized that all features installed **AFTER** camel-kafka fails
The same camel features (camel-sql, camel-stream, camel-dropbox, etc 
....), if installed **BEFORE** camel-kafka raise no errors ....

On 5/17/21 10:21 PM, Andrea Cosentino wrote:
> 3.9.0 has been tested only with 4.3.1
>
> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
> scritto:
>
>> Thank you JB
>>
>> I've tried to update all to last versions.
>>
>> So I've installed:
>> - Apache Karaf *4.3.2*
>> - Camel *3.9.0* features
>>
>> In features terms:
>> *feature:install http webconsole**
>> **feature:repo-add camel 3.9.0**
>> **feature:install camel camel-netty camel-kafka**
>> *
>> ... and all works fine ;-)
>> ... but ... trying to install some other camel feature (for example
>> camel-sql or camel-stream) occurs the following error:
>>
>> karaf@root()> *feature:install camel-sql*
>> Error executing command: Unable to resolve root: missing requirement
>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>> version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>> karaf@root()>
>>
>> In the log:
>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>> 4.3.2 | Exception caught while executing command
>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>> type=karaf.feature; version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>
>> ~[?:?]
>>           at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>> Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source) ~[?:?]
>>           at java.lang.Thread.run(Unknown Source) [?:?]
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>>
>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>
>>
>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>> Hi,
>>>
>>> The error seems related to Kafka bundle.
>>>
>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>
>>> Regards
>>> JB
>>>
>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>> écrit :
>>>> Hi all
>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>
>>>> cat > deploy/example.xml <<END
>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>> id="kafka">
>>>>          <route id="kafka">
>>>>              <from uri="mina:tcp://
>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>              <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>          </route>
>>>>      </camelContext>
>>>> </blueprint>
>>>> END
>>>>
>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.5.0
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>> features:
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.7.3
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> .. the following error occurs:
>>>>
>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>> 62abe01bee039651
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>> 1621269219663
>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>       at
>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>> ~[!/:?]
>>>>       at java.lang.Thread.run(Unknown Source) [?:?]
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>>
>>


Re: Apacke Karaf, Camel and Kafka component

Posted by Andrea Cosentino <an...@gmail.com>.
Please open an issue about this.

Il mar 18 mag 2021, 01:08 Nicola Cisternino <nc...@gmail.com> ha
scritto:

> Other tests ...
> The problem is generated by "snappy" feature required by camel-kafka
> feature (see at:
>
> https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.9.0/apache-camel-3.9.0-features.xml
> )
> The sequence to reproduce the problem, starting from a fresh 4.3.1 Karaf
> installation, is:
>
>          __ __                  ____
>         / //_/____ __________ _/ __/
>        / ,<  / __ `/ ___/ __ `/ /_
>       / /| |/ /_/ / /  / /_/ / __/
>      /_/ |_|\__,_/_/   \__,_/_/
>
>    Apache Karaf (4.3.1)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit 'system:shutdown' to shutdown Karaf.
> Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.
>
> karaf@root()> feature:repo-add camel 3.9.0
> Adding feature url
> mvn:org.apache.camel.karaf/apache-camel/3.9.0/xml/features
> karaf@root()> feature:install http webconsole camel camel-netty
> karaf@root()> feature:install camel-stream
> karaf@root()> feature:install snappy
> karaf@root()> feature:install camel-sql
> Error executing command: Unable to resolve root: missing requirement
> [root] osgi.identity; osgi.identity=kar; type=karaf.feature;
> version="[4.3.1,4.3.1]";
> filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))"
>
> [caused by: Unable to resolve kar/4.3.1: missing requirement [kar/4.3.1]
> osgi.identity; osgi.identity=org.apache.karaf.kar.core;
> type=osgi.bundle; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused
> by: Unable to resolve org.apache.karaf.kar.core/4.3.1: missing
> requirement [org.apache.karaf.kar.core/4.3.1] osgi.wiring.package;
>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
> karaf@root()>
>
>
> On 5/17/21 10:21 PM, Andrea Cosentino wrote:
> > 3.9.0 has been tested only with 4.3.1
> >
> > Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
> > scritto:
> >
> >> Thank you JB
> >>
> >> I've tried to update all to last versions.
> >>
> >> So I've installed:
> >> - Apache Karaf *4.3.2*
> >> - Camel *3.9.0* features
> >>
> >> In features terms:
> >> *feature:install http webconsole**
> >> **feature:repo-add camel 3.9.0**
> >> **feature:install camel camel-netty camel-kafka**
> >> *
> >> ... and all works fine ;-)
> >> ... but ... trying to install some other camel feature (for example
> >> camel-sql or camel-stream) occurs the following error:
> >>
> >> karaf@root()> *feature:install camel-sql*
> >> Error executing command: Unable to resolve root: missing requirement
> >> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
> >> version="[4.3.2,4.3.2]";
> >>
> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
> >>
> >> [caused by: Unable to resolve shell/4.3.2: missing requirement
> >> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
> >> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
> >> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
> >> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
> >>
> >>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
> >> karaf@root()>
> >>
> >> In the log:
> >> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
> >> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
> >> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
> >> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
> >> ShellUtil                        | 43 - org.apache.karaf.shell.core -
> >> 4.3.2 | Exception caught while executing command
> >> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
> >> root: missing requirement [root] osgi.identity; osgi.identity=shell;
> >> type=karaf.feature; version="[4.3.2,4.3.2]";
> >>
> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
> >>
> >> [caused by: Unable to resolve shell/4.3.2: missing requirement
> >> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
> >> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
> >> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
> >> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
> >>
> >>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
> >>           at
> >>
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
> >>
> >> ~[?:?]
> >>           at
> >> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
> >> ~[?:?]
> >>           at
> >> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
> >> ~[?:?]
> >>           at
> >> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
> >> ~[?:?]
> >>           at
> >>
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
> >>
> >> ~[?:?]
> >>           at
> >>
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
> >>
> >> ~[?:?]
> >>           at
> >>
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
> >>
> >> ~[?:?]
> >>           at
> >>
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
> >>
> >> ~[?:?]
> >>           at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
> >>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> >> Source) ~[?:?]
> >>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> >> Source) ~[?:?]
> >>           at java.lang.Thread.run(Unknown Source) [?:?]
> >> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
> >> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
> >> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
> >> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
> >> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
> >> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
> >>
> >>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
> >>           at
> >>
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
> >>
> >> ~[?:?]
> >>           ... 12 more
> >> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
> >> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
> >> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
> >>
> >>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
> >>           at
> >>
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
> >>
> >> ~[?:?]
> >>           at
> >>
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
> >>
> >> ~[?:?]
> >>           ... 12 more
> >>
> >> The strange thing is that org.apache.karaf.shell.core bundle is running
> !!
> >>
> >>
> >> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
> >>> Hi,
> >>>
> >>> The error seems related to Kafka bundle.
> >>>
> >>> Can you check if Kafka bundle version is 2.6.0_2 ?
> >>>
> >>> Regards
> >>> JB
> >>>
> >>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
> >> écrit :
> >>>> Hi all
> >>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
> >>>>
> >>>> cat > deploy/example.xml <<END
> >>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> >>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint"
> >> id="kafka">
> >>>>          <route id="kafka">
> >>>>              <from uri="mina:tcp://
> >> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false
> "/>
> >>>>              <to uri="kafka:users?brokers=192.168.1.231:9092"/>
> >>>>          </route>
> >>>>      </camelContext>
> >>>> </blueprint>
> >>>> END
> >>>>
> >>>> Using Camel 3.5.0 all works fine (from gogo shell):
> >>>> feature:install http webconsole
> >>>> feature:repo-add camel 3.5.0
> >>>> feature:install camel camel-netty camel-kafka
> >>>>
> >>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
> >> features:
> >>>> feature:install http webconsole
> >>>> feature:repo-add camel 3.7.3
> >>>> feature:install camel camel-netty camel-kafka
> >>>>
> >>>> .. the following error occurs:
> >>>>
> >>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
> >>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
> >> 62abe01bee039651
> >>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
> >> 1621269219663
> >>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
> >> Uncaught exception in thread 'kafka-producer-network-thread |
> producer-2':
> >>>> java.lang.NoClassDefFoundError: Could not initialize class
> >> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
> >>>>       at
> >>
> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
> >> ~[!/:?]
> >>>>       at
> >> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555)
> ~[!/:?]
> >>>>       at
> >>
> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
> >> ~[!/:?]
> >>>>       at
> >> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
> >> ~[!/:?]
> >>>>       at java.lang.Thread.run(Unknown Source) [?:?]
> >>>>
> >>>> Any idea ?
> >>>>
> >>>>
> >>>>
> >>>>
> >>
>
>

Re: Apacke Karaf, Camel and Kafka component

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi Nico,

Thanks for the update, I’m suspecting the same cause (a refresh due to snappy feature).

Regards
JB

> Le 18 mai 2021 à 09:35, Nicola Cisternino <nc...@gmail.com> a écrit :
> 
> Hi JB,
> 
> The problem seems to be the snappy feature, not camel-sql.
> Any other feature installed after snappy (not only camel-sql...) raise errors mentioned above.
> In the morning I will create a Jira issue.
> 
> Thanks.
> NC
> 
> 
> On 5/18/21 7:50 AM, Jean-Baptiste Onofre wrote:
>> Hi,
>> 
>> That’s a refresh issue due to range in camel-sql feature.
>> 
>> Can you please create a Jira I will fix that ?
>> 
>> By the way, as mentioned on the dev mailing list, I’m working on karamel which is the next stage of camel-karaf with cleanup and better private package usage in components.
>> 
>> I will share details soon.
>> 
>> Regards
>> JB
>> 
>>> Le 18 mai 2021 à 01:05, Nicola Cisternino <nc...@gmail.com> a écrit :
>>> 
>>> Other tests ...
>>> The problem is generated by "snappy" feature required by camel-kafka feature (see at: https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.9.0/apache-camel-3.9.0-features.xml)
>>> The sequence to reproduce the problem, starting from a fresh 4.3.1 Karaf installation, is:
>>> 
>>>         __ __                  ____
>>>        / //_/____ __________ _/ __/
>>>       / ,<  / __ `/ ___/ __ `/ /_
>>>      / /| |/ /_/ / /  / /_/ / __/
>>>     /_/ |_|\__,_/_/   \__,_/_/
>>> 
>>>   Apache Karaf (4.3.1)
>>> 
>>> Hit '<tab>' for a list of available commands
>>> and '[cmd] --help' for help on a specific command.
>>> Hit 'system:shutdown' to shutdown Karaf.
>>> Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.
>>> 
>>> karaf@root()> feature:repo-add camel 3.9.0
>>> Adding feature url mvn:org.apache.camel.karaf/apache-camel/3.9.0/xml/features
>>> karaf@root()> feature:install http webconsole camel camel-netty
>>> karaf@root()> feature:install camel-stream
>>> karaf@root()> feature:install snappy
>>> karaf@root()> feature:install camel-sql
>>> Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=kar; type=karaf.feature; version="[4.3.1,4.3.1]"; filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" [caused by: Unable to resolve kar/4.3.1: missing requirement [kar/4.3.1] osgi.identity; osgi.identity=org.apache.karaf.kar.core; type=osgi.bundle; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.kar.core/4.3.1: missing requirement [org.apache.karaf.kar.core/4.3.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>> karaf@root()>
>>> 
>>> 
>>> On 5/17/21 10:21 PM, Andrea Cosentino wrote:
>>>> 3.9.0 has been tested only with 4.3.1
>>>> 
>>>> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
>>>> scritto:
>>>> 
>>>>> Thank you JB
>>>>> 
>>>>> I've tried to update all to last versions.
>>>>> 
>>>>> So I've installed:
>>>>> - Apache Karaf *4.3.2*
>>>>> - Camel *3.9.0* features
>>>>> 
>>>>> In features terms:
>>>>> *feature:install http webconsole**
>>>>> **feature:repo-add camel 3.9.0**
>>>>> **feature:install camel camel-netty camel-kafka**
>>>>> *
>>>>> ... and all works fine ;-)
>>>>> ... but ... trying to install some other camel feature (for example
>>>>> camel-sql or camel-stream) occurs the following error:
>>>>> 
>>>>> karaf@root()> *feature:install camel-sql*
>>>>> Error executing command: Unable to resolve root: missing requirement
>>>>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>>>>> version="[4.3.2,4.3.2]";
>>>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>>>> 
>>>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>> 
>>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>>>> karaf@root()>
>>>>> 
>>>>> In the log:
>>>>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>>>>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>>>>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>>>>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>>>>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>>>>> 4.3.2 | Exception caught while executing command
>>>>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>>>>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>>>>> type=karaf.feature; version="[4.3.2,4.3.2]";
>>>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>>>> 
>>>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>> 
>>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>>>>          at
>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>> 
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>>>> 
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>>>> 
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>>>> 
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>>>> 
>>>>> ~[?:?]
>>>>>          at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>>>>          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>>>>> Source) ~[?:?]
>>>>>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>>>>> Source) ~[?:?]
>>>>>          at java.lang.Thread.run(Unknown Source) [?:?]
>>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>>>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>>>>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>>>>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>>>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>> 
>>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>>>>          at
>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>> 
>>>>> ~[?:?]
>>>>>          ... 12 more
>>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>> 
>>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>>>>          at
>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>> 
>>>>> ~[?:?]
>>>>>          at
>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>> 
>>>>> ~[?:?]
>>>>>          ... 12 more
>>>>> 
>>>>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>>>> 
>>>>> 
>>>>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>>>>> Hi,
>>>>>> 
>>>>>> The error seems related to Kafka bundle.
>>>>>> 
>>>>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>>>> 
>>>>>> Regards
>>>>>> JB
>>>>>> 
>>>>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>>>>> écrit :
>>>>>>> Hi all
>>>>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>>>> 
>>>>>>> cat > deploy/example.xml <<END
>>>>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>>>>     <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>>>>> id="kafka">
>>>>>>>         <route id="kafka">
>>>>>>>             <from uri="mina:tcp://
>>>>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>>>>             <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>>>>         </route>
>>>>>>>     </camelContext>
>>>>>>> </blueprint>
>>>>>>> END
>>>>>>> 
>>>>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>>>>> feature:install http webconsole
>>>>>>> feature:repo-add camel 3.5.0
>>>>>>> feature:install camel camel-netty camel-kafka
>>>>>>> 
>>>>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>>>>> features:
>>>>>>> feature:install http webconsole
>>>>>>> feature:repo-add camel 3.7.3
>>>>>>> feature:install camel camel-netty camel-kafka
>>>>>>> 
>>>>>>> .. the following error occurs:
>>>>>>> 
>>>>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>>>>> 62abe01bee039651
>>>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>>>>> 1621269219663
>>>>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>>>>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>>>>      at
>>>>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>>>>> ~[!/:?]
>>>>>>>      at
>>>>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>>>>      at
>>>>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>>>>> ~[!/:?]
>>>>>>>      at
>>>>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>>>>> ~[!/:?]
>>>>>>>      at java.lang.Thread.run(Unknown Source) [?:?]
>>>>>>> 
>>>>>>> Any idea ?
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
> 


Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
Hi JB,

The problem seems to be the snappy feature, not camel-sql.
Any other feature installed after snappy (not only camel-sql...) raise 
errors mentioned above.
In the morning I will create a Jira issue.

Thanks.
NC


On 5/18/21 7:50 AM, Jean-Baptiste Onofre wrote:
> Hi,
>
> That’s a refresh issue due to range in camel-sql feature.
>
> Can you please create a Jira I will fix that ?
>
> By the way, as mentioned on the dev mailing list, I’m working on karamel which is the next stage of camel-karaf with cleanup and better private package usage in components.
>
> I will share details soon.
>
> Regards
> JB
>
>> Le 18 mai 2021 à 01:05, Nicola Cisternino <nc...@gmail.com> a écrit :
>>
>> Other tests ...
>> The problem is generated by "snappy" feature required by camel-kafka feature (see at: https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.9.0/apache-camel-3.9.0-features.xml)
>> The sequence to reproduce the problem, starting from a fresh 4.3.1 Karaf installation, is:
>>
>>          __ __                  ____
>>         / //_/____ __________ _/ __/
>>        / ,<  / __ `/ ___/ __ `/ /_
>>       / /| |/ /_/ / /  / /_/ / __/
>>      /_/ |_|\__,_/_/   \__,_/_/
>>
>>    Apache Karaf (4.3.1)
>>
>> Hit '<tab>' for a list of available commands
>> and '[cmd] --help' for help on a specific command.
>> Hit 'system:shutdown' to shutdown Karaf.
>> Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.
>>
>> karaf@root()> feature:repo-add camel 3.9.0
>> Adding feature url mvn:org.apache.camel.karaf/apache-camel/3.9.0/xml/features
>> karaf@root()> feature:install http webconsole camel camel-netty
>> karaf@root()> feature:install camel-stream
>> karaf@root()> feature:install snappy
>> karaf@root()> feature:install camel-sql
>> Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=kar; type=karaf.feature; version="[4.3.1,4.3.1]"; filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" [caused by: Unable to resolve kar/4.3.1: missing requirement [kar/4.3.1] osgi.identity; osgi.identity=org.apache.karaf.kar.core; type=osgi.bundle; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.kar.core/4.3.1: missing requirement [org.apache.karaf.kar.core/4.3.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>> karaf@root()>
>>
>>
>> On 5/17/21 10:21 PM, Andrea Cosentino wrote:
>>> 3.9.0 has been tested only with 4.3.1
>>>
>>> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
>>> scritto:
>>>
>>>> Thank you JB
>>>>
>>>> I've tried to update all to last versions.
>>>>
>>>> So I've installed:
>>>> - Apache Karaf *4.3.2*
>>>> - Camel *3.9.0* features
>>>>
>>>> In features terms:
>>>> *feature:install http webconsole**
>>>> **feature:repo-add camel 3.9.0**
>>>> **feature:install camel camel-netty camel-kafka**
>>>> *
>>>> ... and all works fine ;-)
>>>> ... but ... trying to install some other camel feature (for example
>>>> camel-sql or camel-stream) occurs the following error:
>>>>
>>>> karaf@root()> *feature:install camel-sql*
>>>> Error executing command: Unable to resolve root: missing requirement
>>>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>>>> version="[4.3.2,4.3.2]";
>>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>>>
>>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>
>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>>> karaf@root()>
>>>>
>>>> In the log:
>>>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>>>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>>>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>>>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>>>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>>>> 4.3.2 | Exception caught while executing command
>>>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>>>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>>>> type=karaf.feature; version="[4.3.2,4.3.2]";
>>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>>>
>>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>
>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>>>           at
>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>
>>>> ~[?:?]
>>>>           at
>>>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>>>> ~[?:?]
>>>>           at
>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>>> ~[?:?]
>>>>           at
>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>>> ~[?:?]
>>>>           at
>>>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>>>
>>>> ~[?:?]
>>>>           at
>>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>>>
>>>> ~[?:?]
>>>>           at
>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>>>
>>>> ~[?:?]
>>>>           at
>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>>>
>>>> ~[?:?]
>>>>           at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>>>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>>>> Source) ~[?:?]
>>>>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>>>> Source) ~[?:?]
>>>>           at java.lang.Thread.run(Unknown Source) [?:?]
>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>>>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>>>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>
>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>>>           at
>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>
>>>> ~[?:?]
>>>>           ... 12 more
>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>>>
>>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>>>           at
>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>
>>>> ~[?:?]
>>>>           at
>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>
>>>> ~[?:?]
>>>>           ... 12 more
>>>>
>>>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>>>
>>>>
>>>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>>>> Hi,
>>>>>
>>>>> The error seems related to Kafka bundle.
>>>>>
>>>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>>>> écrit :
>>>>>> Hi all
>>>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>>>
>>>>>> cat > deploy/example.xml <<END
>>>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>>>> id="kafka">
>>>>>>          <route id="kafka">
>>>>>>              <from uri="mina:tcp://
>>>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>>>              <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>>>          </route>
>>>>>>      </camelContext>
>>>>>> </blueprint>
>>>>>> END
>>>>>>
>>>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>>>> feature:install http webconsole
>>>>>> feature:repo-add camel 3.5.0
>>>>>> feature:install camel camel-netty camel-kafka
>>>>>>
>>>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>>>> features:
>>>>>> feature:install http webconsole
>>>>>> feature:repo-add camel 3.7.3
>>>>>> feature:install camel camel-netty camel-kafka
>>>>>>
>>>>>> .. the following error occurs:
>>>>>>
>>>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>>>> 62abe01bee039651
>>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>>>> 1621269219663
>>>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>>>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>>>       at
>>>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>>>> ~[!/:?]
>>>>>>       at
>>>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>>>       at
>>>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>>>> ~[!/:?]
>>>>>>       at
>>>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>>>> ~[!/:?]
>>>>>>       at java.lang.Thread.run(Unknown Source) [?:?]
>>>>>>
>>>>>> Any idea ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>


Re: Apacke Karaf, Camel and Kafka component

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

That’s a refresh issue due to range in camel-sql feature.

Can you please create a Jira I will fix that ?

By the way, as mentioned on the dev mailing list, I’m working on karamel which is the next stage of camel-karaf with cleanup and better private package usage in components.

I will share details soon.

Regards
JB

> Le 18 mai 2021 à 01:05, Nicola Cisternino <nc...@gmail.com> a écrit :
> 
> Other tests ...
> The problem is generated by "snappy" feature required by camel-kafka feature (see at: https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.9.0/apache-camel-3.9.0-features.xml)
> The sequence to reproduce the problem, starting from a fresh 4.3.1 Karaf installation, is:
> 
>         __ __                  ____
>        / //_/____ __________ _/ __/
>       / ,<  / __ `/ ___/ __ `/ /_
>      / /| |/ /_/ / /  / /_/ / __/
>     /_/ |_|\__,_/_/   \__,_/_/
> 
>   Apache Karaf (4.3.1)
> 
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit 'system:shutdown' to shutdown Karaf.
> Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.
> 
> karaf@root()> feature:repo-add camel 3.9.0
> Adding feature url mvn:org.apache.camel.karaf/apache-camel/3.9.0/xml/features
> karaf@root()> feature:install http webconsole camel camel-netty
> karaf@root()> feature:install camel-stream
> karaf@root()> feature:install snappy
> karaf@root()> feature:install camel-sql
> Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=kar; type=karaf.feature; version="[4.3.1,4.3.1]"; filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" [caused by: Unable to resolve kar/4.3.1: missing requirement [kar/4.3.1] osgi.identity; osgi.identity=org.apache.karaf.kar.core; type=osgi.bundle; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.kar.core/4.3.1: missing requirement [org.apache.karaf.kar.core/4.3.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
> karaf@root()>
> 
> 
> On 5/17/21 10:21 PM, Andrea Cosentino wrote:
>> 3.9.0 has been tested only with 4.3.1
>> 
>> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
>> scritto:
>> 
>>> Thank you JB
>>> 
>>> I've tried to update all to last versions.
>>> 
>>> So I've installed:
>>> - Apache Karaf *4.3.2*
>>> - Camel *3.9.0* features
>>> 
>>> In features terms:
>>> *feature:install http webconsole**
>>> **feature:repo-add camel 3.9.0**
>>> **feature:install camel camel-netty camel-kafka**
>>> *
>>> ... and all works fine ;-)
>>> ... but ... trying to install some other camel feature (for example
>>> camel-sql or camel-stream) occurs the following error:
>>> 
>>> karaf@root()> *feature:install camel-sql*
>>> Error executing command: Unable to resolve root: missing requirement
>>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>>> version="[4.3.2,4.3.2]";
>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>> 
>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>> 
>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>> karaf@root()>
>>> 
>>> In the log:
>>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>>> 4.3.2 | Exception caught while executing command
>>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>>> type=karaf.feature; version="[4.3.2,4.3.2]";
>>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>> 
>>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>> 
>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>>          at
>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>> 
>>> ~[?:?]
>>>          at
>>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>>> ~[?:?]
>>>          at
>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>>> ~[?:?]
>>>          at
>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>>> ~[?:?]
>>>          at
>>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>> 
>>> ~[?:?]
>>>          at
>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>> 
>>> ~[?:?]
>>>          at
>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>> 
>>> ~[?:?]
>>>          at
>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>> 
>>> ~[?:?]
>>>          at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>>          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>>> Source) ~[?:?]
>>>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>>> Source) ~[?:?]
>>>          at java.lang.Thread.run(Unknown Source) [?:?]
>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>> 
>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>>          at
>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>> 
>>> ~[?:?]
>>>          ... 12 more
>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>> 
>>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>>          at
>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>> 
>>> ~[?:?]
>>>          at
>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>> 
>>> ~[?:?]
>>>          ... 12 more
>>> 
>>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>> 
>>> 
>>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>>> Hi,
>>>> 
>>>> The error seems related to Kafka bundle.
>>>> 
>>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>> 
>>>> Regards
>>>> JB
>>>> 
>>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>>> écrit :
>>>>> Hi all
>>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>> 
>>>>> cat > deploy/example.xml <<END
>>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>>     <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>>> id="kafka">
>>>>>         <route id="kafka">
>>>>>             <from uri="mina:tcp://
>>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>>             <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>>         </route>
>>>>>     </camelContext>
>>>>> </blueprint>
>>>>> END
>>>>> 
>>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>>> feature:install http webconsole
>>>>> feature:repo-add camel 3.5.0
>>>>> feature:install camel camel-netty camel-kafka
>>>>> 
>>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>>> features:
>>>>> feature:install http webconsole
>>>>> feature:repo-add camel 3.7.3
>>>>> feature:install camel camel-netty camel-kafka
>>>>> 
>>>>> .. the following error occurs:
>>>>> 
>>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>>> 62abe01bee039651
>>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>>> 1621269219663
>>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>>      at
>>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>>> ~[!/:?]
>>>>>      at
>>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>>      at
>>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>>> ~[!/:?]
>>>>>      at
>>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>>> ~[!/:?]
>>>>>      at java.lang.Thread.run(Unknown Source) [?:?]
>>>>> 
>>>>> Any idea ?
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>> 
> 


Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
Other tests ...
The problem is generated by "snappy" feature required by camel-kafka 
feature (see at: 
https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.9.0/apache-camel-3.9.0-features.xml)
The sequence to reproduce the problem, starting from a fresh 4.3.1 Karaf 
installation, is:

         __ __                  ____
        / //_/____ __________ _/ __/
       / ,<  / __ `/ ___/ __ `/ /_
      / /| |/ /_/ / /  / /_/ / __/
     /_/ |_|\__,_/_/   \__,_/_/

   Apache Karaf (4.3.1)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit 'system:shutdown' to shutdown Karaf.
Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.

karaf@root()> feature:repo-add camel 3.9.0
Adding feature url 
mvn:org.apache.camel.karaf/apache-camel/3.9.0/xml/features
karaf@root()> feature:install http webconsole camel camel-netty
karaf@root()> feature:install camel-stream
karaf@root()> feature:install snappy
karaf@root()> feature:install camel-sql
Error executing command: Unable to resolve root: missing requirement 
[root] osgi.identity; osgi.identity=kar; type=karaf.feature; 
version="[4.3.1,4.3.1]"; 
filter:="(&(osgi.identity=kar)(type=karaf.feature)(version>=4.3.1)(version<=4.3.1))" 
[caused by: Unable to resolve kar/4.3.1: missing requirement [kar/4.3.1] 
osgi.identity; osgi.identity=org.apache.karaf.kar.core; 
type=osgi.bundle; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused 
by: Unable to resolve org.apache.karaf.kar.core/4.3.1: missing 
requirement [org.apache.karaf.kar.core/4.3.1] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
karaf@root()>


On 5/17/21 10:21 PM, Andrea Cosentino wrote:
> 3.9.0 has been tested only with 4.3.1
>
> Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
> scritto:
>
>> Thank you JB
>>
>> I've tried to update all to last versions.
>>
>> So I've installed:
>> - Apache Karaf *4.3.2*
>> - Camel *3.9.0* features
>>
>> In features terms:
>> *feature:install http webconsole**
>> **feature:repo-add camel 3.9.0**
>> **feature:install camel camel-netty camel-kafka**
>> *
>> ... and all works fine ;-)
>> ... but ... trying to install some other camel feature (for example
>> camel-sql or camel-stream) occurs the following error:
>>
>> karaf@root()> *feature:install camel-sql*
>> Error executing command: Unable to resolve root: missing requirement
>> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
>> version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>> karaf@root()>
>>
>> In the log:
>> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
>> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
>> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
>> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
>> ShellUtil                        | 43 - org.apache.karaf.shell.core -
>> 4.3.2 | Exception caught while executing command
>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
>> root: missing requirement [root] osgi.identity; osgi.identity=shell;
>> type=karaf.feature; version="[4.3.2,4.3.2]";
>> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>>
>> [caused by: Unable to resolve shell/4.3.2: missing requirement
>> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
>> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
>> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
>> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>>
>> ~[?:?]
>>           at
>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>>
>> ~[?:?]
>>           at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
>> Source) ~[?:?]
>>           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source) ~[?:?]
>>           at java.lang.Thread.run(Unknown Source) [?:?]
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
>> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
>> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
>> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
>> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>>
>> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           at
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>
>> ~[?:?]
>>           ... 12 more
>>
>> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>>
>>
>> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
>>> Hi,
>>>
>>> The error seems related to Kafka bundle.
>>>
>>> Can you check if Kafka bundle version is 2.6.0_2 ?
>>>
>>> Regards
>>> JB
>>>
>>>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
>> écrit :
>>>> Hi all
>>>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>>>
>>>> cat > deploy/example.xml <<END
>>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint"
>> id="kafka">
>>>>          <route id="kafka">
>>>>              <from uri="mina:tcp://
>> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>>>              <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>>>          </route>
>>>>      </camelContext>
>>>> </blueprint>
>>>> END
>>>>
>>>> Using Camel 3.5.0 all works fine (from gogo shell):
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.5.0
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
>> features:
>>>> feature:install http webconsole
>>>> feature:repo-add camel 3.7.3
>>>> feature:install camel camel-netty camel-kafka
>>>>
>>>> .. the following error occurs:
>>>>
>>>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
>> 62abe01bee039651
>>>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
>> 1621269219663
>>>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
>> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>>>>       at
>> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
>> ~[!/:?]
>>>>       at
>> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
>> ~[!/:?]
>>>>       at java.lang.Thread.run(Unknown Source) [?:?]
>>>>
>>>> Any idea ?
>>>>
>>>>
>>>>
>>>>
>>


Re: Apacke Karaf, Camel and Kafka component

Posted by Andrea Cosentino <an...@gmail.com>.
3.9.0 has been tested only with 4.3.1

Il lun 17 mag 2021, 22:13 Nicola Cisternino <nc...@gmail.com> ha
scritto:

> Thank you JB
>
> I've tried to update all to last versions.
>
> So I've installed:
> - Apache Karaf *4.3.2*
> - Camel *3.9.0* features
>
> In features terms:
> *feature:install http webconsole**
> **feature:repo-add camel 3.9.0**
> **feature:install camel camel-netty camel-kafka**
> *
> ... and all works fine ;-)
> ... but ... trying to install some other camel feature (for example
> camel-sql or camel-stream) occurs the following error:
>
> karaf@root()> *feature:install camel-sql*
> Error executing command: Unable to resolve root: missing requirement
> [root] osgi.identity; osgi.identity=shell; type=karaf.feature;
> version="[4.3.2,4.3.2]";
> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>
> [caused by: Unable to resolve shell/4.3.2: missing requirement
> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
> karaf@root()>
>
> In the log:
> 2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql |
> FeaturesServiceImpl              | 18 - org.apache.karaf.features.core -
> 4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
> 2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf |
> ShellUtil                        | 43 - org.apache.karaf.shell.core -
> 4.3.2 | Exception caught while executing command
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve
> root: missing requirement [root] osgi.identity; osgi.identity=shell;
> type=karaf.feature; version="[4.3.2,4.3.2]";
> filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))"
>
> [caused by: Unable to resolve shell/4.3.2: missing requirement
> [shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core;
> type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused
> by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing
> requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
>          at
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>
> ~[?:?]
>          at
> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
> ~[?:?]
>          at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
> ~[?:?]
>          at
> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
> ~[?:?]
>          at
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>
> ~[?:?]
>          at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
>
> ~[?:?]
>          at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
>
> ~[?:?]
>          at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
>
> ~[?:?]
>          at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
>          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source) ~[?:?]
>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source) ~[?:?]
>          at java.lang.Thread.run(Unknown Source) [?:?]
> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
> resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity;
> osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle;
> version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to
> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
>          at
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>
> ~[?:?]
>          ... 12 more
> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to
> resolve org.apache.karaf.shell.core/4.3.2: missing requirement
> [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package;
>
> filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
>          at
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>
> ~[?:?]
>          at
> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>
> ~[?:?]
>          ... 12 more
>
> The strange thing is that org.apache.karaf.shell.core bundle is running !!
>
>
> On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
> > Hi,
> >
> > The error seems related to Kafka bundle.
> >
> > Can you check if Kafka bundle version is 2.6.0_2 ?
> >
> > Regards
> > JB
> >
> >> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a
> écrit :
> >>
> >> Hi all
> >> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
> >>
> >> cat > deploy/example.xml <<END
> >> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> >>     <camelContext xmlns="http://camel.apache.org/schema/blueprint"
> id="kafka">
> >>         <route id="kafka">
> >>             <from uri="mina:tcp://
> 0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
> >>             <to uri="kafka:users?brokers=192.168.1.231:9092"/>
> >>         </route>
> >>     </camelContext>
> >> </blueprint>
> >> END
> >>
> >> Using Camel 3.5.0 all works fine (from gogo shell):
> >> feature:install http webconsole
> >> feature:repo-add camel 3.5.0
> >> feature:install camel camel-netty camel-kafka
> >>
> >> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same
> features:
> >> feature:install http webconsole
> >> feature:repo-add camel 3.7.3
> >> feature:install camel camel-netty camel-kafka
> >>
> >> .. the following error occurs:
> >>
> >> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
> >> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId:
> 62abe01bee039651
> >> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs:
> 1621269219663
> >> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2]
> Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
> >> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.kafka.common.requests.ApiVersionsRequest$Builder
> >>      at
> org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910)
> ~[!/:?]
> >>      at
> org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
> >>      at
> org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325)
> ~[!/:?]
> >>      at
> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240)
> ~[!/:?]
> >>      at java.lang.Thread.run(Unknown Source) [?:?]
> >>
> >> Any idea ?
> >>
> >>
> >>
> >>
>
>

Re: Apacke Karaf, Camel and Kafka component

Posted by Nicola Cisternino <nc...@gmail.com>.
Thank you JB

I've tried to update all to last versions.

So I've installed:
- Apache Karaf *4.3.2*
- Camel *3.9.0* features

In features terms:
*feature:install http webconsole**
**feature:repo-add camel 3.9.0**
**feature:install camel camel-netty camel-kafka**
*
... and all works fine ;-)
... but ... trying to install some other camel feature (for example 
camel-sql or camel-stream) occurs the following error:

karaf@root()> *feature:install camel-sql*
Error executing command: Unable to resolve root: missing requirement 
[root] osgi.identity; osgi.identity=shell; type=karaf.feature; 
version="[4.3.2,4.3.2]"; 
filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))" 
[caused by: Unable to resolve shell/4.3.2: missing requirement 
[shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core; 
type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused 
by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing 
requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
karaf@root()>

In the log:
2021-05-17T20:09:52,508 | INFO  | pipe-feature:install camel-sql | 
FeaturesServiceImpl              | 18 - org.apache.karaf.features.core - 
4.3.2 | Adding features: camel-sql/[3.9.0,3.9.0]
2021-05-17T20:09:52,601 | ERROR | Karaf ssh console user karaf | 
ShellUtil                        | 43 - org.apache.karaf.shell.core - 
4.3.2 | Exception caught while executing command
org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
root: missing requirement [root] osgi.identity; osgi.identity=shell; 
type=karaf.feature; version="[4.3.2,4.3.2]"; 
filter:="(&(osgi.identity=shell)(type=karaf.feature)(version>=4.3.2)(version<=4.3.2))" 
[caused by: Unable to resolve shell/4.3.2: missing requirement 
[shell/4.3.2] osgi.identity; osgi.identity=org.apache.karaf.shell.core; 
type=osgi.bundle; version="[4.3.2,4.3.2]"; resolution:=mandatory [caused 
by: Unable to resolve org.apache.karaf.shell.core/4.3.2: missing 
requirement [org.apache.karaf.shell.core/4.3.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]]
         at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) 
~[?:?]
         at 
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433) 
~[?:?]
         at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420) ~[?:?]
         at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374) ~[?:?]
         at 
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) 
~[?:?]
         at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399) 
~[?:?]
         at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) 
~[?:?]
         at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) 
~[?:?]
         at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown 
Source) ~[?:?]
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source) ~[?:?]
         at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
resolve shell/4.3.2: missing requirement [shell/4.3.2] osgi.identity; 
osgi.identity=org.apache.karaf.shell.core; type=osgi.bundle; 
version="[4.3.2,4.3.2]"; resolution:=mandatory [caused by: Unable to 
resolve org.apache.karaf.shell.core/4.3.2: missing requirement 
[org.apache.karaf.shell.core/4.3.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"]
         at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) 
~[?:?]
         ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
resolve org.apache.karaf.shell.core/4.3.2: missing requirement 
[org.apache.karaf.shell.core/4.3.2] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=org.osgi.framework)(version>=1.0.0)(!(version>=3.0.0)))"
         at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) 
~[?:?]
         at 
org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) 
~[?:?]
         ... 12 more

The strange thing is that org.apache.karaf.shell.core bundle is running !!


On 5/17/21 7:02 PM, Jean-Baptiste Onofre wrote:
> Hi,
>
> The error seems related to Kafka bundle.
>
> Can you check if Kafka bundle version is 2.6.0_2 ?
>
> Regards
> JB
>
>> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a écrit :
>>
>> Hi all
>> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
>>
>> cat > deploy/example.xml <<END
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>     <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="kafka">
>>         <route id="kafka">
>>             <from uri="mina:tcp://0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>>             <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>>         </route>
>>     </camelContext>
>> </blueprint>
>> END
>>
>> Using Camel 3.5.0 all works fine (from gogo shell):
>> feature:install http webconsole
>> feature:repo-add camel 3.5.0
>> feature:install camel camel-netty camel-kafka
>>
>> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same features:
>> feature:install http webconsole
>> feature:repo-add camel 3.7.3
>> feature:install camel camel-netty camel-kafka
>>
>> .. the following error occurs:
>>
>> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId: 62abe01bee039651
>> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs: 1621269219663
>> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2] Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
>> java.lang.NoClassDefFoundError: Could not initialize class org.apache.kafka.common.requests.ApiVersionsRequest$Builder
>> 	at org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910) ~[!/:?]
>> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
>> 	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) ~[!/:?]
>> 	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) ~[!/:?]
>> 	at java.lang.Thread.run(Unknown Source) [?:?]
>>
>> Any idea ?
>>
>>
>>
>>


Re: Apacke Karaf, Camel and Kafka component

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

The error seems related to Kafka bundle.

Can you check if Kafka bundle version is 2.6.0_2 ?

Regards
JB

> Le 17 mai 2021 à 18:42, Nicola Cisternino <nc...@gmail.com> a écrit :
> 
> Hi all
> I'm using Apache Karaf 4.3.1 to route netty socket on Kafka:
> 
> cat > deploy/example.xml <<END
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>    <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="kafka">
>        <route id="kafka">
>            <from uri="mina:tcp://0.0.0.0:8888?decoderMaxLineLength=8192&amp;textline=true&amp;sync=false"/>
>            <to uri="kafka:users?brokers=192.168.1.231:9092"/>
>        </route>
>    </camelContext>
> </blueprint>
> END
> 
> Using Camel 3.5.0 all works fine (from gogo shell):
> feature:install http webconsole         
> feature:repo-add camel 3.5.0
> feature:install camel camel-netty camel-kafka
> 
> Using last Camel 3.7.3 version (plus 3 Jackson Bundles) with same features:
> feature:install http webconsole
> feature:repo-add camel 3.7.3
> feature:install camel camel-netty camel-kafka
> 
> .. the following error occurs:
> 
> 16:33:39.663 INFO [Blueprint Event Dispatcher: 1] Kafka version: 2.6.0
> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka commitId: 62abe01bee039651
> 16:33:39.664 INFO [Blueprint Event Dispatcher: 1] Kafka startTimeMs: 1621269219663
> 16:33:39.665 ERROR [kafka-producer-network-thread | producer-2] Uncaught exception in thread 'kafka-producer-network-thread | producer-2':
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.kafka.common.requests.ApiVersionsRequest$Builder
> 	at org.apache.kafka.clients.NetworkClient.handleConnections(NetworkClient.java:910) ~[!/:?]
> 	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:555) ~[!/:?]
> 	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:325) ~[!/:?]
> 	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:240) ~[!/:?]
> 	at java.lang.Thread.run(Unknown Source) [?:?]
> 
> Any idea ?
> 
> 
> 
>