final HttpClient httpClient = new AsynchronousHttpClientFactory().createClient(serverUri, authenticationHandler);
Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/sal/api/ApplicationProperties
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.create(AsynchronousJiraRestClientFactory.java:35)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.createWithBasicHttpAuthentication(AsynchronousJiraRestClientFactory.java:41)
You are not using a "simple java program" here. You are using a pre-written library that already handles a lot of the connection stuff, and the error you are getting is a common one for people who have just picked it up and thought "I don't need to understand this stuff, I can just start using it without reading how to use it or what it's actually for".
Your best option is to work within the Atlassian SDK, which includes the dependencies you need for using JRJC, or you need to understand what you need to pull in the right dependencies. My bookmarks contain https://ecosystem.atlassian.net/wiki/display/JRJC/Downloadfor understanding that, and a note to include com.atlassian.sal in the pom.xml
You haven't imported the application properties class, or you've not included the library in your class path.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The one containing the application properties class.
Diffficult to tell you though - we don't know where your code is actually running. Plugin, connect, externally etc?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thiss my method which I'm calling from a class and I'm doing this in eclipse.
public JiraIssueAgent(JiraConfig config) throws URISyntaxException {
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
URI jiraServerUri = new URI(config.getUrl());
JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, config.getUsername(), config.getPassword());
init(restClient);
}
Please suggest me the necessary libraries to include..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, sorry, I was not clear when I said we don't know *where* your code is running.
Is it a plugin/addon for Jira? A "Connect" addon? A hack in the core of Jira? A gadget? An external program (Which won't need the the library, because it's outside Jira)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your patience. It's An external program trying to connect to Jira with a login user and password
JiraRestClient restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, config.getUsername(), config.getPassword());
this lines returns me an error syaing Exception in thread "main" java.lang.NoClassDefFoundError: com/atlassian/sal/api/ApplicationProperties
what is this com/atlassian/sal How should I get this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't need the com/atlassian/sal stuff for external programs. You connect via REST and get JSON formatted responses back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your help.
I'm connecting through Rest client only . I'm using following .jars to run my code.
jira-rest-java-client-2.0.0-m2
atlassian-util-concurrent-2.4.1.
Please help me i'm stuck with this. I've read data from Jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm exactly having a problem like below. Not sure how Joe resolved this. My code i've not used any maven plugins..Please suggest. How to connect to jira from a simple java simple java program and required references and corresponding pom.xml file please
https://answers.atlassian.com/questions/316728/java-lang-noclassdeffounderror-com-atlassian-sal-api-applicationproperties
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They used the REST API as documented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.