Uploaded image for project: 'Maven Site Plugin'
  1. Maven Site Plugin
  2. MSITE-754

ConcurrentModificationException when using site:run

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.5
    • Component/s: site:run
    • Labels:
      None
    • Environment:
      Maven 2.2.1 with maven-site-plugin 3.0

      Description

      When using maven with site:run I get the following exception, which seem to originate from the Doxia Site Renderer

      2012-04-04 12:27:07.653:WARN::/css/maven-theme.css
      java.util.ConcurrentModificationException
              at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
              at java.util.AbstractList$Itr.next(AbstractList.java:343)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.locateDocumentFiles(DefaultSiteRenderer.java:149)
              at org.apache.maven.plugins.site.webapp.DoxiaFilter.doFilter(DoxiaFilter.java:174)
              at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
              at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
              at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
              at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
              at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
              at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
              at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
              at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
              at org.mortbay.jetty.Server.handle(Server.java:326)
              at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
              at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
              at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
              at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
              at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
              at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
              at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      2012-04-04 12:27:07.656:WARN::/images/logos/maven-feather.png
      java.util.ConcurrentModificationException
              at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
              at java.util.AbstractList$Itr.next(AbstractList.java:343)
              at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.locateDocumentFiles(DefaultSiteRenderer.java:149)
              at org.apache.maven.plugins.site.webapp.DoxiaFilter.doFilter(DoxiaFilter.java:174)
              at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
              at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
              at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
              at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
              at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
              at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
              at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
              at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
              at org.mortbay.jetty.Server.handle(Server.java:326)
              at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
              at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
              at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
              at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
              at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
              at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
              at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      The following source code in org.apache.maven.doxia.siterenderer.DefaultSiteRenderer (line 149) seems to contain the problem:

      149  for ( File siteDirectory : siteRenderingContext.getSiteDirectories() )
      150         {
      151             if ( siteDirectory.exists() )
      152             {
      153                 Collection<SiteModule> modules = siteModuleManager.getSiteModules();
      154                 for ( SiteModule module : modules )
      155                 {
      156                     File moduleBasedir = new File( siteDirectory, module.getSourceDirectory() );
      157 
      158                     if ( moduleExcludes != null && moduleExcludes.containsKey( module.getParserId() ) )
      159                     {
      160                         addModuleFiles( moduleBasedir, module, moduleExcludes.get( module.getParserId() ),
      161                                 files );
      162                     }
      163                     else
      164                     {
      165                         addModuleFiles( moduleBasedir, module, null, files );
      166                     }
      167                 }
      168             }
      169         }

      Iterating over a clone of the siteDirectories should make this code much more robust and should generally fix this problem.

        Attachments

        1. testmvnsite.zip
          5 kB
          Christof Schöll

          Activity

            People

            • Assignee:
              hboutemy Herve Boutemy
              Reporter:
              c.schoell Christof Schöll
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: