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

"import com.opensymphony.user.User", "com.atlassian.jira.web.bean.I18nBean" not found in eclipse - plugin project

dhaval soni
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.
January 30, 2013

Hi,

In plugin project under eclipse environment below imported namespace shows me error and looks like unable to find libraries.

"import com.opensymphony.user.User", "com.atlassian.jira.web.bean.I18nBean"

i have added opensymphony jar into project libraries and refresh the project. Though it shows same.

Please share your comment to resolve it.

thanks

6 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
David Kirchner February 20, 2013

Copying this from the comments so it shows up as an answer. Instead of:

I18nHelper i18nBean = new I18nBean(remoteUser);

use:

I18nHelper i18nBean = ComponentAccessor.getJiraAuthenticationContext().getI18nHelper();

And instead of:

import com.opensymphony.user.User

use:

import com.atlassian.crowd.embedded.api.User;

Additionally, please be sure to file feedback on the tutorial page so it can get updated.

1 vote
Jobin Kuruvilla [Adaptavist]
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.
January 30, 2013

Which version of JIRA is it? Have you updated the JIRA version in pom.xml before rebuilding Eclipse project? Also there is a change in using i18nBean. See https://confluence.atlassian.com/display/JIRA/Plugin+Developer+Notes+for+JIRA+4.3#PluginDeveloperNotesforJIRA4.3-I18nBeannolongerinthePICOcontainer

dhaval soni
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.
February 4, 2013

Hi Jobin,

my jira version is 5.1.2 and atlas-version out put as below:

C:\>atlas-version

ATLAS Version: 4.1.2

ATLAS Home: C:\atlassian-plugin-sdk

ATLAS Scripts: C:\atlassian-plugin-sdk\bin

ATLAS Maven Home: C:\atlassian-plugin-sdk\apache-maven

--------

Executing: "C:\atlassian-plugin-sdk\apache-maven\bin\mvn.bat" --version

Apache Maven 2.1.0 (r755702; 2009-03-19 00:40:27+0530)

Java version: 1.6.0_33

Java home: C:\Program Files\Java\jdk1.6.0_33\jre

Default locale: en_US, platform encoding: Cp1252

OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

I have gone through the your given link and used factory method to create instance of I18nHelper.

But, unable to create instance of "I18nBean" becuase, it shows me type resolve error for "import com.atlassian.jira.web.bean.I18nBean;"

have also added dependency block for - "jira-core" and reexecuted atlas-run but still same issue.

can you please share me your comments to resolve it?

dhaval soni
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.
February 4, 2013

facing an error at below statement due to import unable to resolve for ..web.bean.I18nBean.

"I18nHelper i18nBean = new I18nBean(remoteUser);"

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2013

>my jira version is 5.1.2 and

That is NOT what your pom.xml says. You need to update the pom.xml to point to the right version of Jira. Look at the product and data numbers.

dhaval soni
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.
February 4, 2013

I18nHelper.BeanFactory fac = null; // what object i have to assign at this factory to create instance ?

I18nHelper i18nBean = fac.getInstance(remoteUser);

otherwise,

I18nHelper i18nBean = new I18nBean(remoteUser); would work but raise an error for "I18nBean"

dhaval soni
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.
February 4, 2013

pom.xml says as below:

<properties>

<jira.version>5.1.8</jira.version>

<amps.version>4.1.2</amps.version>

<plugin.testrunner.version>1.1</plugin.testrunner.version>

</properties>

when i execute jira then it shows "

"

David Kirchner February 20, 2013

I am using:

I18nHelper i18nBean = ComponentAccessor.getJiraAuthenticationContext().getI18nHelper();

instead of the code in the tutorial. I'm not sure if it is correct. I suggest leaving feedback on the tutorial so it can be updated to correct the problem.

Jobin Kuruvilla [Adaptavist]
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.
February 20, 2013

Yes, this is fine.

1 vote
Naren
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.
January 30, 2013

What are you trying to achieve? You dont need to use the deprecated api com.opensymphony.user.User, instead try using com.atlassian.embedded.api.User

dhaval soni
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.
January 30, 2013

Creating report by follow,

https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Creating+a+JIRA+Report

but, in createreport class shows error for this two namespace and relatedobjects.

I will check by your given namespace. Can you also share me , why "com.atlassian.jira.web.bean.I18nBean" not working ??

dhaval soni
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.
January 31, 2013

Thanks guys for your comments.

In pom.xml, it shows me below jira version.

<properties>

<jira.version>4.0.1</jira.version>

<jira.data.version>4.0</jira.data.version>

</properties>

I have changed it to 6.0 as below as need to develop a plugin for current live instance which is in 6.0-OD-05v:

<properties>

<jira.version>6.0</jira.version>

<jira.data.version>4.0</jira.data.version>

</properties>

I was just implemtning report tutorial by follow below link as planning to create a plugin for creating a custom report:

https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Creating+a+JIRA+Report

But it looks like, these two namespaces are not found.

- For l18Helper, i think, it would resolve through "I18nHelper.BeanFactory.getInstance(user)" as posted by Jobin.

"com.atlassian.embedded.api.User" shows "import can not resolve" error.

Please share me if any other good tutorial for report creation or any resolution for above errors.

Basically, i just want to acheive one custom report template creation which will access jira work logs details and i am new with this so, wanted to go with some related tutorial.

Thank You.

0 votes
Filip Håkansson February 16, 2014

I also get this error. After following the plugin development tutorial and adding a Issue tab panel to a new empty project.

atlas-create-jira-plugin-module -> 8: Issue Tab Panel

Changing from

1
import com.opensymphony.user.User

to

1
import com.atlassian.crowd.embedded.api.User;

..did solve the issue. But to avoid other newbies to get confused maybe you can update the sdk.

0 votes
Narayana Ega July 25, 2013

Hi,

Even I have a problem related to VersionAssociations

The below shown is the error:

:[127,25] cannot access com.opensymphony.user.User class file for com.opensymphony.user.User not found

BoardContext context = new DefaultBoardContext(project,Component

Manager.getInstance().getJiraAuthenticationContext().getLoggedInUser());

I am not using the com.opensymphony.user.User any where.I dont know why it is getting error like can not access com.openSymphony.user.User.

can somebody answer this???

Thanks in advance.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2013

It could be anything stopping the i18nBean from working, you haven't told us what is actually wrong with it.

Concentrate on the first error though - why are you trying to import Opensymphony when it's deprecated? Is your report for a version of Jira below 4.3?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events