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

HttpAsyncClient not available in classpath when publishing ELK analytics data #3206

Open
Chilliwiddit opened this issue Oct 8, 2024 · 0 comments · May be fixed by wso2-extensions/wso2-am-stripe-plugin#54
Assignees

Comments

@Chilliwiddit
Copy link

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

  1. Configure Monetization with ELK analytics
  2. Invoke monetized API
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants