Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

cannot find symbol class ChangesetsBetweenRequest

Benjamin Bergman September 9, 2013

I am trying to get a list of changes between two commits using the HistoryService's getChangesetBetween() function: https://developer.atlassian.com/static/javadoc/stash/2.4.1/api/reference/com/atlassian/stash/history/HistoryService.html#getChangesetsBetween%28com.atlassian.stash.content.ChangesetsBetweenRequest,%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/MyRepositoryHook.java:[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/MyRepositoryHook.java:[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
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2013

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.

Cheers,

Charles

0 votes
Benjamin Bergman September 10, 2013

Here it is: https://gist.github.com/BenBergman/af925808e9c03c36f00c

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.

0 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 10, 2013

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.

Charles

0 votes
Benjamin Bergman September 9, 2013

Of course. Here is the java file: https://gist.github.com/BenBergman/57c2caefaf670193d0a7

This plugin is based on one of the Atlassian examples on bitbucket: https://bitbucket.org/atlassian/stash-example-async-post-receive-config

0 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2013

Hi Ben,

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

Cheers,

Charles

0 votes
Benjamin Bergman September 9, 2013

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...?

0 votes
Benjamin Bergman September 9, 2013

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"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events