Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-880

Glassfish 4 Wrong Chars Solution - Brasil PT

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.10.1
    • Fix Version/s: None
    • Component/s: Filters

      Description

      When I deployed the application in glassfish 4 saw strange characters .
      After source debug, I found the problem and fix this:
      I changed m_output on line 284 of file WikiJSPFilter for ByteArrayOutputStream type.
      Obviously MyServletOutputStream class was modified to accept the new type.
      I do not know that this change will harm other JEE Servers but I have helped

      1. JSPWIKI-880.patch
        2 kB
        Harry Metske
      2. WikiJSPFilter.java
        15 kB
        Renato Grosz

        Issue Links

          Activity

          Hide
          pillingworth Paul Illingworth added a comment -

          Just hit the same problem on Glassfish 4.1. I tracked the issue down and modified WikiJSPFilter in almost the same way as above before I found this ticket.

          I have now taken the above patch and can confirm all is working fine with my © symbols again!

          Show
          pillingworth Paul Illingworth added a comment - Just hit the same problem on Glassfish 4.1. I tracked the issue down and modified WikiJSPFilter in almost the same way as above before I found this ticket. I have now taken the above patch and can confirm all is working fine with my © symbols again!
          Hide
          metskem Harry Metske added a comment -

          Fixed in 2.10.2-svn-15 .

          I did an additional test on WebSphere Liberty Profile, it suffered from the same issue (but also got fixed this way).

          Show
          metskem Harry Metske added a comment - Fixed in 2.10.2-svn-15 . I did an additional test on WebSphere Liberty Profile, it suffered from the same issue (but also got fixed this way).
          Hide
          renatogrosz Renato Grosz added a comment -

          It was an honor to help.
          Obrigado por tudo.

          Show
          renatogrosz Renato Grosz added a comment - It was an honor to help. Obrigado por tudo.
          Hide
          metskem Harry Metske added a comment -

          Renato,

          I tested your patch (see attached) on Tomcat, works fine.

          I like to hear the opinions of fellow committers for this patch before committing it.

          tx,
          Harry

          Show
          metskem Harry Metske added a comment - Renato, I tested your patch (see attached) on Tomcat, works fine. I like to hear the opinions of fellow committers for this patch before committing it. tx, Harry
          Hide
          renatogrosz Renato Grosz added a comment - - edited

          By default , useOutputStreamValue is false in 157 UtilJ2eeCompat line , I forced true and rendering was good but problems occur when I perform editing pages.:
          The Exception below occurs when I perform editing a page and click on Save

          {{

          StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
          java.lang.IllegalStateException: getWriter() has already been called for this response
          at org.apache.catalina.connector.Response.getOutputStream(Response.java:746)
          at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:206)
          at org.apache.wiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:136)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
          at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
          at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
          at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
          at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
          at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
          at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
          at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
          at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
          at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
          at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
          at java.lang.Thread.run(Thread.java:722)

          #]
          }}
          Show
          renatogrosz Renato Grosz added a comment - - edited By default , useOutputStreamValue is false in 157 UtilJ2eeCompat line , I forced true and rendering was good but problems occur when I perform editing pages.: The Exception below occurs when I perform editing a page and click on Save {{ – StandardWrapperValve [jsp] : Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getWriter() has already been called for this response at org.apache.catalina.connector.Response.getOutputStream(Response.java:746) at org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:206) at org.apache.wiki.ui.WikiJSPFilter.doFilter(WikiJSPFilter.java:136) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:722) #] }}
          Hide
          renatogrosz Renato Grosz added a comment -

          2015-04-02 23:54:40,659 [main] INFO org.apache.wiki.WikiEngine - *******************************************
          2015-04-02 23:54:40,664 [main] INFO org.apache.wiki.WikiEngine - JSPWiki 2.10.1 starting. Whee!
          2015-04-02 23:54:40,671 [main] INFO org.apache.wiki.WikiEngine - Servlet container: GlassFish Server Open Source Edition 4.0

          Show
          renatogrosz Renato Grosz added a comment - 2015-04-02 23:54:40,659 [main] INFO org.apache.wiki.WikiEngine - ******************************************* 2015-04-02 23:54:40,664 [main] INFO org.apache.wiki.WikiEngine - JSPWiki 2.10.1 starting. Whee! 2015-04-02 23:54:40,671 [main] INFO org.apache.wiki.WikiEngine - Servlet container: GlassFish Server Open Source Edition 4.0
          Hide
          metskem Harry Metske added a comment -

          Renato, I think this has to be fixed in UtilJ2eeCompat.

          Can you paste here a few lines of your jspwiki logfile when it has just started, in particular the following lines :

          2015-04-07 20:35:12,011 INFO wiki.WikiEngine - *******************************************
          2015-04-07 20:35:12,013 INFO wiki.WikiEngine - JSPWiki 2.10.2-svn-10 starting. Whee!
          2015-04-07 20:35:12,019 INFO wiki.WikiEngine - Servlet container: Apache Tomcat/8.0.12
          

          So we know what the Servlet container is. Then we can patch UtilJ2eeCompat (again).

          kind regards,
          Harry

          Show
          metskem Harry Metske added a comment - Renato, I think this has to be fixed in UtilJ2eeCompat. Can you paste here a few lines of your jspwiki logfile when it has just started, in particular the following lines : 2015-04-07 20:35:12,011 INFO wiki.WikiEngine - ******************************************* 2015-04-07 20:35:12,013 INFO wiki.WikiEngine - JSPWiki 2.10.2-svn-10 starting. Whee! 2015-04-07 20:35:12,019 INFO wiki.WikiEngine - Servlet container: Apache Tomcat/8.0.12 So we know what the Servlet container is. Then we can patch UtilJ2eeCompat (again). kind regards, Harry
          Hide
          renatogrosz Renato Grosz added a comment -

          Good morning guys.
          Sorry, I'm using google translator to help me.
          As I understand this correction should be at version 2.10.1. For the GlenJSP396.patch file Glen Mazza or WikiJSPFilter.java.diff Jurgen Weber have almost the change I made.
          But the source code that I downloaded (jspwiki-builder-2.10.1-source-release.zip) does not contain this change.
          I am sending the attached file aquivo how correct.

          Show
          renatogrosz Renato Grosz added a comment - Good morning guys. Sorry, I'm using google translator to help me. As I understand this correction should be at version 2.10.1. For the GlenJSP396.patch file Glen Mazza or WikiJSPFilter.java.diff Jurgen Weber have almost the change I made. But the source code that I downloaded (jspwiki-builder-2.10.1-source-release.zip) does not contain this change. I am sending the attached file aquivo how correct.
          Hide
          weberjn Jürgen Weber added a comment -

          I guess your's is the same problem.

          Show
          weberjn Jürgen Weber added a comment - I guess your's is the same problem.

            People

            • Assignee:
              metskem Harry Metske
              Reporter:
              renatogrosz Renato Grosz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development