Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16445

ArrayIndexOutOfBoundsException while doing XAR file import

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      I got an ArrayIndexOutOfBoundsException while doing some heavy XAR importing (and there might have been more than one import running in parallel by accident).

      It looks very similar to https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6231579 i.e. incorrectly using a java.text.SimpleDateFormat from multiple threads without synchronization in com.xpn.xwiki.objects.DateProperty.toText().

      Here is the backtrace:

      2019-05-29 12:24:21,015 [http://xwikitest:8080/xwiki/rest/wikis/xwiki] ERROR .o.i.DefaultObservationManager - Failed to send event [org.xwiki.bridge.event.DocumentUpdatedEvent@1abfb2c4] to listener [com.xpn.xwiki.internal.event.XObjectEventGeneratorListener@492ce4c7] }}
      {{java.lang.ArrayIndexOutOfBoundsException: 98}}
      {{ at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:453)}}
      {{ at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2397)}}
      {{ at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2312)}}
      {{ at java.util.Calendar.complete(Calendar.java:2268)}}
      {{ at java.util.Calendar.get(Calendar.java:1826)}}
      {{ at java.text.SimpleDateFormat.subFormat(SimpleDateFormat.java:1119)}}
      {{ at java.text.SimpleDateFormat.format(SimpleDateFormat.java:966)}}
      {{ at java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)}}
      {{ at java.text.DateFormat.format(DateFormat.java:305)}}
      {{ at java.text.Format.format(Format.java:157)}}
      {{ at com.xpn.xwiki.objects.DateProperty.toText(DateProperty.java:63)}}
      {{ at com.xpn.xwiki.objects.BaseObject.getDiff(BaseObject.java:272)}}
      {{ at com.xpn.xwiki.doc.XWikiDocument.getObjectDiff(XWikiDocument.java:6303)}}
      {{ at com.xpn.xwiki.internal.event.XObjectEventGeneratorListener.onDocumentUpdatedEvent(XObjectEventGeneratorListener.java:137)}}
      {{ at com.xpn.xwiki.internal.event.XObjectEventGeneratorListener.onEvent(XObjectEventGeneratorListener.java:84)}}
      {{ at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:304)}}
      {{ at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:269)}}
      {{ at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1812)}}
      {{ at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1718)}}
      {{ at com.xpn.xwiki.plugin.packaging.Package.installDocument(Package.java:911)}}
      {{ at com.xpn.xwiki.plugin.packaging.Package.install(Package.java:704)}}
      {{ at com.xpn.xwiki.plugin.packaging.PackageAPI.install(PackageAPI.java:314)}}
      {{ at org.xwiki.rest.internal.resources.wikis.WikiResourceImpl.importXAR(WikiResourceImpl.java:129)}}
      {{ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)}}
      {{ at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)}}
      {{ at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}}
      {{ at java.lang.reflect.Method.invoke(Method.java:498)}}
      {{ at org.restlet.ext.jaxrs.internal.wrappers.AbstractMethodWrapper.internalInvoke(AbstractMethodWrapper.java:162)}}
      {{ at org.restlet.ext.jaxrs.internal.wrappers.ResourceMethod.invoke(ResourceMethod.java:283)}}
      {{ at org.restlet.ext.jaxrs.JaxRsRestlet.invokeMethod(JaxRsRestlet.java:997)}}
      {{ at org.restlet.ext.jaxrs.JaxRsRestlet.handle(JaxRsRestlet.java:746)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Router.doHandle(Router.java:422)}}
      {{ at org.restlet.routing.Router.handle(Router.java:641)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)}}
      {{ at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77)}}
      {{ at org.restlet.Application.handle(Application.java:385)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Router.doHandle(Router.java:422)}}
      {{ at org.restlet.routing.Router.handle(Router.java:641)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.routing.Router.doHandle(Router.java:422)}}
      {{ at org.restlet.routing.Router.handle(Router.java:641)}}
      {{ at org.restlet.routing.Filter.doHandle(Filter.java:150)}}
      {{ at org.restlet.routing.Filter.handle(Filter.java:197)}}
      {{ at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)}}
      {{ at org.restlet.Component.handle(Component.java:408)}}
      {{ at org.restlet.Server.handle(Server.java:507)}}
      {{ at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)}}
      {{ at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)}}
      {{ at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)}}
      {{ at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)}}
      {{ at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)}}
      {{ at org.xwiki.wysiwyg.filter.XWikiContextInitializationFilter.doFilter(XWikiContextInitializationFilter.java:85)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)}}
      {{ at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)}}
      {{ at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)}}
      {{ at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)}}
      {{ at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)}}
      {{ at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)}}
      {{ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)}}
      {{ at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)}}
      {{ at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)}}
      {{ at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)}}
      {{ at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)}}
      {{ at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)}}
      {{ at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)}}
      {{ at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)}}
      {{ at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)}}
      {{ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)}}
      {{ at org.eclipse.jetty.server.Server.handle(Server.java:503)}}
      {{ at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)}}
      {{ at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)}}
      {{ at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)}}
      {{ at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)}}
      {{ at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)}}
      {{ at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)}}
      {{ at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)}}
      {{ at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)}}
      {{ at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)}}
      {{ at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)}}
      {{ at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)}}
      {{ at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)}}
      {{ at java.lang.Thread.run(Thread.java:748)
      

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              mslw Martin Simmons
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: