HttpAsyncClient not available in classpath when publishing ELK analytics data
Description
Publishing ELK analytics for the first time will produce the following error log:-
Exception in thread "pool-336-thread-1" java.lang.NoClassDefFoundError: org/apache/http/nio/client/HttpAsyncClient at org.wso2.apim.monetization.impl.StripeMonetizationImpl.getUsageDataFromElasticsearch(StripeMonetizationImpl.java:1075) at org.wso2.apim.monetization.impl.StripeMonetizationImpl.publishMonetizationUsageRecords(StripeMonetizationImpl.java:718) at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run_aroundBody0(MonetizationUsagePublishAgent.java:62) at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run(MonetizationUsagePublishAgent.java:1) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.ClassNotFoundException: org.apache.http.nio.client.HttpAsyncClient cannot be found by org.wso2.apim.monetization.impl_1.5.0_SNAPSHOT_1.0.0 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527) ... 7 more
Following this analytics data cannot be published again as a message will state that a job is already running (the thread is running forever). Due to this analytics data will never be sent to the Stripe Billing Engine.
Note: This error stack may not sometimes be seen for the first time
Steps to Reproduce
- Configure Monetization with ELK analytics
- Invoke monetized API
- Execute the CURL command to send analytics data to the billing engine
Affected Component
Analytics
Version
4.3.0, 4.4.0
Environment Details (with versions)
-Ubuntu 22
Relevant Log Output
`Exception in thread "pool-336-thread-1" java.lang.NoClassDefFoundError: org/apache/http/nio/client/HttpAsyncClient
at org.wso2.apim.monetization.impl.StripeMonetizationImpl.getUsageDataFromElasticsearch(StripeMonetizationImpl.java:1075)
at org.wso2.apim.monetization.impl.StripeMonetizationImpl.publishMonetizationUsageRecords(StripeMonetizationImpl.java:718)
at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run_aroundBody0(MonetizationUsagePublishAgent.java:62)
at org.wso2.carbon.apimgt.impl.monetization.MonetizationUsagePublishAgent.run(MonetizationUsagePublishAgent.java:1)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: org.apache.http.nio.client.HttpAsyncClient cannot be found by org.wso2.apim.monetization.impl_1.5.0_SNAPSHOT_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
... 7 more`
Related Issues
No response
Suggested Labels
Monetization