Bitbucket Plugin REST Api call 500 error

Hi, we have deployed a plugin in Bitbucket which makes REST Api call to Bitbucket to fetch user details but when making that Api call, we are getting 500 error. Api response message

<status-code>500</status-code><message>com/rometools/rome/feed/rss/Channel</message>

And in the Bitbucket logs we got this exception:

ThrowableExceptionMapper Uncaught exception 116b60dd-a554-4c1e-a7f7-2bc70c8557bf thrown by REST service: com/rometools/rome/feed/rss/Channel
java.lang.NoClassDefFoundError: com/rometools/rome/feed/rss/Channel
    at org.springframework.http.converter.feed.RssChannelHttpMessageConverter.supports(RssChannelHttpMessageConverter.java:46)
    at org.springframework.http.converter.AbstractHttpMessageConverter.canRead(AbstractHttpMessageConverter.java:136)
    at org.springframework.web.client.RestTemplate$AcceptHeaderRequestCallback.canReadResponse(RestTemplate.java:909)
    at org.springframework.web.client.RestTemplate$AcceptHeaderRequestCallback.lambda$doWithRequest$0(RestTemplate.java:894)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at org.springframework.web.client.RestTemplate$AcceptHeaderRequestCallback.doWithRequest(RestTemplate.java:898)
    at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:960)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:780)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:717)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:608)
    ... 286 frames trimmed
Caused by: java.lang.ClassNotFoundException: com.rometools.rome.feed.rss.Channel not found by com.atlassian.platform.dependencies.platform-spring-bundle [7]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
    ... 58 common frames omitted

Tried adding the com/rometools/rome/feed/rss/Channel dependency in the plugin still it isn’t working. It is happening specifically when making the rest template call.
what could be the issue? Any help is appreciated!

  1. Which Bitbucket version is this?
  2. What’s the exact REST endpoint you’re hitting and how are you calling it? (e.g. is it https://developer.atlassian.com/server/bitbucket/rest/v819/api-group-system-maintenance/#api-api-latest-users-userslug-get ?)
  3. Do you see the same error when calling the same REST endpoint outside of your plugin e.g. through Postman?
  4. If this is a plugin you’re installing on Bitbucket, have you considered using Bitbucket’s Java API e.g. UserService#getUserByName ?
1 Like

Hi StanleySu,
We are using Bitbucket version 8.19.3. We are hitting this endpoint /rest/api/latest/admin/users and we are calling it by using Rest Template call. No we aren’t getting any error through Postman. Thanks for replying we already figured it out that the issue is Bitbucket doesn’t have the dependencies required for Rest Template to make the API call. We are now using HttpsURLConnection and it is working fine.