Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-2627

Re-uploading a resource that was existing prior to M5 fails with NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.2.2
    • Fix Version/s: 5.2.2
    • Component/s: forms
    • Labels:
    • Magnolia Release:
      5.2.2

      Description

      Trying to upload a new image in stk - resources results in a NPE:

      2014-01-24 07:22:05,101 WARN  .magnolia.ui.form.field.upload.AbstractUploadField: Upload failed for file branding.png 
      2014-01-24 07:22:05,170 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
      com.vaadin.server.UploadException: Upload failed
      	at com.vaadin.server.communication.FileUploadHandler.streamToReceiver(FileUploadHandler.java:594)
      	at com.vaadin.server.communication.FileUploadHandler.handleFileUploadValidationAndData(FileUploadHandler.java:432)
      	at com.vaadin.server.communication.FileUploadHandler.doHandleSimpleMultipartFileUpload(FileUploadHandler.java:395)
      	at com.vaadin.server.communication.FileUploadHandler.handleRequest(FileUploadHandler.java:280)
      	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1371)
      	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238)
      	at info.magnolia.ui.admincentral.AdmincentralVaadinServlet.service(AdmincentralVaadinServlet.java:131)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      	at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:129)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:67)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.VirtualUriFilter.doFilter(VirtualUriFilter.java:70)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:76)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.RangeSupportFilter.doFilter(RangeSupportFilter.java:86)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:60)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.security.SecurityCallbackFilter.doFilter(SecurityCallbackFilter.java:86)
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:61)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:93)
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:61)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.module.templatingkit.filters.SiteMergeFilter.doFilter(SiteMergeFilter.java:106)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.MultiChannelFilter.doFilter(MultiChannelFilter.java:82)
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:61)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:73)
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:61)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:104)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:85)
      	at info.magnolia.module.devicedetection.filter.DeviceDetectionFilter.doFilter(DeviceDetectionFilter.java:71)
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:61)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:104)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:132)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:83)
      	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:67)
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:91)
      	at info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter(SafeDestroyMgnlFilterWrapper.java:108)
      	at info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:67)
      	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:108)
      	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:94)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method uploadFinished in info.magnolia.ui.form.field.upload.basic.BasicUploadField failed.
      	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:528)
      	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:167)
      	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:969)
      	at com.vaadin.ui.Upload.fireUploadSuccess(Upload.java:811)
      	at com.vaadin.ui.Upload$1.streamingFinished(Upload.java:1070)
      	at com.vaadin.server.communication.FileUploadHandler.streamToReceiver(FileUploadHandler.java:567)
      	... 81 more
      Caused by: java.lang.NullPointerException
      	at info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper.populateItem(BasicFileItemWrapper.java:226)
      	at info.magnolia.ui.form.field.upload.basic.BasicFileItemWrapper.populateFromReceiver(BasicFileItemWrapper.java:162)
      	at info.magnolia.ui.form.field.upload.AbstractUploadField.uploadFinished(AbstractUploadField.java:384)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
      	... 86 more
      
      

      Steps to reproduce:

      • Go to STK > Resources app
      • Select a pre-existing image from templating kit, e.g. /templating-kit/themes/pop/img/bgs/branding
      • Edit resource and select new image to upload
      • BOOM

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mgeljic Mikaël Geljić
              Reporter:
              dlipp Daniel Lipp
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: