[jira] [Commented] (FC-238) Migrate to LDAP API 2.0

2021-06-24 Thread Shawn McKinney (Jira)


[ 
https://issues.apache.org/jira/browse/FC-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17369035#comment-17369035
 ] 

Shawn McKinney commented on FC-238:
---

4. RBAC Accelerator Extended Ops (LdapConnectionProvider)

change constructor from:

```
LdapApiService ldapApiService = new StandaloneLdapApiService( new 
ArrayList(), listExOps );
```

to:

```
LdapApiService ldapApiService = new StandaloneLdapApiService( new 
ArrayList(), new ArrayList(), listExOps, new 
ArrayList() );
```

code compiles and runs but when making accelerator extended operations 
server-side assertion fails:

```
[exec] 60d4c866 <= send_search_entry: conn 1000 exit.
 [exec] 60d4c866 send_ldap_result: conn=1000 op=1 p=3
 [exec] 60d4c866 send_ldap_result: err=0 matched="" text=""
 [exec] 60d4c866 send_ldap_response: msgid=2 tag=101 err=0
 [exec] ber_flush2: 14 bytes to sd 23
 [exec]   :  30 0c 02 01 02 65 07 0a  01 00 04 00 04 00 
0e
 [exec] ldap_write: want=14, written=14
 [exec]   :  30 0c 02 01 02 65 07 0a  01 00 04 00 04 00 
0e
 [exec] 60d4c866 conn=1000 op=1 SEARCH RESULT tag=101 err=0 qtime=0.45 
etime=0.197924 nentries=1 text=
 [exec] 60d4c866 daemon: activity on 1 descriptor
 [exec] 60d4c866 daemon: activity on: 23r
 [exec] 60d4c866 daemon: read active on 23
 [exec] 60d4c866 daemon: epoll: listen=7 active_threads=0 tvp=zero
 [exec] 60d4c866 connection_get(23)
 [exec] 60d4c866 connection_get(23): got connid=1000 
 [exec] 60d4c866 connection_read(23): checking for input on id=1000
 [exec] ber_get_next
 [exec] ldap_read: want=8, got=8
 [exec]   :  30 1d 02 01 03 77 18 80
0w..  
 [exec] ldap_read: want=23, got=23
 [exec]   :  16 31 2e 33 2e 36 2e 31  2e 34 2e 31 2e 34 32 30   
.1.3.6.1.4.1.420  
 [exec]   0010:  33 2e 35 35 35 2e 31   3.555.1 
  
 [exec] ber_get_next: tag 0x30 len 29 contents:
 [exec] ber_dump: buf=0x7fdc8b60 ptr=0x7fdc8b60 end=0x7fdc8b7d 
len=29
 [exec]   :  02 01 03 77 18 80 16 31  2e 33 2e 36 2e 31 2e 34   
...w...1.3.6.1.4  
 [exec]   0010:  2e 31 2e 34 32 30 33 2e  35 35 35 2e 31
.1.4203.555.1 
 [exec] 60d4c866 op tag 0x77, time 1624557670
 [exec] ber_get_next
 [exec] ldap_read: want=8 error=Resource temporarily unavailable
 [exec] 60d4c866 daemon: activity on 1 descriptor
 [exec] 60d4c866 daemon: activity on:60d4c866 conn=1000 op=2 do_extended
 [exec] ber_scanf fmt ({m) ber:
 [exec] ber_dump: buf=0x7fdc8b60 ptr=0x7fdc8b63 end=0x7fdc8b7d 
len=26
 [exec]   :  77 18 80 16 31 2e 33 2e  36 2e 31 2e 34 2e 31 2e   
w...1.3.6.1.4.1.  
 [exec]   0010:  34 32 30 33 2e 35 35 35  2e 31 
4203.555.1
 [exec] 60d4c866 conn=1000 op=2 EXT oid=1.3.6.1.4.1.4203.555.1
 [exec] 60d4c866 do_extended: oid=1.3.6.1.4.1.4203.555.1
 [exec] 60d4c866 rbac_create_session entry
 [exec] slapd: /home/build/sold/slapo-rbac/overlay/rbac.c:816: 
rbac_create_session: Assertion `rs->sr_err == LDAP_SUCCESS' failed.
 [exec] Aborted (core dumped)
 [exec] Result: 134
