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

ClientProxy gets NullPointerException from getClient method #10961

Closed
sancar opened this issue Jul 21, 2017 · 1 comment
Closed

ClientProxy gets NullPointerException from getClient method #10961

sancar opened this issue Jul 21, 2017 · 1 comment

Comments

@sancar
Copy link
Member

@sancar sancar commented Jul 21, 2017

Jul 20, 2017 10:53:29 AM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [fi-int] [3.7.5] Unable to get alive cluster connection, try in 998 ms later, attempt 24 of 2147483647.
Jul 20, 2017 10:53:29 AM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [fi-int] [3.7.5] Unable to get alive cluster connection, try in 998 ms later, attempt 24 of 2147483647.
Jul 20, 2017 10:53:29 AM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [fi-int] [3.7.5] Unable to get alive cluster connection, try in 998 ms later, attempt 24 of 2147483647.
Jul 20, 2017 10:53:29 AM com.hazelcast.client.spi.impl.ClusterListenerSupport
WARNING: hz.client_0 [fi-int] [3.7.5] Unable to get alive cluster connection, try in 998 ms later, attempt 24 of 2147483647.
java.lang.NullPointerException
        at com.hazelcast.client.spi.ClientProxy.getClient(ClientProxy.java:65)
        at com.hazelcast.client.spi.ClientProxy.invoke(ClientProxy.java:170)
        at com.hazelcast.client.proxy.ClientMapProxy.clear(ClientMapProxy.java:1430)
        .......

Findings after a little bit investigation,
Context is set to Proxy only when initializing. Null context means it is not initialized properly.
Bug seems to be caused by following line:
https://github.com/hazelcast/hazelcast/blob/master/hazelcast-client/src/main/java/com/hazelcast/client/spi/ProxyManager.java#L336
if user gets an exception and wait in the line above, after retryCountLimit is reached, we are returning as if it is initialized successfully. Actually initialization is not successful : context is not set to proxy.

@sancar sancar added this to the 3.8.4 milestone Jul 21, 2017
@sancar sancar self-assigned this Jul 21, 2017
@sancar
Copy link
Member Author

@sancar sancar commented Jul 21, 2017

Although issue is reported with 3.7.5. Current master(3.9) & maintenance(3.8.4) have the same problem.

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

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.