java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

Atlassian JIRA | Doug Balmer | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    This snippet of relevant perl code: {code} my %pageoptions = ( minorEdit => 1, versionComment => 'Auto generated', ); $wiki = XMLRPC::Lite -> proxy($url) -> uri ($url); $authToken = $wiki->call('confluence2.login', $user,$pass)->result(); $page = $wiki->call('confluence2.getPage', $authToken, $myspace, $mypage)->result(); $page->{content} = "<p>hello</p>"; $result = $wiki->call('confluence2.updatePage', $authToken, $page, \%pageoptions)->result(); print "Updated page with result $result\n"; {code} causes a Java exception on the server and fails to update the page. {code} 2014-08-18 12:14:24,915 INFO [TP-Processor43] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Executing remote API method [ getPage ] as user [ dbalmer ] 2014-08-18 12:14:25,078 INFO [TP-Processor1] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Executing remote API method [ updatePage ] as user [ dbalmer ] 2014-08-18 12:14:25,079 ERROR [TP-Processor1] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Error during invocation of method: updatePage -- url: /rpc/xmlrpc | userName: dbalmer | method: updatePage java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.convertLong(XmlRpcUtils.java:53) at com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.createRemotePageFromPageStruct(XmlRpcUtils.java:21) at com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.updatePage(ConfluenceXmlRpcHandlerImpl.java:442) at sun.reflect.GeneratedMethodAccessor1182.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invokeAuthenticatedMethod(TokenAuthenticationInvocationHandler.java:93) at com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invoke(TokenAuthenticationInvocationHandler.java:69) at com.sun.proxy.$Proxy2277.updatePage(Unknown Source) 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.xmlrpc.Invoker.execute(Invoker.java:130) at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84) {code}

    Atlassian JIRA | 3 years ago | Doug Balmer
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
  2. 0

    This snippet of relevant perl code: {code} my %pageoptions = ( minorEdit => 1, versionComment => 'Auto generated', ); $wiki = XMLRPC::Lite -> proxy($url) -> uri ($url); $authToken = $wiki->call('confluence2.login', $user,$pass)->result(); $page = $wiki->call('confluence2.getPage', $authToken, $myspace, $mypage)->result(); $page->{content} = "<p>hello</p>"; $result = $wiki->call('confluence2.updatePage', $authToken, $page, \%pageoptions)->result(); print "Updated page with result $result\n"; {code} causes a Java exception on the server and fails to update the page. {code} 2014-08-18 12:14:24,915 INFO [TP-Processor43] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Executing remote API method [ getPage ] as user [ dbalmer ] 2014-08-18 12:14:25,078 INFO [TP-Processor1] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Executing remote API method [ updatePage ] as user [ dbalmer ] 2014-08-18 12:14:25,079 ERROR [TP-Processor1] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Error during invocation of method: updatePage -- url: /rpc/xmlrpc | userName: dbalmer | method: updatePage java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.convertLong(XmlRpcUtils.java:53) at com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.createRemotePageFromPageStruct(XmlRpcUtils.java:21) at com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.updatePage(ConfluenceXmlRpcHandlerImpl.java:442) at sun.reflect.GeneratedMethodAccessor1182.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invokeAuthenticatedMethod(TokenAuthenticationInvocationHandler.java:93) at com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invoke(TokenAuthenticationInvocationHandler.java:69) at com.sun.proxy.$Proxy2277.updatePage(Unknown Source) 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.xmlrpc.Invoker.execute(Invoker.java:130) at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84) {code}

    Atlassian JIRA | 3 years ago | Doug Balmer
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.Integer cannot be cast to java.lang.String

      at com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.convertLong()
    2. com.atlassian.confluence
      ConfluenceXmlRpcHandlerImpl.updatePage
      1. com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.convertLong(XmlRpcUtils.java:53)
      2. com.atlassian.confluence.rpc.xmlrpc.XmlRpcUtils.createRemotePageFromPageStruct(XmlRpcUtils.java:21)
      3. com.atlassian.confluence.rpc.xmlrpc.ConfluenceXmlRpcHandlerImpl.updatePage(ConfluenceXmlRpcHandlerImpl.java:442)
      3 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1182.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      3. java.lang.reflect.Method.invoke(Unknown Source)
      3 frames
    4. com.atlassian.confluence
      TokenAuthenticationInvocationHandler.invoke
      1. com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invokeAuthenticatedMethod(TokenAuthenticationInvocationHandler.java:93)
      2. com.atlassian.confluence.rpc.auth.TokenAuthenticationInvocationHandler.invoke(TokenAuthenticationInvocationHandler.java:69)
      2 frames
    5. com.sun.proxy
      $Proxy2277.updatePage
      1. com.sun.proxy.$Proxy2277.updatePage(Unknown Source)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    7. Apache XML-RPC Common Library
      XmlRpcWorker.invokeHandler
      1. org.apache.xmlrpc.Invoker.execute(Invoker.java:130)
      2. org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84)
      2 frames