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

Throws a Nullpointerexception (Npe) Exception When a User Credential or SSL Error Is Thrown. #2323

Open
Abshan opened this issue Dec 14, 2023 · 2 comments

Comments

@Abshan
Copy link

Abshan commented Dec 14, 2023

Description

When APIM-3.2.0 is configured with the APIM-Analytics 3.2.0 version, during the connection establishment process with the Analytics auth URL (ssl://localhost:7711) if an "DataEndpointLoginException" is thrown, the following NPE exception would get printed in the carbon.logs without a proper cause for the error message.

ERROR - APIMgtUsageDataBridgeDataPublisher Error initializing APIMgtUsageDataBridgeDataPublisher
java.lang.NullPointerException: null
	at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.runConnection(DataEndpointConnectionWorker.java:124) ~[org.wso2.carbon.databridge.agent_5.2.26.10.jar:?]
	at org.wso2.carbon.databridge.agent.endpoint.DataEndpoint.connect(DataEndpoint.java:163) ~[org.wso2.carbon.databridge.agent_5.2.26.10.jar:?]
	at org.wso2.carbon.databridge.agent.endpoint.DataEndpoint.initialize(DataEndpoint.java:193) ~[org.wso2.carbon.databridge.agent_5.2.26.10.jar:?]
	at org.wso2.carbon.databridge.agent.DataPublisher.processEndpoints(DataPublisher.java:204) ~[org.wso2.carbon.databridge.agent_5.2.26.10.jar:?]
	at org.wso2.carbon.databridge.agent.DataPublisher.<init>(DataPublisher.java:128) ~[org.wso2.carbon.databridge.agent_5.2.26.10.jar:?]
	at org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher.getDataPublisher(APIMgtUsageDataBridgeDataPublisher.java:117) ~[org.wso2.carbon.apimgt.usage.publisher_6.7.206.19.jar:?]
	at org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher.init(APIMgtUsageDataBridgeDataPublisher.java:48) [org.wso2.carbon.apimgt.usage.publisher_6.7.206.19.jar:?]

The "DataEndpointLoginException" can get thrown for scenarios like invalid credentials defined on either side (APIM or Analytics) or a certificate issue (missing certificate). For all these scenarios the same NPE exception gets thrown.

This needs to be fixed with proper exception handling.

Steps to Reproduce

  1. Configure APIM analytics 3.2 with APIM 3.2.0 version.
  2. Configure invalid credentials on either side.
  3. Start the Analytics worker server first, and then the APIM server.
  4. The above mentioned error log would get printed during the startup logs.

Affected Component

APIM

Version

3.2.0

@npamudika
Copy link

@sgayangi Please mention the public PR

@npamudika
Copy link

Fixed via wso2/carbon-analytics-common#817

@npamudika npamudika added 4.3.0-alpha and removed 4.3.0-M1 4.3.0 M1 Milestone labels Jan 19, 2024
@npamudika npamudika modified the milestones: 4.3.0-M1, 4.3.0-Alpha Jan 19, 2024
@tharikaGitHub tharikaGitHub removed this from the 4.3.0-Alpha milestone Mar 3, 2024
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

5 participants