I’m testing an app in current Jira 8.0 EAP (v8.0.0-m0025) and I have problems with several classes. I can’t find any information in the document Preparing for Jira 8.0 related to these classes. The classes are:
com.atlassian.jira.rest.v2.issue.RESTException
com.atlassian.jira.rest.v2.issue.UserPickerUser
Both classes are part of jira-rest-plugin.
When I put Jira version 8.0.0-m0025 in my app’s pom.xml, no compiled error are shown with these classes. I’ve reviewed my Jira 8.0 instance and this plugin exists and is enabled.
Why now my app doesn’t found these classes if they are present? In previous version of Jira they was working.
What error are you getting? Can you paste the error message?
This is the error for UserPickerUser, the other class throw the same error
Uncaught exception thrown by REST service: com/atlassian/jira/rest/v2/issue/UserPickerUser
java.lang.NoClassDefFoundError: com/atlassian/jira/rest/v2/issue/UserPickerUser
at com.deiser.jira.profields.rest.internal.v2.helper.UserRestHelper.makeUserPickerBean(UserRestHelper.java:147)
at com.deiser.jira.profields.rest.internal.v2.helper.UserRestHelper.findUsersAsBean(UserRestHelper.java:98)
at com.deiser.jira.profields.rest.internal.v2.UserRest.findUsers(UserRest.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
... 1 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
... 19 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:159)
... 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:69)
... 41 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
... 53 filtered
at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
... 1 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
... 16 filtered
at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
... 19 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
... 10 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
... 4 filtered
at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
... 26 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
... 24 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.atlassian.jira.rest.v2.issue.UserPickerUser not found by com.deiser.jira.profields [181]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 235 more
Did you check your <Import-Package> directives?
Yes, but I don’t know what I need to put there.
Should I add any directive to import the plugin “jira-rest-plugin”?
As I said before, we don’t need that directive in previous versions of Jira
Hi @kcichy
Sorry, the problem with the default package is caused by one maven plugin that generate some classes without package.
I added your Import-Package and the add-on compiles, but when I try to install it, Jira throws an error:
I don’t explain very well Import-Package doesn’t allow classes wit h default package. And the add-on doens’t compile until several classes has a package, but that problem is already solved.
I’ve added all the error that Jira was throwing to the Import-Package until Jira didn’t throw install errors anymore, but when I go to the page that is using the “com.atlassian.jira.rest.v2.issue.UserPickerUser”…the first error (java.lang.NoClassDefFoundError: com/atlassian/jira/rest/v2/issue/UserPickerUser) persists.
The problem has been solved when I’ve upgraded to the latest version of Jira 8 (v8.0.0-m0030). Probably something was not correct in the previous EAP (v8.0.0-m0025) for these classes.
I’ve removed the Import-Package completely and the app is working again.