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

NPE Error on API invocation #3069

Open
BLasan opened this issue Aug 17, 2024 · 0 comments
Open

NPE Error on API invocation #3069

BLasan opened this issue Aug 17, 2024 · 0 comments

Comments

@BLasan
Copy link

BLasan commented Aug 17, 2024

Description

When invoking a rest API with analytics enabled, NPE error is thrown from the API Manager.

[2024-08-17 10:28:17,969] ERROR - AnalyticsMetricsHandler Error Occurred when collecting data
java.lang.NullPointerException: null
	at org.wso2.carbon.apimgt.common.analytics.publishers.impl.AnalyticsDataPublisher.getSuccessMetricReporters(AnalyticsDataPublisher.java:160) ~[org.wso2.carbon.apimgt.common.analytics_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.common.analytics.publishers.impl.SuccessRequestDataPublisher.getMultipleCounterMetrics(SuccessRequestDataPublisher.java:42) ~[org.wso2.carbon.apimgt.common.analytics_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.common.analytics.publishers.impl.AbstractRequestDataPublisher.publish(AbstractRequestDataPublisher.java:47) ~[org.wso2.carbon.apimgt.common.analytics_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.common.analytics.collectors.impl.SuccessRequestDataCollector.collectData(SuccessRequestDataCollector.java:145) ~[org.wso2.carbon.apimgt.common.analytics_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.common.analytics.collectors.impl.GenericRequestDataCollector.collectData(GenericRequestDataCollector.java:46) ~[org.wso2.carbon.apimgt.common.analytics_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.gateway.handlers.analytics.AnalyticsMetricsHandler.handleResponseOutFlow_aroundBody8(AnalyticsMetricsHandler.java:95) ~[org.wso2.carbon.apimgt.gateway_9.29.189.SNAPSHOT.jar:?]
	at org.wso2.carbon.apimgt.gateway.handlers.analytics.AnalyticsMetricsHandler.handleResponseOutFlow(AnalyticsMetricsHandler.java:1) ~[org.wso2.carbon.apimgt.gateway_9.29.189.SNAPSHOT.jar:?]
	at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:191) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:578) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:123) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:126) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:74) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.Resource.process(Resource.java:338) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.API.process(API.java:420) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.AbstractApiHandler.apiProcessNonDefaultStrategy(AbstractApiHandler.java:109) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.AbstractApiHandler.identifyAPI(AbstractApiHandler.java:129) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.AbstractApiHandler.dispatchToAPI(AbstractApiHandler.java:54) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.rest.RestRequestHandler.dispatchToAPI(RestRequestHandler.java:90) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.api.rest.RestRequestHandler.process(RestRequestHandler.java:63) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:54) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:350) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:647) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:218) ~[synapse-core_4.0.0.wso2v105.jar:4.0.0-wso2v105]
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) ~[axis2_1.6.1.wso2v76.jar:?]
	at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:339) ~[synapse-nhttp-transport_4.0.0.wso2v105.jar:?]
	at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) ~[axis2_1.6.1.wso2v76.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]

Steps to Reproduce

  1. Enable analytics from the deployment.toml file
  2. Create an API, deploy and publish
  3. Invoke the API. You can see the aforementioned error log on the console

Affected Component

APIM

Version

4.4.x

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

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

No branches or pull requests

1 participant