[OPENDJ-3919] NPE when modifying ProxyBackend configuration Created: 23/Mar/17  Updated: 08/Nov/19  Resolved: 04/May/17

Status: Done
Project: OpenDJ
Component/s: core server
Affects Version/s: 4.0.0
Fix Version/s: 4.0.0

Type: Bug Priority: Major
Reporter: Yannick Lecaillez Assignee: Jean-Noël Rouvignac
Resolution: Fixed Votes: 0
Labels: Verified


 Description   

In a setup like:

./DJ1/setup directory-server --instancePath=DJ1/ --rootUserDn cn=Directory\ Manager           --rootUserPassword password           --hostname ylecaillez-laptop           --adminConnectorPort 4444           --ldapPort 1389           --sampleData 2000           --baseDn dc=example,dc=com           --backendType je-backend

./DJ2/setup directory-server --instancePath=DJ2/ --rootUserDn cn=Directory\ Manager           --rootUserPassword password           --hostname ylecaillez-laptop           --adminConnectorPort 5444           --ldapPort 2389           --sampleData 2000           --baseDn dc=example,dc=com           --backendType je-backend

./PROXY/setup proxy-server  --instancePath=PROXY/ --baseDN dc=example,dc=com -p 10389 -D cn=directory\ manager -w secret12 --proxyUserBindDn cn=directory\ manager --proxyUserBindPassword secret12 --staticPrimaryServer localhost:1389 --staticSecondaryServer localhost:2389 ^CadminConnectorPort 10444 -h localhost

When trying to modify the configuration of the proxy backend twice between a discovery schedule, a NPE occurs:

#$ ./bin/dsconfig set-backend-prop --backend-name proxyRoot --set proxy-user-password:foo --hostname ylecaillez-laptop --port 10444 --bindDn cn=Directory\ Manager --bindPassword secret12 --trustAll --no-prompt
#$ ./bin/dsconfig set-backend-prop --backend-name proxyRoot --set proxy-user-password:bar --hostname ylecaillez-laptop --port 10444 --bindDn cn=Directory\ Manager --bindPassword secret12 --trustAll --no-prompt


The Proxy Backend could not be modified due to a communications problem:
Undefined
Caused by: java.lang.NullPointerException
	at org.opends.server.backends.ProxyBackend.getFailoverLoadBalancer(ProxyBackend.java:349)
	at org.opends.server.backends.ProxyBackend.updateDiscoveredState(ProxyBackend.java:324)
	at org.opends.server.backends.ProxyBackend.applyConfigurationChange(ProxyBackend.java:1266)
	at org.opends.server.backends.ProxyBackend.applyConfigurationChange(ProxyBackend.java:159)
	at org.forgerock.opendj.config.server.ServerManagedObjectChangeListenerAdaptor.applyConfigurationChange(ServerManagedObjectChangeListenerAdaptor.java:50)
	at org.forgerock.opendj.config.server.ConfigChangeListenerAdaptor.applyConfigurationChange(ConfigChangeListenerAdaptor.java:281)
	at org.opends.server.config.ConfigurationHandler.replaceEntry(ConfigurationHandler.java:645)
	at org.opends.server.backends.ConfigurationBackend.replaceEntry(ConfigurationBackend.java:477)
	at org.opends.server.workflowelement.localbackend.LocalBackendModifyOperation.processModify(LocalBackendModifyOperation.java:492)
	at org.opends.server.workflowelement.localbackend.LocalBackendModifyOperation.processLocalModify(LocalBackendModifyOperation.java:279)
	at org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement.executeOperation(LocalBackendWorkflowElement.java:482)
	at org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement.execute(LocalBackendWorkflowElement.java:605)
	at org.opends.server.core.ModifyOperationBasis.run(ModifyOperationBasis.java:273)
	at org.opends.server.core.SynchronousStrategy.enqueueRequest(SynchronousStrategy.java:39)
	at org.opends.server.protocols.ldap.LdapClientConnection.addOperationInProgress(LdapClientConnection.java:597)
	... 47 more


 Comments   
Comment by Jean-Noël Rouvignac [ 24/Mar/17 ]

FIXED the NPE and removed null checks by using the null object pattern.

Comment by carole forel [ 04/May/17 ]

verified with OpenDJ 4.1.0 rev 225e823389e and 4.0.0

Generated at Mon Nov 30 13:57:19 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.