When using pages with heavy directory usage (such as forms with many vocabulary access) with several concurrent users one can get the following crash:
Caused by: org.nuxeo.ecm.directory.DirectoryException: Could not find directory name while rebuilding session with id: 1
at org.nuxeo.ecm.platform.directory.ejb.DirectoryManagerBean.getSession(DirectoryManagerBean.java:107)
at org.nuxeo.ecm.platform.directory.ejb.DirectoryManagerBean.close(DirectoryManagerBean.java:127)
at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
This is due to the fact that the sessions maps are static while the session counter is not. A proposed patch will be attached in comments.