Javatar81 / devjoy

2 stars 0 forks source link

ClassNotFoundException when creating dynamic rest client #30

Closed Javatar81 closed 11 months ago

Javatar81 commented 11 months ago
2023-11-14 08:15:39,825 ERROR [io.jav.ope.pro.eve.ReconciliationDispatcher] (ReconcilerExecutor-gitearepositoryreconciler-144) Error during event processing ExecutionScope{ resource id: ResourceID{name='example', namespace='bschmeli-test'}, version: 3122769185} failed.: io.javaoperatorsdk.operator.OperatorException: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl)
    at io.javaoperatorsdk.operator.monitoring.micrometer.MicrometerMetrics.lambda$timeControllerExecution$0(MicrometerMetrics.java:165)
    at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:69)
    at io.javaoperatorsdk.operator.monitoring.micrometer.MicrometerMetrics.timeControllerExecution(MicrometerMetrics.java:161)
    at io.javaoperatorsdk.operator.processing.Controller.reconcile(Controller.java:109)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.reconcileExecution(ReconciliationDispatcher.java:140)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleReconcile(ReconciliationDispatcher.java:121)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleDispatch(ReconciliationDispatcher.java:91)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleExecution(ReconciliationDispatcher.java:64)
    at io.javaoperatorsdk.operator.processing.event.EventProcessor$ReconcilerExecutor.run(EventProcessor.java:417)
    at java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base@17.0.9/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base@17.0.9/java.lang.Thread.run(Thread.java:840)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:807)
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:210)
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl)
    at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1158)
    at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:960)
    at java.base@17.0.9/java.security.AccessController.executePrivileged(AccessController.java:171)
    at java.base@17.0.9/java.security.AccessController.doPrivileged(AccessController.java:318)
    at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:957)
    at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:624)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
    at org.apache.http.conn.ssl.DefaultHostnameVerifier.<init>(DefaultHostnameVerifier.java:82)
    at org.apache.http.conn.ssl.DefaultHostnameVerifier.<init>(DefaultHostnameVerifier.java:91)
    at org.jboss.resteasy.client.jaxrs.engines.ClientHttpEngineBuilder43.build(ClientHttpEngineBuilder43.java:68)
    at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.build(ResteasyClientBuilderImpl.java:387)
    at io.quarkus.restclient.runtime.QuarkusRestClientBuilder.build(QuarkusRestClientBuilder.java:350)
    at io.quarkus.restclient.runtime.QuarkusRestClientBuilder.build(QuarkusRestClientBuilder.java:392)
    at io.devjoy.gitea.repository.domain.RepositoryService.getDynamicUrlClient(RepositoryService.java:135)
    at io.devjoy.gitea.repository.domain.RepositoryService.getByUserAndName(RepositoryService.java:106)
    at io.devjoy.gitea.repository.domain.RepositoryService.createIfNotExists(RepositoryService.java:74)
    at io.devjoy.gitea.repository.domain.RepositoryService_ClientProxy.createIfNotExists(Unknown Source)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.lambda$assureRepositoryExists$13(GiteaRepositoryReconciler.java:144)
    at java.base@17.0.9/java.util.Optional.map(Optional.java:260)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.lambda$assureRepositoryExists$14(GiteaRepositoryReconciler.java:143)
    at java.base@17.0.9/java.util.Optional.flatMap(Optional.java:289)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.assureRepositoryExists(GiteaRepositoryReconciler.java:143)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.lambda$reconcile$0(GiteaRepositoryReconciler.java:89)
    at java.base@17.0.9/java.util.Optional.map(Optional.java:260)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.reconcile(GiteaRepositoryReconciler.java:86)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler.reconcile(GiteaRepositoryReconciler.java:47)
    at io.devjoy.gitea.repository.k8s.GiteaRepositoryReconciler_ClientProxy.reconcile(Unknown Source)
    at io.javaoperatorsdk.operator.processing.Controller$1.execute(Controller.java:152)
    at io.javaoperatorsdk.operator.processing.Controller$1.execute(Controller.java:110)
    at io.javaoperatorsdk.operator.monitoring.micrometer.MicrometerMetrics.lambda$timeControllerExecution$0(MicrometerMetrics.java:163)
    ... 13 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl
    at java.base@17.0.9/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:52)
    at java.base@17.0.9/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base@17.0.9/java.lang.ClassLoader.loadClass(ClassLoader.java:133)
    at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1020)
    ... 42 more
Javatar81 commented 11 months ago

Excluding commons-logging did not solve the problem. Hence, we will write our own GiteaAppIni class to read and write app ini sections and properties.