Hi
i would like to create jira custom service. I'm using atlassian sdk 3.8.
so i imported some packages of atlassian api in my program. when i run atlas-package it shows the following error in command prompt window.
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
F:\services\module\src\main\java\com\first\module\MyPlugin.java:[9,25] cannot find symbo
could not parse error message: symbol: class ComponentManager
location: package com.atlassian.jira
F:\services\module\src\main\java\com\first\module\MyPlugin.java:20: cannot find symbol
ProjectManager pm = ComponentManager.getInstance().getProjectCategories();
^
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30 seconds
[INFO] Finished at: Thu Mar 01 10:31:26 GMT+05:30 2012
[INFO] Final Memory: 53M/128M
[INFO] ------------------------------------------------------------------------
'cmd' is not recognized as an internal or external command,
operable program or batch file.
Please tell me the solutions.
Looks like ComponentManager is part of jira-core, (see https://developer.atlassian.com/display/JIRADEV/Java+API+Policy+for+JIRA)
Add the following to your pom.xml after the jira-api dependency.
<dependency> <groupId>com.atlassian.jira</groupId> <artifactId>jira-core</artifactId> <version>${jira.version}</version> <scope>provided</scope> </dependency>
hi i get solution for this.. thanks for your timing help..
now i get all the projects by getProjects() method from project manager..
Next i would like to get issues for that project. so i need to use iterator.
That i dont know how to use and implement that..Pls guide me...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi please guide me how to get the due date for the issue. Please post the code bcz i'm the learner.. So i didnt knw many things.. Please post brief example...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I added the dependency but it does not work. What is the problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Make sure you rebuild the Eclipse project.
alas-mvn eclipse:clean eclipse:eclipse
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.
Atlassian in documentation https://docs.atlassian.com/jira/latest/com/atlassian/jira/ComponentManager.html wrote:
This component manager uses PicoContainer to resolve all the dependencies between components.
It is responsible for initialising a large number of components in JIRA. Any components defined here may be injected via a constructor.
The ComponentManager also has various static accessor methods for non-Pico-managed objects, eg. ComponentManager.getInstance().getProjectManager(). Plugins developers should no longer use these - please use ComponentAccessor instead.
so your code should loks like below (then dependency is not needed)
ComponentAccessor.getProjectManager().getAllProjectCategories();
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 initialize your ProjectManager instance correctly. Try
ProjectManager pm = ComponentManager.getComponentInstanceOfType(ProjectManager.class);
Import all required libraries and uncomment jira-core dependency in your POM file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a similar problem with the sdk on os x 10.6 with eclipse as I'm developing a CustomField JIRA pluging. Eclipse can't seem to resolve the import for com.atlassian.jira.ComponentManager, but has no trouble with other JIRA classes (e.g. jira.Issue, jira.MockComponentManager).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually i try to get all the project categories from the JIRA. So I import these two lines..
import com.atlassian.jira.project.ProjectManager;
import com.atlassian.jira.ComponentManager;
Then i retrive the projectcategories by getProjectCategories()method..
So i Used this line
ProjectManager pm = ComponentManager.getInstance().getProjectCategories();
After i do this i run the atlas-package command in command window.. That time it shows the error as i said above...
Is this the correct way to retrive all the project categories from JIRA or anyother ways are available?
If u know please make me clear...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see any getProjectCategies method here: http://docs.atlassian.com/jira/4.4/com/atlassian/jira/ComponentManager.html
ComponentManager.getInstance().getProjectManager().getProjectCategories() should do what you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes you are correct... But just importing these two packages in my program it shows error..
package com.first.module;
import java.io.*;
import java.lang.*;
import com.atlassian.configurable.ObjectConfiguration;
import com.atlassian.configurable.ObjectConfigurationException;
import com.atlassian.jira.service.AbstractService;
import com.atlassian.jira.project.ProjectManager;
import com.atlassian.jira.ComponentManager;
public class MyPlugin extends AbstractService
{
public void run()
{
System.out.println("Hi------Done");
}
public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException
{
return getObjectConfiguration("MYSERVICE", "com/first/module/myservice.xml", null);
}
}
See i just import that 2 packages in my program. but for atlas-package it shows the same error "cant find the symbol" What to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually what my full work is to retrive all the project categories from JIRA and from that project categories i've to get projects and get issues and due date for that issue...
Pls Guide me...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my program which i'm trying to run.. if i add
import com.atlassian.jira.project.ProjectManager;
import com.atlassian.jira.ComponentManager;
Without these 2 import statements it runs.
But if i add just these 2 packages means it shows the error which i mentioned above.. Please kindly tel me the solutions what are all the things i've to do. and what i necesarry to run this code perfectly...
package com.first.module;
import java.io.*;
import java.lang.*;
import com.atlassian.configurable.ObjectConfiguration;
import com.atlassian.configurable.ObjectConfigurationException;
import com.atlassian.jira.service.AbstractService;
import com.atlassian.jira.project.ProjectManager;
import com.atlassian.jira.ComponentManager;
//import com.atlassian.jira.issue.Issue;
public class MyPlugin extends AbstractService
{
public void run()
{
//ProjectManager pm = ComponentManager.getInstance().getProjectCategories();
System.out.println("Hi------Done");
}
public ObjectConfiguration getObjectConfiguration() throws
ObjectConfigurationException
{
return getObjectConfiguration("MYSERVICE", "com/first/module/myservice.xml", null);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I don't understand. The code you've given has a couple of imports, but the line is commented out, so I'd expect that to be fine, and just do nothing.
Could you explain this again - what are you compiling and running?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your code is missing an import, or is referring to something you haven't defined. You'll need to fix your code.
I'd recommend using a java-aware IDE to develop your code, because that will tell you about missing reference before you get to the compilation stage.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.