Andrea Baglioni
Apr 12, 2012
"Error cleaning up agent threads" - a never ending story
A real case that has been solved
There are thousands of posts on Lotus Domino forum about this problem: "Error cleaning up agent threads".
I ran into a similar problem using a Java agent. I state that this agent has been inherited from another developer ;-) so it was not easy for me to initially understand what the problem could be.
In any case, every time the agent ended, I had the above error to the log.
In truth, none of the posts that I've seen has been helpful, until, by inspecting the code carefully and isolating the parts of it, I found the solution.
One line of code was:
Utils u = new Utils (..... some parameter ....);
public class Utils extends AgentBase {
In practice, the class is defined to extend agentBase, so it's like it was an agent itself. The result is that each time it's loaded, a thread is istantiated.
When finished, the agent's thread was terminated, but the child's thread lost the reference to his father, causing the error.
This problem is naturally solved by changing the definition of the class:
public class Utils {
It may seem a trivial issue, but I guarantee that it is really sneaky, especially if you are working on other people's code.
As you can check on support forums, every developer has a different solution for this problem. In the end, my suggestion are:
- Never extend AgentBase in external class
- use recycle() methods to clean up memory object, expecially in loop code
Any other input on this issue is welcome.
Stay tuned!
Document Actions
Mar 05, 2012
Indice delle Pubbliche amministrazioni: nuova procedura di accreditamento
L'indice delle pubbliche amministrazioni (IPA) ha cambiato le politiche di accesso alla propria baca dati: secondo noi una scelta discutibile
L'indice delle pubbliche amministrazioni http://www.indicepa.gov.it/ ha cambiato la politica con cui si puo' interrogare il database LDAP.

Per dar modo a tutti gli utenti di munirsi di tali credenziali, è attiva un'apposita procedura di registrazione, cui si accede dalla home page.
Registrati all'LDAP
Come si rileva dalla homepage, l'acceso all'LDAP è ora disponibile soltanto previo accreditamento e registrazione al portale stesso, il che costringe qualsiasi PA a munirsi di tali credenziali.
La scelta a nostro modesto parere è fortemente limitante (non sembra giustificata da particolari normative di legge) e obbliga qualsiasi procedura che fino a oggi interrogava liberamente la banca dati a modificare le proprie politiche di accesso.
In ogni caso gli step di accreditamento sono documentati sul portale.
Document Actions
Oct 28, 2011
Using JavaMail with TLS
Snippets about sending mail though Java with TLS support
Here is an example to show you how to use JavaMail API method to send an email, using both TLS and SSL connection.
If you are using TLS, remember to disable this property:
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.starttls.enable","true")
props.put("mail.smtp.host", server);
props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true");
props.put("mail.debug","false");
props.put("mail.smtp.port",port);
props.put("mail.smtp.ssl.enable","true");
props.put("mail.smtp.socketFactory.port", port);
props.put("mail.smtp.socketFactory.fallback", "false");
Remember that, when you set Authentication to server with PasswordAuthentication class, you could experience this error:
"javax.mail.AuthenticationFailedException: 535-5.7.1 Username and Password not accepted."
Send by server if user or password used for authentication failed. Usually means that server requires full user name (user@server.com) to be used.
Document Actions
Sep 15, 2011
Rendering of HTML using innerHTML or .update() method with Javascript
By manipulating an element's innerHtml you'll be able to change your text and HTML as much as you like. But, pay attention!!!
These methods are very useful if you want to pupulate div's in your page, but at the end rendering would be strange.
Problem is that HTML that you produce in some way (e.g. agents in Lotus Domino) must be well-formatted and valid before you put it into your <div>
For example, if you want to put an image and you write:
<img src="<somePath>" alt="" border=0 />
instead of
<img src="<somePath>" alt="" border="0" />
Same behaviour if HTML TAG are not correctly nested.
Document Actions
Jul 19, 2011
Problems with charset in 8.5.1 environment
Strange behaviour managing XML file in Java agent
In this scenario, i've experienced some problems with UTF-8 charset in strings. In 6.5 environment everithing works fine.
This is my code in a Java agent:
org.w3c.dom.Document docXML = attachSegnatura.parseXML(false); XSLTResultTarget out = new XSLTResultTarget(); out.setFileName(path + "SegnaturaRT.xml"); attachSegnatura.transformXML(xsl, out); DOMParser parser = new DOMParser(); parser.parse(path + "SegnaturaRT.xml"); org.w3c.dom.Document docRT = ((DOMParser)parser).getDocument();
tFactory = TransformerFactory.newInstance(); StreamSource xslSS = new StreamSource(pathFile+"Segnatura.xsl"); StreamSource xslRT= new StreamSource(pathFile + "Segnatura.xml"); FileOutputStream fos = new FileOutputStream(pathFile + "SegnaturaRT.xml"); transformer = tFactory.newTransformer(xslSS); transformer.transform(xslRT, new StreamResult(fos)); transformer.reset(); fos.close(); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); docRT = dBuilder.parse(new File(pathFile + "SegnaturaRT.xml"));
Anybody experienced something like this?