Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11276

Confluence publisher plugin does not work with Confluence 4.0

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Atlassian made some updates on Confluence 4.0 remote API and changed the API version from 1 to 2. Actually Confluence 4.0 does not store pages as wiki markup anymore but now uses a XHTML based format.

      When configuring the confluence target page in a job configuration page the plugin test if the page exists and this exception is thrown:

      AxisFault
       faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
       faultSubcode: 
       faultString: com.atlassian.confluence.rpc.RemoteException: Unsupported operation: Wiki formatted content can no longer be retrieved from this API. Please use the version 2 API. The version 2 WSDL is available at: http://www/confluence/rpc/soap-axis/confluenceservice-v2?wsdl. XML-RPC requests should prefixed with "confluence2.". Please use getPageSummary() to get page data without its content.
       faultActor: 
       faultNode: 
       faultDetail: 
      	{}com.atlassian.confluence.rpc.RemoteException:null
      	{http://xml.apache.org/axis/}hostname:calva
      
      com.atlassian.confluence.rpc.RemoteException: Unsupported operation: Wiki formatted content can no longer be retrieved from this API. Please use the version 2 API. The version 2 WSDL is available at: http://www/confluence/rpc/soap-axis/confluenceservice-v2?wsdl. XML-RPC requests should prefixed with "confluence2.". Please use getPageSummary() to get page data without its content.
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at java.lang.Class.newInstance0(Class.java:355)
      	at java.lang.Class.newInstance(Class.java:308)
      	at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:104)
      	at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:90)
      	at hudson.plugins.confluence.soap.RemoteException.getDeserializer(RemoteException.java:75)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
      	at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
      	at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
      	at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
      	at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
      	at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
      	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
      	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
      	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      	at org.apache.axis.client.Call.invoke(Call.java:2767)
      	at org.apache.axis.client.Call.invoke(Call.java:2443)
      	at org.apache.axis.client.Call.invoke(Call.java:2366)
      	at org.apache.axis.client.Call.invoke(Call.java:1812)
      	at hudson.plugins.confluence.soap.ConfluenceserviceV1SoapBindingStub.getPage(ConfluenceserviceV1SoapBindingStub.java:4113)
      	at com.myyearbook.hudson.plugins.confluence.ConfluenceSession.getPage(ConfluenceSession.java:80)
      	at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher$DescriptorImpl.doPageNameCheck(ConfluencePublisher.java:398)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:234)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:159)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      	at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      	at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      	at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      	at java.lang.Thread.run(Thread.java:619)
      

        Attachments

          Activity

          Hide
          jhansche Joe Hansche added a comment -

          As a first iteration toward resolving this, I will first fix the problem of calling getPage() on the v1 API endpoint for a 4.0+ server (replaced with getPageSummary()). That will allow version 4.0+ Confluence servers to continue supporting artifact attachments, although page content editing will not be supported.

          A later update will be more aware of the storage differences and allow different methods of editing page content based on the endpoint version.

          Show
          jhansche Joe Hansche added a comment - As a first iteration toward resolving this, I will first fix the problem of calling getPage() on the v1 API endpoint for a 4.0+ server (replaced with getPageSummary()). That will allow version 4.0+ Confluence servers to continue supporting artifact attachments, although page content editing will not be supported. A later update will be more aware of the storage differences and allow different methods of editing page content based on the endpoint version.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Joe Hansche
          Path:
          pom.xml
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSession.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSite.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/Util.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/rpc/XmlRpcClient.java
          src/main/resources/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher/help-editorList.html
          src/main/wsdl/confluenceservice-v1.wsdl
          src/main/wsdl/v1.wsdl
          src/main/wsdl/v1.wsdl.pre_4.0
          src/main/wsdl/v2.wsdl
          http://jenkins-ci.org/commit/confluence-publisher-plugin/fda581a60920fb1ff514eae574c8273b4bdde2ac
          Log:
          Get closer to supporting Confluence 4.0, partially fixes JENKINS-11276

          The Confluence 4.0 update includes a new SOAP endpoint (v2), and the
          v1 endpoint's getPage() method now results in a remote error –
          suggesting instead to use getPageSummary(). The file attachment
          functionality did not rely on the wiki content being returned in
          getPage(), so we now use getPageSummary() for doing file attachments.

          Confluence 4.0 also introduces a new page content storage format,
          which means wiki markup is no longer supported. That means the page
          editing feature of the plugin will need to be updated to work with the
          v2 API's XHTML storage format. For now, we're just fixing the file
          attachment bug, and gracefully degrading on page content editing.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Joe Hansche Path: pom.xml src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher.java src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSession.java src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSite.java src/main/java/com/myyearbook/hudson/plugins/confluence/Util.java src/main/java/com/myyearbook/hudson/plugins/confluence/rpc/XmlRpcClient.java src/main/resources/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher/help-editorList.html src/main/wsdl/confluenceservice-v1.wsdl src/main/wsdl/v1.wsdl src/main/wsdl/v1.wsdl.pre_4.0 src/main/wsdl/v2.wsdl http://jenkins-ci.org/commit/confluence-publisher-plugin/fda581a60920fb1ff514eae574c8273b4bdde2ac Log: Get closer to supporting Confluence 4.0, partially fixes JENKINS-11276 The Confluence 4.0 update includes a new SOAP endpoint (v2), and the v1 endpoint's getPage() method now results in a remote error – suggesting instead to use getPageSummary(). The file attachment functionality did not rely on the wiki content being returned in getPage(), so we now use getPageSummary() for doing file attachments. Confluence 4.0 also introduces a new page content storage format, which means wiki markup is no longer supported. That means the page editing feature of the plugin will need to be updated to work with the v2 API's XHTML storage format. For now, we're just fixing the file attachment bug, and gracefully degrading on page content editing.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Joe Hansche
          Path:
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSession.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSite.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/Util.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/rpc/XmlRpcClient.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/AfterTokenEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/AppendEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/BeforeTokenEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/BetweenTokensEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/EntirePageEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/MarkupEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/PrependEditor.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/FileGenerator.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/MarkupGenerator.java
          src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/PlainTextGenerator.java
          src/main/resources/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher/help-editorList.html
          http://jenkins-ci.org/commit/confluence-publisher-plugin/18d80ef7a29e8f3a79d3c7e15f93a1c2105e2257
          Log:
          JENKINS-11276: A hack to get Confluence v4.0 markup edits working.

          In Confluence 4.0, you have to use the v2 SOAP endpoint in order
          to fetch the page content, and then the content can only be
          edited in an XML format.

          The plugin is not very intelligent at the moment, as far as
          understanding the new <ac:macro/>-style XML tags, and being able
          to simplify the token filtering process. Instead, you'll need
          to enter the tokens in their X(HT)ML format, which can be found
          by going to Tools > View Storage Format from a Confluence page.
          Also note that these tokens can simply be visible tokens within
          the markup.

          Compare: https://github.com/jenkinsci/confluence-publisher-plugin/compare/ede5d50...18d80ef

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Joe Hansche Path: src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher.java src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSession.java src/main/java/com/myyearbook/hudson/plugins/confluence/ConfluenceSite.java src/main/java/com/myyearbook/hudson/plugins/confluence/Util.java src/main/java/com/myyearbook/hudson/plugins/confluence/rpc/XmlRpcClient.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/AfterTokenEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/AppendEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/BeforeTokenEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/BetweenTokensEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/EntirePageEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/MarkupEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/editors/PrependEditor.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/FileGenerator.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/MarkupGenerator.java src/main/java/com/myyearbook/hudson/plugins/confluence/wiki/generators/PlainTextGenerator.java src/main/resources/com/myyearbook/hudson/plugins/confluence/ConfluencePublisher/help-editorList.html http://jenkins-ci.org/commit/confluence-publisher-plugin/18d80ef7a29e8f3a79d3c7e15f93a1c2105e2257 Log: JENKINS-11276 : A hack to get Confluence v4.0 markup edits working. In Confluence 4.0, you have to use the v2 SOAP endpoint in order to fetch the page content, and then the content can only be edited in an XML format. The plugin is not very intelligent at the moment, as far as understanding the new <ac:macro/>-style XML tags, and being able to simplify the token filtering process. Instead, you'll need to enter the tokens in their X(HT)ML format, which can be found by going to Tools > View Storage Format from a Confluence page. Also note that these tokens can simply be visible tokens within the markup. Compare: https://github.com/jenkinsci/confluence-publisher-plugin/compare/ede5d50...18d80ef
          Hide
          jhansche Joe Hansche added a comment -

          This has been released to the plugin repository as version 1.3.

          It's a bit hacked-in at the moment, but I've been able to successfully reproduce the same results I had against Confluence 3.4.

          It's possible that you may need to add HTML markup (e.g., wrap in <p /> tags, or provide newlines where needed).

          Take a look at the Confluence Publisher Plugin wiki documentation for some usable examples.

          Show
          jhansche Joe Hansche added a comment - This has been released to the plugin repository as version 1.3. It's a bit hacked-in at the moment, but I've been able to successfully reproduce the same results I had against Confluence 3.4. It's possible that you may need to add HTML markup (e.g., wrap in <p /> tags, or provide newlines where needed). Take a look at the Confluence Publisher Plugin wiki documentation for some usable examples.

            People

            • Assignee:
              sirot Jean-Christophe Sirot
              Reporter:
              sirot Jean-Christophe Sirot
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: