Lotus Notes Error Cleaning Up Agent Threads
Training Support Forums & community Events Rational Tivoli WebSphere Java technology Linux Open source SOA and Web services Web development XML My developerWorks About dW Submit content Feedback developerWorks>Lotus>Forums & community>Notes/Domino 6 and 7 Forum Notes/Domino 6 and 7 Forum Error cleaning up agent threads - daemon thread problem? Sign in to participate Error cleaning up agent threads - daemon thread problem? Posted by Darren Briaris on 14.Aug.06 at 07:10 AM using a Web browserCategory: Domino DesignerRelease: 6.5.3 FP2Platform: Windows XP I am getting the dreaded "Error cleaning up agent threads" error when my java agent ends when run within Notes (In Eclipse the agent runs OK). My agent code is below (the recycles and gc() are attempts to fix the problem!):- public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); DealIncomingMail2.DealMail(); agentContext.recycle(); session.recycle(); System.gc(); } catch(Exception e) { e.printStackTrace(); System.gc(); } } The code in DealMail is using the jt400 library for iseries access and I have noticed that a daemon thread is being started halfway through this code. Is this what is causing my agent to not finish cleanly? I cannot see anyway of ending the daemon thread (the code within DealMail runs OK and doesn't fall over but the thread remains. As stated in Ecipse I can see the daemon thread start and then when the application ends that thread obviously ends as well. Am I barking up the wrong tree for with this? Any help greatly appreciated!! Darren Return to top Error cleaning up agent threads - d... (Darren Briaris 14.Aug.06) . . RE: Error cleaning up agent threads... (Dallas Gimpel 14.Aug.06) . . FIXED - Error cleaning up agent thr... (Darren Briaris 21.Aug.06) . . . . RE: FIXED - Error cleaning up agent... (Stefaan GE Some... 11.Sep.08) . . . . . . RE: FIXED - Error cleaning up agent... (Alexander Voron... 23.Sep.09) . . . . RE: FIXED - Error cleaning up agent... (Oscar Arroyo 15.Jun.08) . . . . RE: FIXED - Error cleaning up agent... (Kam India 25.Jun.09) . . TECHNOTES on "Error cleaning up age... (Giulio Campobas... 10.May.11) Document options Print this page Search this forum Forum views and searc
PythonProgetti e case studyAspetti tecniciPlonegovReport e pubblicazioniTutorialWeb design Info Apr 12, 2012 "Error cleaning up agent threads" - a never ending story Tweet by Andrea Baglioni 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 http://www-10.lotus.com/ldd/nd6forum.nsf/0/69265d291069e1ea852571ca003d6871?OpenDocument 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 ....); where class was imported into the project. Investigating the Script Libraries containing the class I discovered that it was defined as follows: public class Utils extends AgentBase { In practice, the class is defined to http://blog.redturtle.it/2012/04/12/error-cleaning-up-agent-threads-a-never-ending-story 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 Send to a Friend Print this Permalink Filed under: Lotus, web, Domino, java Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus Archive 2015 November(1) October(1) September(2) August(2) July(2) June(2) May(2) April(2) March(1) February(1) January(3) 2014 December(3) November(6) October(5) September(4) August(2) July(6) June(4) May(5) April(5) March(5) February(6) January(4) 2013 December(3) November(6) October(8) September(6) August(5) July(9) June(6) May(8) April(6) March(8) February(8) January(5) 2012 December(5) November(8) October(12) Sep
« vorheriges nächstes » Seiten: [1] Autor Thema: Java Agent "Error cleaning up agent threads" (Gelesen 9206 mal) machineslave Senior Mitglied Offline Geschlecht: Beiträge: 326 Java Agent "Error cleaning http://atnotes.de/index.php?topic=28200.0;prev_next=prev up agent threads" « am: 19.12.05 - 17:31:04 » Hallo,Ich habe einen Java-Agenten, der über JDBC Daten aus einer DB2 liest und in einer Notes-DB speichert. Der Agent läuft einwandfrei durch, allerdings bekomme ich auf der Konsole die Meldung "Error cleaning up agent threads". Wenn ich den Agenten des öfteren laufen lasse, so bekomme ich irgendwann eine Out of Memory Fehlermeldung.Ich habe auch lotus notes schon die ganze Thematik bzgl. recycle() eingebaut, aber irgendwie komme ich da nicht weiter.Hier mal eine (verkürzte) Version meiner Java-Klassen:import lotus.domino.*;import java.sql.*;public class ImportAS400Data extends AgentBase { Log log; Session session; Database db; AgentContext agentContext; Document styleDoc; String username, system, password, library, param; public void NotesMain() {try { Session session = lotus notes error getSession(); AgentContext agentContext = session.getAgentContext(); Log log = session.createLog("Photoalbum"); log.openNotesLog("HierStehtDerServername", "develop\log.nsf"); db = agentContext.getCurrentDatabase(); View configView = db.getView("Configuration"); View activeJobView = db.getView("Active Job"); View inboxView = db.getView("($Inbox)"); Document activeDoc = activeJobView.getFirstDocument(); Document as400Doc = configView.getDocumentByKey("AS400"); system = as400Doc.getItemValueString("AS400System"); username = as400Doc.getItemValueString("AS400User"); password = as400Doc.getItemValueString("AS400Password"); library = as400Doc.getItemValueString("AS400Library"); if (activeDoc == null) // Kein aktiver Job { activeDoc = inboxView.getFirstDocument(); if (activeDoc != null) // Neues Dokument gefunden { // Dokument in Job queue und