```

> Migrate to LDAP API 2.0
> ---
>
> Key: FC-238
> URL: https://issues.apache.org/jira/browse/FC-238
> Project: FORTRESS
>  Issue Type: Improvement
>Affects Versions: 2.0.1
>Reporter: Shawn McKinney
>Assignee: Shawn McKinney
>Priority: Major
> Fix For: 2.0.6
>
>
> The code compiles, but gets NPE when fortress tries to open a pool to the 
> server
> **
> Steps to recreate.
>  # Get fortress env, checkout latest, follow the steps in DOCKER README to 
> get either openldap or apacheds server up. 
>  # You may skip the junit tests, do the data loads, i.e. mvn test -Pload.file=
>  ## in order to verify the env is running correctly run this test:
>  ### mvn test -Pconsole  <-– should be no errors
>  # Now checkout the code that is using ldap api 2.0.0 
>  ## git checkout 7fdd12f6aef06c43817c6f6a71baeb67f9e19000
>  # connect with fortress console:
>  ## mvn test -Pconsole
> Get the error:
>  
> 2018-07-30 11:25:054 INFO  CodecFactoryUtil:404 - 
> MSG_06002_REGISTERED_INTERMEDIATE_FACTORY (1.3.6.1.4.1.4203.1.9.1.4)
> [WARNING] 
> org.apache.directory.fortress.core.CfgRuntimeException: Exception caught 
> initializing Admin Pool: java.lang.NullPointerException, errCode=135
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:191)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.(LdapConnectionProvider.java:116)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.getInstance(LdapConnectionProvider.java:103)
>     at 
> 

[jira] [Commented] (FC-238) Migrate to LDAP API 2.0

2021-06-24 Thread Shawn McKinney (Jira)


[ 
https://issues.apache.org/jira/browse/FC-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17369014#comment-17369014
 ] 

Shawn McKinney commented on FC-238:
---

2. Relax Control (LdapDataProvider)

Two part solution:

a. add / register the control in the API.  

https://github.com/apache/directory-ldap-api/commit/12353c1487412b0c7e0d36a68297ab713dd0

b. until next release of API, need to leave control in fortress and register it 
like this:

```
if ( Config.getInstance().getBoolean( 
"enable.relax.control.registration", false ) )
{
ControlFactory relaxControlFactory = new 
RelaxControlFactory( new DefaultLdapCodecService() );
(new 
LdapNetworkConnection()).getCodecService().registerRequestControl(relaxControlFactory);
LOG.info( "Register RelaxControl" );
}
```

so that it will be found by the runtime.

Once 2.0.3 is released, the corresponding fortress code can be removed.

> Migrate to LDAP API 2.0
> ---
>
> Key: FC-238
> URL: https://issues.apache.org/jira/browse/FC-238
> Project: FORTRESS
>  Issue Type: Improvement
>Affects Versions: 2.0.1
>Reporter: Shawn McKinney
>Assignee: Shawn McKinney
>Priority: Major
> Fix For: 2.0.6
>
>
> The code compiles, but gets NPE when fortress tries to open a pool to the 
> server
> **
> Steps to recreate.
>  # Get fortress env, checkout latest, follow the steps in DOCKER README to 
> get either openldap or apacheds server up. 
>  # You may skip the junit tests, do the data loads, i.e. mvn test -Pload.file=
>  ## in order to verify the env is running correctly run this test:
>  ### mvn test -Pconsole  <-– should be no errors
>  # Now checkout the code that is using ldap api 2.0.0 
>  ## git checkout 7fdd12f6aef06c43817c6f6a71baeb67f9e19000
>  # connect with fortress console:
>  ## mvn test -Pconsole
> Get the error:
>  
> 2018-07-30 11:25:054 INFO  CodecFactoryUtil:404 - 
> MSG_06002_REGISTERED_INTERMEDIATE_FACTORY (1.3.6.1.4.1.4203.1.9.1.4)
> [WARNING] 
> org.apache.directory.fortress.core.CfgRuntimeException: Exception caught 
> initializing Admin Pool: java.lang.NullPointerException, errCode=135
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:191)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.(LdapConnectionProvider.java:116)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.getInstance(LdapConnectionProvider.java:103)
>     at 
> org.apache.directory.fortress.core.ldap.LdapDataProvider.closeAdminConnection(LdapDataProvider.java:1215)
>     at 
> org.apache.directory.fortress.core.impl.ConfigDAO.getConfig(ConfigDAO.java:327)
>     at org.apache.directory.fortress.core.impl.ConfigP.read(ConfigP.java:175)
>     at 
> org.apache.directory.fortress.core.impl.ConfigMgrImpl.read(ConfigMgrImpl.java:102)
>     at 
> org.apache.directory.fortress.core.util.Config.getRemoteConfig(Config.java:377)
>     at 
> org.apache.directory.fortress.core.util.Config.loadRemoteConfig(Config.java:655)
>     at 
> org.apache.directory.fortress.core.util.Config.getInstance(Config.java:101)
>     at 
> org.apache.directory.fortress.core.AdminMgrFactory.createInstance(AdminMgrFactory.java:68)
>     at 
> org.apache.directory.fortress.core.AdminMgrConsole.(AdminMgrConsole.java:74)
>     at 
> org.apache.directory.fortress.core.ProcessMenuCommand.(ProcessMenuCommand.java:38)
>     at 
> org.apache.directory.fortress.core.FortressConsole.main(FortressConsole.java:38)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.loadControls(StandaloneLdapApiService.java:313)
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.(StandaloneLdapApiService.java:174)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:180)
>     ... 19 more
>  
>  
>  
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org



[jira] [Commented] (FC-238) Migrate to LDAP API 2.0

2021-06-24 Thread Shawn McKinney (Jira)


[ 
https://issues.apache.org/jira/browse/FC-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17369008#comment-17369008
 ] 

Shawn McKinney commented on FC-238:
---

3. here's how to retrieve the control:

protected PasswordPolicyResponse getPwdRespCtrl(BindResponse resp )
{
return ( PasswordPolicyResponse ) resp.getControls().get( 
PasswordPolicyRequest.OID );
}


> Migrate to LDAP API 2.0
> ---
>
> Key: FC-238
> URL: https://issues.apache.org/jira/browse/FC-238
> Project: FORTRESS
>  Issue Type: Improvement
>Affects Versions: 2.0.1
>Reporter: Shawn McKinney
>Assignee: Shawn McKinney
>Priority: Major
> Fix For: 2.0.6
>
>
> The code compiles, but gets NPE when fortress tries to open a pool to the 
> server
> **
> Steps to recreate.
>  # Get fortress env, checkout latest, follow the steps in DOCKER README to 
> get either openldap or apacheds server up. 
>  # You may skip the junit tests, do the data loads, i.e. mvn test -Pload.file=
>  ## in order to verify the env is running correctly run this test:
>  ### mvn test -Pconsole  <-– should be no errors
>  # Now checkout the code that is using ldap api 2.0.0 
>  ## git checkout 7fdd12f6aef06c43817c6f6a71baeb67f9e19000
>  # connect with fortress console:
>  ## mvn test -Pconsole
> Get the error:
>  
> 2018-07-30 11:25:054 INFO  CodecFactoryUtil:404 - 
> MSG_06002_REGISTERED_INTERMEDIATE_FACTORY (1.3.6.1.4.1.4203.1.9.1.4)
> [WARNING] 
> org.apache.directory.fortress.core.CfgRuntimeException: Exception caught 
> initializing Admin Pool: java.lang.NullPointerException, errCode=135
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:191)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.(LdapConnectionProvider.java:116)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.getInstance(LdapConnectionProvider.java:103)
>     at 
> org.apache.directory.fortress.core.ldap.LdapDataProvider.closeAdminConnection(LdapDataProvider.java:1215)
>     at 
> org.apache.directory.fortress.core.impl.ConfigDAO.getConfig(ConfigDAO.java:327)
>     at org.apache.directory.fortress.core.impl.ConfigP.read(ConfigP.java:175)
>     at 
> org.apache.directory.fortress.core.impl.ConfigMgrImpl.read(ConfigMgrImpl.java:102)
>     at 
> org.apache.directory.fortress.core.util.Config.getRemoteConfig(Config.java:377)
>     at 
> org.apache.directory.fortress.core.util.Config.loadRemoteConfig(Config.java:655)
>     at 
> org.apache.directory.fortress.core.util.Config.getInstance(Config.java:101)
>     at 
> org.apache.directory.fortress.core.AdminMgrFactory.createInstance(AdminMgrFactory.java:68)
>     at 
> org.apache.directory.fortress.core.AdminMgrConsole.(AdminMgrConsole.java:74)
>     at 
> org.apache.directory.fortress.core.ProcessMenuCommand.(ProcessMenuCommand.java:38)
>     at 
> org.apache.directory.fortress.core.FortressConsole.main(FortressConsole.java:38)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.loadControls(StandaloneLdapApiService.java:313)
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.(StandaloneLdapApiService.java:174)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:180)
>     ... 19 more
>  
>  
>  
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org



[jira] [Commented] (FC-238) Migrate to LDAP API 2.0

2021-06-23 Thread Shawn McKinney (Jira)


[ 
https://issues.apache.org/jira/browse/FC-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17368407#comment-17368407
 ] 

Shawn McKinney commented on FC-238:
---

3. PW Policy Control (LdapDataProvider)

Follow this test example:
[AbstractPasswordPolicyResponder](https://github.com/apache/directory-ldap-api/blob/master/ldap/client/api/src/main/java/org/apache/directory/ldap/client/template/AbstractPasswordPolicyResponder.java)


Processing response control like this:

```
protected PasswordPolicyResponse getPwdRespCtrl(BindResponse resp )
{
 Control control = resp.getControls().get( PasswordPolicyResponse.OID );
 return ( PasswordPolicyResponse ) control;
}
```

And then coaxing out the info is straightforward:

```
if ( respCtrl != null ){
…

if ( respCtrl.getTimeBeforeExpiration() > 0 ){
…
}
if ( respCtrl.getGraceAuthNRemaining() > 0 ){
…
}
```

> Migrate to LDAP API 2.0
> ---
>
> Key: FC-238
> URL: https://issues.apache.org/jira/browse/FC-238
> Project: FORTRESS
>  Issue Type: Improvement
>Affects Versions: 2.0.1
>Reporter: Shawn McKinney
>Assignee: Shawn McKinney
>Priority: Major
> Fix For: 2.0.6
>
>
> The code compiles, but gets NPE when fortress tries to open a pool to the 
> server
> **
> Steps to recreate.
>  # Get fortress env, checkout latest, follow the steps in DOCKER README to 
> get either openldap or apacheds server up. 
>  # You may skip the junit tests, do the data loads, i.e. mvn test -Pload.file=
>  ## in order to verify the env is running correctly run this test:
>  ### mvn test -Pconsole  <-– should be no errors
>  # Now checkout the code that is using ldap api 2.0.0 
>  ## git checkout 7fdd12f6aef06c43817c6f6a71baeb67f9e19000
>  # connect with fortress console:
>  ## mvn test -Pconsole
> Get the error:
>  
> 2018-07-30 11:25:054 INFO  CodecFactoryUtil:404 - 
> MSG_06002_REGISTERED_INTERMEDIATE_FACTORY (1.3.6.1.4.1.4203.1.9.1.4)
> [WARNING] 
> org.apache.directory.fortress.core.CfgRuntimeException: Exception caught 
> initializing Admin Pool: java.lang.NullPointerException, errCode=135
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:191)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.(LdapConnectionProvider.java:116)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.getInstance(LdapConnectionProvider.java:103)
>     at 
> org.apache.directory.fortress.core.ldap.LdapDataProvider.closeAdminConnection(LdapDataProvider.java:1215)
>     at 
> org.apache.directory.fortress.core.impl.ConfigDAO.getConfig(ConfigDAO.java:327)
>     at org.apache.directory.fortress.core.impl.ConfigP.read(ConfigP.java:175)
>     at 
> org.apache.directory.fortress.core.impl.ConfigMgrImpl.read(ConfigMgrImpl.java:102)
>     at 
> org.apache.directory.fortress.core.util.Config.getRemoteConfig(Config.java:377)
>     at 
> org.apache.directory.fortress.core.util.Config.loadRemoteConfig(Config.java:655)
>     at 
> org.apache.directory.fortress.core.util.Config.getInstance(Config.java:101)
>     at 
> org.apache.directory.fortress.core.AdminMgrFactory.createInstance(AdminMgrFactory.java:68)
>     at 
> org.apache.directory.fortress.core.AdminMgrConsole.(AdminMgrConsole.java:74)
>     at 
> org.apache.directory.fortress.core.ProcessMenuCommand.(ProcessMenuCommand.java:38)
>     at 
> org.apache.directory.fortress.core.FortressConsole.main(FortressConsole.java:38)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.loadControls(StandaloneLdapApiService.java:313)
>     at 
> org.apache.directory.api.ldap.codec.standalone.StandaloneLdapApiService.(StandaloneLdapApiService.java:174)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:180)
>     ... 19 more
>  
>  
>  
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@directory.apache.org
For additional commands, e-mail: dev-h...@directory.apache.org



[jira] [Commented] (FC-238) Migrate to LDAP API 2.0

2021-06-22 Thread Shawn McKinney (Jira)


[ 
https://issues.apache.org/jira/browse/FC-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17367342#comment-17367342
 ] 

Shawn McKinney commented on FC-238:
---

Renewing this work.  Here are the problem areas:

 
 1. LDAP connection pool (LdapConnectionProvider)
PooledObjectFactory poolFactory = new 
ValidatingPoolableLdapConnectionFactory( config );
//PoolableObjectFactory poolFactory = new 
ValidatingPoolableLdapConnectionFactory( config );
//adminPool.setWhenExhaustedAction( 
GenericObjectPool.WHEN_EXHAUSTED_GROW );
//adminPool.setMaxActive( max );

 2. Relax Control (LdapDataProvider)
if ( setRelaxControl )
{
addRequest.addControl( new RelaxControlImpl() );
}

: ERR_08002_CANNOT_FIND_CONTROL_FACTORY failed to find a control factory for 
control OID: 1.3.6.1.4.1.4203.666.5.12 
2021-06-21 17:05:027 WARN  LdapNetworkConnection:2478 - 
org.apache.directory.api.asn1.EncoderException: 
ERR_08002_CANNOT_FIND_CONTROL_FACTORY failed to find a control factory for 
control OID: 1.3.6.1.4.1.4203.666.5.12
org.apache.mina.filter.codec.ProtocolEncoderException: 
org.apache.directory.api.asn1.EncoderException: 
ERR_08002_CANNOT_FIND_CONTROL_FACTORY failed to find a control factory for 
control OID: 1.3.6.1.4.1.4203.666.5.12
 
3. PW Policy Control (LdapDataProvider)
protected PasswordPolicy getPwdRespCtrl(Response resp )
{
//Control control = resp.getControls().get( PP_REQ_CTRL.getOid() );
Control control = resp.getControls().get( "1.3.6.1.4.1.42.2.27.8.5.1" );
if ( control == null )
{
return null;
}

return ( ( PasswordPolicyDecorator ) control ).getDecorated();
}

4.  RBAC Accelerator Extended Ops (LdapConnectionProvider)
List listExOps = new ArrayList<>();
listExOps.add( 
"org.openldap.accelerator.impl.createSession.RbacCreateSessionFactory" );
listExOps.add( 
"org.openldap.accelerator.impl.checkAccess.RbacCheckAccessFactory" );
listExOps.add( 
"org.openldap.accelerator.impl.addRole.RbacAddRoleFactory" );
listExOps.add( 
"org.openldap.accelerator.impl.dropRole.RbacDropRoleFactory" );
listExOps.add( 
"org.openldap.accelerator.impl.deleteSession.RbacDeleteSessionFactory" );
listExOps.add( 
"org.openldap.accelerator.impl.sessionRoles.RbacSessionRolesFactory" );
LdapApiService ldapApiService = new StandaloneLdapApiService( new 
ArrayList(), listExOps );

if ( !LdapApiServiceFactory.isInitialized() )
{
LdapApiServiceFactory.initialize( ldapApiService );
}
config.setLdapApiService( ldapApiService );



 

> Migrate to LDAP API 2.0
> ---
>
> Key: FC-238
> URL: https://issues.apache.org/jira/browse/FC-238
> Project: FORTRESS
>  Issue Type: Improvement
>Affects Versions: 2.0.1
>Reporter: Shawn McKinney
>Assignee: Shawn McKinney
>Priority: Major
> Fix For: 2.0.6
>
>
> The code compiles, but gets NPE when fortress tries to open a pool to the 
> server
> **
> Steps to recreate.
>  # Get fortress env, checkout latest, follow the steps in DOCKER README to 
> get either openldap or apacheds server up. 
>  # You may skip the junit tests, do the data loads, i.e. mvn test -Pload.file=
>  ## in order to verify the env is running correctly run this test:
>  ### mvn test -Pconsole  <-– should be no errors
>  # Now checkout the code that is using ldap api 2.0.0 
>  ## git checkout 7fdd12f6aef06c43817c6f6a71baeb67f9e19000
>  # connect with fortress console:
>  ## mvn test -Pconsole
> Get the error:
>  
> 2018-07-30 11:25:054 INFO  CodecFactoryUtil:404 - 
> MSG_06002_REGISTERED_INTERMEDIATE_FACTORY (1.3.6.1.4.1.4203.1.9.1.4)
> [WARNING] 
> org.apache.directory.fortress.core.CfgRuntimeException: Exception caught 
> initializing Admin Pool: java.lang.NullPointerException, errCode=135
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.init(LdapConnectionProvider.java:191)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.(LdapConnectionProvider.java:116)
>     at 
> org.apache.directory.fortress.core.ldap.LdapConnectionProvider.getInstance(LdapConnectionProvider.java:103)
>     at 
> org.apache.directory.fortress.core.ldap.LdapDataProvider.closeAdminConnection(LdapDataProvider.java:1215)
>     at 
> org.apache.directory.fortress.core.impl.ConfigDAO.getConfig(ConfigDAO.java:327)
>     at org.apache.directory.fortress.core.impl.ConfigP.read(ConfigP.java:175)
>     at 
> org.apache.directory.fortress.core.impl.ConfigMgrImpl.read(ConfigMgrImpl.java:102)
>     at 
> org.apache.directory.fortress.core.util.Config.getRemoteConfig(Config.java:377)
>     at 
>