I am using jira rest java client and when I try to instantiate a JiraRestClient :
JiraRestClient client = factory.createWithBasicHttpAuthentication(uri, JIRA_ADMIN_USERNAME, JIRA_ADMIN_PASSWORD);
I get the following error:
java.langClassCastException: Cannot cast com.sun.jersey.core.impl.provider.header.LocaleProvider to com.sun.jersey.spi.HeaderDelegateProvider at java.lang.Class.cast(Class.java:3369)
And I don't understand why because both classes to which the error refers to are from jersey-core which is a compiled dependency of jira-rest-java-client-core that I am using -https://mvnrepository.com/artifact/com.atlassian.jira/jira-rest-java-client-core/5.2.1
Does anyone know why this error occurs and how can I fix it? Thank you.
Hello @Andrei Iorga ,
I might not be the right person to answer this question here but, looking at the dependencies on the project page and the ones in the link you pointed out I have noticed that jersey-core is not there anymore.
Indeed, in the project dependencies for version 5.2.1 only jersey-client and jersey-json are listed (jersey-core and jersey-apache-client are not there anymore):
Can you try removing the unneeded dependency and see how it goes?
Also, are you actually using this for Jira Server or Cloud? In case this is for Cloud please keep in mind that JRJC is officially only supported for Jira Server even if many users are able to use it successfully with Cloud. For details see:
I hope this helps.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.