taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
270 stars 163 forks source link

Can't update issue on redmine 4.1.0.stable #348

Open marepop opened 4 years ago

marepop commented 4 years ago

Hi, i cannot update the issue using either fluent API or via transport. The error is "Entity may not be null". There is no entity since this response from Redmine returns a 204 no content (no body) but Apache still throws this error. Any way to resolve this? issue.update() and t.updateObject(issue) both throw the same thing.

Error happens here: return handler.processContent(httpResponse); because final String charset = HttpUtil.getCharset(entity); is called on null entity.

Originally posted by @marepop in https://github.com/taskadapter/redmine-java-api/issues/342#issuecomment-613851037

alexeyOnGitHub commented 4 years ago

let's clarify - so this works with older Redmine versions, but does not work with Redmine 4.1.0.stable. is that correct?

marepop commented 4 years ago

let's clarify - so this works with older Redmine versions, but does not work with Redmine 4.1.0.stable. is that correct?

Yes. That's correct. Our implementation worked with an older version of Redmine. After migrating to a new version 4.1.0.stable (no additional plugins) i came upon this problem.

alexeyOnGitHub commented 4 years ago

alright, can you please run all tests in this project against your own Redmine instance and see what else fails? (see redmine server URL in config files).

you are welcome to explore what API changes are required to support Redmine 4.1.0.stable and submit a proposal along with a PR.

haiyanghaiyang commented 4 years ago

I've created a PR: https://github.com/taskadapter/redmine-java-api/pull/355 I don't know how to run the test. But I got it works with Gerrit its-redmine plugin with Redmine 4.1.1. Please have a try.

alexeyOnGitHub commented 4 years ago

you can change the test config to point to your local Redmine instance and then run "gradle test". please ensure that the change works with the non-modded Redmine installation (no extra plugins). you may need to write some additional tests to cover this specific use-case