# \[SOLVED\] How to get output informations from LDAP connector?

**URL:** <https://community.ofelia.com/t/solved-how-to-get-output-informations-from-ldap-connector/6291>\
**Category:** Q&A\
**Created:** [12 August 2015 08:42 UTC](https://community.ofelia.com/t/solved-how-to-get-output-informations-from-ldap-connector/6291 "2015-08-12T08:42:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gael.tarot](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gael.tarot](https://community.ofelia.com/u/gael.tarot)\
**Post date:** [12 August 2015 08:42 UTC](https://community.ofelia.com/t/solved-how-to-get-output-informations-from-ldap-connector/6291/1 "2015-08-12T08:42:54Z")

</div>

Hello,

I currently have a problem with a new scenario I have to implement :

- I must provide a form to users which will contain an autocomplete input. This autocomplete input must be linked to the company LDAP directory (Active Directory to be exact). We are a medium size company (about 500 people) so I think there won’t be any performance problem.  
For example, if I start to type “Gaël”, it must automatically propose “Gaël XXX” and “Gaël YYY” which are present in the company.

- The solution I imagined was :

> ```
> import org.bonitasoft.connectors.ldap.LdapAttribute;
> import java.text.AttributedCharacterIterator.Attribute;
> import java.util.HashMap;
> import java.util.Map;
>  
> //res_hashmap is the dictionnary returned
> HashMap<String, HashMap<String, String>> res_hashmap = new HashMap<String, HashMap<String, String>>();
>  
> //Creating working variables
> String temp_value = new String()
> String temp_name = new String()
>  
> // Creating patterns (regexp based) matching illegal xml caracters (XML1.0 & XML1.1)
> String xml10pattern = "[^" + "\u0009\r\n" + "\u0020-\uD7FF" + "\uE000-\uFFFD" + "\ud800\udc00-\udbff\udfff" + "]";
> String xml11pattern = "[^" + "\u0001-\uD7FF" + "\uE000-\uFFFD" + "\ud800\udc00-\udbff\udfff" + "]+";
>  
> for (user in ldapAttributeList){
> //Creating temp_hashmap for storing the users attribute
> HashMap<String, String> temp_hashmap = new HashMap<String, String>();
>  
> for (attr in user){
>  
> if (attr.getValue() != null & attr.getName() != null & attr != null){
> //Converting value of attribute in UTF8
> try{
> temp_value = attr.getValue().replaceAll(xml10pattern, "").replaceAll(xml11pattern, "")
> temp_value = new String(temp_value.getBytes("UTF8"), "UTF8");
> }
> catch (UnsupportedEncodingException e) {
> temp_value = e.printStackTrace();
> }
>  
> //Converting name of attribute in UTF8
> try{
> temp_name = attr.getName().replaceAll(xml10pattern, "").replaceAll(xml11pattern, "")
> temp_name = new String(temp_name.getBytes("UTF8"), "UTF8");
> }
> catch (UnsupportedEncodingException e) {
> temp_name = e.printStackTrace();
> }
> }
> //Storing them into the temp_hashmap
> temp_hashmap.put(temp_name, temp_value)
> }
> //Adding user attrs hasmap to the hashmap of user attrs
> res_hashmap.put(temp_hashmap["cn"], temp_hashmap);
> }
> return new HashMap<String, HashMap<String, String>>(res_hashmap)
> 
> ```

I’ve created a variable listeLDAP (java.util.Map) to take value of this code. But I have this _unserializable output error_ each time I test my connector :

So here are my two questions :

- Do you think my solution for having an autocomplete input in a form “linked” to the Active Directory is correct? Could I have done it in a better way?
- How can I fix this serialization error?

Thanks for your help!

PS : I’m using Bonita 7.0.1.

---

<div class="post-metadata">

**Author:** ![gael.tarot](https://avatars.discourse-cdn.com/v4/letter/g/48db29/32.png) [@gael.tarot](https://community.ofelia.com/u/gael.tarot)\
**Post date:** [17 August 2015 13:19 UTC](https://community.ofelia.com/t/solved-how-to-get-output-informations-from-ldap-connector/6291/2 "2015-08-17T13:19:00Z")

</div>

Hello Yannick,

Sorry but I didn’t see that you answered to my post (I thinked I would receive a mail).

Indeed, you’re right, this is not an error message!  
My scenario can run even with this message…  
I think Bonita could be improved with this message (I’ve seen in not the first one to ask about it) 🙂

Thanks for your help!

Gaël

---

<div class="post-metadata">

**Author:** ![yannick.lombardi](https://avatars.discourse-cdn.com/v4/letter/y/8e8cbc/32.png) [@yannick.lombardi](https://community.ofelia.com/u/yannick.lombardi)\
**Post date:** [12 August 2015 09:42 UTC](https://community.ofelia.com/t/solved-how-to-get-output-informations-from-ldap-connector/6291/3 "2015-08-12T09:42:34Z")

</div>

The serialization message is not an error. It’s just a warning to inform you.  
I don’t think you can fix this.
