javaxpageslotus-domino

Thread is not enabled for auto GC


When running in XPages environment:

NotesDatabase db = new NotesDatabase(ExtLibUtil.getCurrentSession(), "", fakenamesPath);

I get message:

HTTP JVM: java.lang.IllegalStateException: Thread is not enabled for auto GC. Either run your code via NotesGC.runWithAutoGC(Callable) or via try-with-resources on the object returned by NotesGC.initThread().

On https://www.mindoo.com/web/blog.nsf/dx/16.01.2017082125KLEAMY.htm?opendocument&comments I read

"Since they are integrated with the JSF lifecycle, memory management is automatically handled by the plugin. That means that code using the API does not have to be wrapped in NotesGC.runWithAutoGC() blocks to automatically recycle allocated C handles and memory after a HTTP request."

I installed version domino-jna-xpages-0.9.48

I am trying to run this sample application: http://linqed.eu/2018/10/02/query-domino-data-and-faceted-search-with-domino-jna-part-1/

Anyone a suggestion what is wrong/missing in my setup?


Solution

  • This was caused by two instances of DominoJNA on the server. See discussion on GitHub: https://github.com/klehmann/domino-jna/issues/79