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

Unsupported character exception is warned in console when downloading attachment

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 8.4.5, 10.7, 10.9, 10.10-rc-1
    • Fix Version/s: 10.11-rc-1
    • Component/s: Old Core
    • Environment:
      Windows 7, JDK 1.8.0_144, Tomcat 8.5.20, MySQL 5.5.39, MySQL Connector/J 5.1.43
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      To set default language to Chinese by changing following stuffs.
      Settings in web.xml.

      • parameter [encoding] of SetCharacterEncodingFilter to UTF-8 (default UTF-8)

      Settings in xwiki.cfg.

      • property xwiki.encoding to UTF-8 (default is UTF-8)

      Settings in hibernate.cfg.xml in which MySQL is used instead of HSQLDB.

      • property hibernate.connection.charSet to UTF-8 (no default)
      • property hibernate.connection.useUnicode to true (no default)
      • property hibernate.connection.characterEncoding to utf8 (no default)

      In XWiki administration page under location catagories.

      • Enable multiple languange support
      • Supported languages as Chinese (ZH) and English (en)
      • Default languange is set to Chinese.

      After saving changes and restart the XWiki instance, everything looks fine. I am able set the Wiki descriptor in Chinese and I also compose a page with title and content both in Chinese. The only flaw is that a warning is printed on console from time to time (maybe everytime I refresh the page). The stack trace of warning is as following.

      21-Aug-2017 18:35:16.532 警告 [http://localhost:8080/xwiki/wiki/healthknownledgebase/download/Main/SolrSearch/dark-grey-disclosure-arrow-left.png] org.apache.catalina.connector.Response.setCharacterEncoding The encoding [] is not recognised by the JRE
       java.lang.IllegalArgumentException: java.io.UnsupportedEncodingException: The character encoding [] is not supported
              at org.apache.coyote.Response.setCharacterEncoding(Response.java:417)
              at org.apache.catalina.connector.Response.setCharacterEncoding(Response.java:848)
              at org.apache.catalina.connector.ResponseFacade.setCharacterEncoding(ResponseFacade.java:624)
              at com.xpn.xwiki.web.XWikiServletResponse.setCharacterEncoding(XWikiServletResponse.java:154)
              at com.xpn.xwiki.web.DownloadAction.setCommonHeaders(DownloadAction.java:446)
              at com.xpn.xwiki.web.DownloadAction.sendContent(DownloadAction.java:301)
              at com.xpn.xwiki.web.DownloadAction.render(DownloadAction.java:183)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:447)
              at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:136)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
              at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
              at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
              at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
              at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.UnsupportedEncodingException: The character encoding [] is not supported
              at org.apache.tomcat.util.buf.B2CConverter.getCharsetLower(B2CConverter.java:100)
              at org.apache.tomcat.util.buf.B2CConverter.getCharset(B2CConverter.java:76)
              at org.apache.coyote.Response.setCharacterEncoding(Response.java:415)
              ... 54 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmortagne Thomas Mortagne
                Reporter:
                schua Flik Shen
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: