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

NullPointerException thrown when switching to Source tab before the rich text area has finished loading

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.1 RC1, 2.0.5
    • 2.0.2
    • WYSIWYG Editor
    • None
    • Integration
    • Easy

    Description

      Follow this steps to reproduce:

      • create a new page and put a lot of content to increase the page loading time (code macro helps here) then save the page
      • load the page in WYSIWYG edit mode (enable firebug in order to increase the page loading time more)
      • switch to Source tab quickly before the rich text area has finished loading

      This is what is printed in the server log:

      java.lang.NullPointerException
      	at java.io.StringReader.<init>(StringReader.java:50)
      	at com.xpn.xwiki.wysiwyg.server.cleaner.internal.DefaultHTMLCleaner.clean(DefaultHTMLCleaner.java:69)
      	at com.xpn.xwiki.wysiwyg.server.converter.internal.DefaultHTMLConverter.fromHTML(DefaultHTMLConverter.java:97)
      	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:616)
      	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
      	at com.xpn.xwiki.wysiwyg.server.XWikiRemoteServiceServlet.processCall(XWikiRemoteServiceServlet.java:54)
      	at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      2009-10-22 17:12:13.351:/xwiki:WARN:  Exception while dispatching incoming RPC call
      com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.xpn.xwiki.wysiwyg.client.converter.HTMLConverter.fromHTML(java.lang.String,java.lang.String)' threw an unexpected exception: java.lang.RuntimeException: Exception while parsing HTML
      	at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
      	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
      	at com.xpn.xwiki.wysiwyg.server.XWikiRemoteServiceServlet.processCall(XWikiRemoteServiceServlet.java:54)
      	at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      	at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:326)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      Caused by: java.lang.RuntimeException: Exception while parsing HTML
      	at com.xpn.xwiki.wysiwyg.server.converter.internal.DefaultHTMLConverter.fromHTML(DefaultHTMLConverter.java:110)
      	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:616)
      	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
      	... 30 more
      Caused by: java.lang.NullPointerException
      	at java.io.StringReader.<init>(StringReader.java:50)
      	at com.xpn.xwiki.wysiwyg.server.cleaner.internal.DefaultHTMLCleaner.clean(DefaultHTMLCleaner.java:69)
      	at com.xpn.xwiki.wysiwyg.server.converter.internal.DefaultHTMLConverter.fromHTML(DefaultHTMLConverter.java:97)
      	... 35 more
      

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: