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

File upload plugin doesn't strip the file path in IE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.4.4, 2.5, 2.6 RC1
    • 2.4.3, 2.5 RC1
    • None
    • Office, Import, fails, Internet, Explorer, create, page
    • High
    • Trivial

    Description

      Office import fails when XWiki Enterprise is running on Windows and Internet Explorer is used because file upload plugin doesn't strip the file path when returning the name of the uploaded file and as a consequence office importer module creates a path that is not valid on Windows (it is valid on linux though). See below:

      When trying to import an Office file to create a new page the import fails. It does not fail when trying to import the file via the WYSIWYG editor. Judging by the error log (see below) I assume something is not working with the uploading process and possibly the transition from the upload path (local) and the uploaded path (remote/server). Note that, according to the log, apparently the Importer tries to load the file from a path that is basically "[remote-work-path][complete-local-path]".

      Another very interesting fact is that this error happens when using Internet Explorer 7 but does not happen when using Opera 10.62! (On a different note, despite Opera not having this bug it shows various other bugs when using XWiki so it can not work as a real substitute...)

      The Error log:
      2010-10-12 10:20:57,031 http://de-w-0156852/bin/view/XWiki/OfficeImporterResults ERROR rterVelocityContextInitializer - Error while converting document [C:\Data\Stulle\Test.doc] into html.
      org.xwiki.officeimporter.OfficeImporterException: Error while converting document [C:\Data\Stulle\Test.doc] into html.
      at org.xwiki.officeimporter.internal.builder.DefaultXHTMLOfficeDocumentBuilder.build(DefaultXHTMLOfficeDocumentBuilder.java:88)
      at org.xwiki.officeimporter.internal.builder.DefaultXDOMOfficeDocumentBuilder.build(DefaultXDOMOfficeDocumentBuilder.java:74)
      at org.xwiki.officeimporter.OfficeImporterVelocityBridge.officeToXDOM(OfficeImporterVelocityBridge.java:214)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
      at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:493)
      at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
      at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:196)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:161)
      at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:118)
      at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:44)
      at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:299)
      at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:191)
      at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
      at org.xwiki.rendering.internal.transformation.MacroTransformation.transformOnce(MacroTransformation.java:172)
      at org.xwiki.rendering.internal.transformation.MacroTransformation.transform(MacroTransformation.java:117)
      at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:85)
      at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:7403)
      at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:7353)
      at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:830)
      at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:781)
      at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:873)
      at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:527)
      at sun.reflect.GeneratedMethodAccessor291.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
      at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:493)
      at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
      at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:196)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:161)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
      at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1862)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1800)
      at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:896)
      at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
      at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
      at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
      at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
      at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:196)
      at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:161)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1910)
      at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1832)
      at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:155)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:226)
      at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:117)
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:129)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:218)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:267)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:245)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:260)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.xwiki.officeimporter.openoffice.OpenOfficeConverterException: Error while performing conversion.
      at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:118)
      at org.xwiki.officeimporter.internal.builder.DefaultXHTMLOfficeDocumentBuilder.build(DefaultXHTMLOfficeDocumentBuilder.java:85)
      ... 117 more
      Caused by: java.io.FileNotFoundException: C:\XWiki\Tomcat\work\Catalina\localhost_\61b4de59-44e8-4180-84d3-2933a4ab1830\input\C:\Data\Stulle\Test.doc (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeConverter.convert(DefaultOpenOfficeConverter.java:94)
      ... 118 more

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            stulle Stulle Ich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: