Bug in LDAP groups - org.jivesoftware.util.cache.DefaultCache - java.util.RandomAccessSubList

When using

ldap.clientSideSorting = true

There is a problem with groups - it may or may not be a generic problem and it may be related to another bug reported in another thread, which causes the size of the group list to be 0.

However, when it tries to put an empty sublist to the cache, the following exception occurs in the log.

2011.12.08 11:34:15 org.jivesoftware.util.cache.DefaultCache - java.util.RandomAccessSubList
java.io.NotSerializableException: java.util.RandomAccessSubList
        at java.io.ObjectOutputStream.writeObject0(Unknown Source)
        at java.io.ObjectOutputStream.writeObject(Unknown Source)
        at org.jivesoftware.util.cache.DefaultCache.calculateSize(DefaultCache.java:583)
        at org.jivesoftware.util.cache.DefaultCache.put(DefaultCache.java:141)
        at org.jivesoftware.util.cache.CacheWrapper.put(CacheWrapper.java:129)
        at org.jivesoftware.openfire.group.GroupManager.getGroups(GroupManager.java:420)
        at org.jivesoftware.openfire.admin.group_002dsummary_jsp._jspService(group_002dsummary_jsp.java:80)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:74)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:50)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:78)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:164)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494)
        at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
        at org.eclipse.jetty.server.Server.handle(Server.java:334)
        at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
        at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
        at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
        at java.lang.Thread.run(Unknown Source)

Can you try a patch attached to the OF-497?

Those stacktraces are warning-only though, they don’t affect the way the Openfire handles LDAP responses much.

I have imported the openfire sources to Eclipse and applied the patches, but I don’t know how to run either the Eclipse built version or how to deploy the modified classes to an existing Openfire installation. Any pointers?

Just run “ant” in the “build” directory. It will generate a new “openfire.jar” in “work/lib”. You may run “ant” from the command line (if you have it in your %PATH% or $PATH) or use Eclipse right clicking on the build.xml file or something like that. This should work independently of any errors Eclipse may show you because of missing libraries or something.

If you have “patch” you don’t even need to use Eclipse at all.