cannot find symbol class ChangesetsBetweenRequest

I am trying to get a list of changes between two commits using the HistoryService's getChangesetBetween() function:,%20com.atlassian.stash.util.PageRequest%29

Following the example in the documentation, I am trying to create a ChagesetsBetweenRequest object, but am getting an error when I try to import it.

import com.atlassian.stash.content.ChangesetsBetweenRequest;

The error:

/home/ben/git/stash_plugin/stash-example-async-post-receive-config/src/main/java/com/mycompany/example/plugin/myhook/[9,34] cannot find symbol
symbol  : class ChangesetsBetweenRequest
location: package com.atlassian.stash.content

/home/ben/git/stash_plugin/stash-example-async-post-receive-config/src/main/java/com/mycompany/example/plugin/myhook/[10,59] package com.atlassian.stash.content.ChangesetsBetweenRequest does not exist

I've also tried importing all of com.atlassian.stash.content.*, but this does not help.

7 answers

1 accepted

1 vote
Accepted answer

Hi Ben,

You should definitely be using the same version as your production instance for stash.version. The data version is just the initial data set and doesn't matter so much because we update the DB schema regardless (but it's probably just as easy to keep them the same).

Let me know if run into any more problems.



By the way, I'm developing on a local development machine, not on our production server. I'm testing my plugin with the `atlas-run` command. Here is the output from `atlas-version` for context.

% atlas-version

ATLAS Version:    4.2.5
ATLAS Home:       /opt/atlassian/plugin-sdk
ATLAS Scripts:    /opt/atlassian/plugin-sdk/bin
ATLAS Maven Home: /opt/atlassian/plugin-sdk/apache-maven
Executing: /opt/atlassian/plugin-sdk/apache-maven/bin/mvn --version -gs /opt/atlassian/plugin-sdk/apache-maven/conf/settings.xml
Apache Maven 2.1.0 (r755702; 2009-03-18 14:10:27-0500)
Java version: 1.6.0_45
Java home: /opt/sun-java6/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.10.10-1-arch" arch: "amd64" Family: "unix"

I just noticed that at the bottom of the Stash pages it says version 2.2.0, but it seems the API documentation and the production server we are running are both 2.4.1.

I've tried specifying the version of stash with the following command (I also tried the same with `atlas-run-standalone`, but got errors when I tried to access the page.).

% atlas-clean
% atlas-run --product stash --version 2.4.1

This got the displayed stash version to be correct, but I am still hitting the same "cannot find symbol" error. Perhaps I need to also somehow specify the version of the API it should compile my code with...?

Hi Ben,

Hmm. Any chance of sharing the plugin source? That will make it a little easier to figure out what is going wrong.



Of course. Here is the java file:

This plugin is based on one of the Atlassian examples on bitbucket:

Hi Ben,

Apologies, I should have been more specific. I'm actually more interested in the pom.xml, which I suspect is where the problem lies.


Here it is:

I noticed that at the end of the file there are two places where it states stash [data] version 2.2.0. I changed them both to 2.4.1 and things seem to be working better now. Let me know if I shouldn't have updated them both.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,955 views 7 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you