Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using Camel Kinesis component - java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory #2666

Closed
tplevko opened this issue May 25, 2021 · 2 comments

Comments

@tplevko
Copy link

tplevko commented May 25, 2021

I'm getting following error when trying to use camel-quarkus-aws2-kinesis component in route:

2021-05-25 14:13:39,057 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifier.java:61)
	at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAllHostnameVerifier.java:44)
	at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<clinit>(AllowAllHostnameVerifier.java:46)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
	at software.amazon.awssdk.http.apache.ApacheHttpClient$ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheHttpClient.java:615)

I found a workaround - adding following dependency to the project. Shouldn't this come however already with the camel quarkus component?

<dependency>
    <groupId>org.jboss.logging</groupId>
    <artifactId>commons-logging-jboss-logging</artifactId>
</dependency>

The route:

package com.test;

import java.lang.Exception;
import java.lang.Override;
import javax.enterprise.context.ApplicationScoped;
import org.apache.camel.builder.RouteBuilder;

@ApplicationScoped
public class MyRouteBuilder extends RouteBuilder {
  @Override
  public void configure() throws Exception {
    from("timer:x?repeatCount=1")
    .setHeader("CamelAwsKinesisPartitionKey", constant("partition-2"))
    .setHeader("CamelAwsKinesisSequenceNumber", constant("1"))
    .setBody()
    .constant("kinesis msg Tue May 11 10:13:06 CEST 2021").to("aws2-kinesis://xxxxxx?accessKey=RAW(xxxxx)&secretKey=RAW(xxxx)&region=xxxxx");
  }
}
@ppalaga
Copy link
Contributor

ppalaga commented May 26, 2021

Which Camel Quarkus version are you using?

In our main branch, camel-quarkus-aws2-kinesis transitively depends on commons-logging-jboss-logging, so it should not be necessary to add it explicitly.

@avano
Copy link
Contributor

avano commented May 26, 2021

@ppalaga we used an older version, I confirmed that it works ok with 1.8.0, so this one can be closed

@ppalaga ppalaga closed this as completed May 26, 2021
@ppalaga ppalaga added this to the No fix/wont't fix milestone May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants