Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when updating Wiki: Entity may not be null #354

Open
kuruhuru opened this issue Jul 12, 2020 · 1 comment
Open

Error when updating Wiki: Entity may not be null #354

kuruhuru opened this issue Jul 12, 2020 · 1 comment

Comments

@kuruhuru
Copy link

I created a simple test that leads to an error on Redmine 4.1.0.stable

    public static void main(String[] args) {
        RedmineManager manager = RedmineManagerFactory.createWithApiKey("XXX",
                "XXX");
        Transport transport = manager.getTransport();
        ProjectManager projectManager = manager.getProjectManager();
        try {
            Project project = projectManager.getProjectByKey("secs-building-example-project");
            WikiPageDetail wdetail = manager.getWikiManager().getWikiPageDetailByProjectAndTitle(
                    "secs-building-example-project", "Wiki");
            wdetail.setText(wdetail.getText() + "\nCHANGED!!!");
            wdetail.update();
        } catch (RedmineException) {
            e.printStackTrace();
        }
    }
Exception in thread "main" java.lang.IllegalArgumentException: Entity may not be null
	at org.apache.http.util.Args.notNull(Args.java:54)
	at org.apache.http.util.EntityUtils.getContentCharSet(EntityUtils.java:159)
	at com.taskadapter.redmineapi.internal.comm.HttpUtil.getCharset(HttpUtil.java:32)
	at com.taskadapter.redmineapi.internal.comm.TransportDecoder.processContent(TransportDecoder.java:26)
	at com.taskadapter.redmineapi.internal.comm.TransportDecoder.processContent(TransportDecoder.java:19)
	at com.taskadapter.redmineapi.internal.comm.ComposingHandler.processContent(ComposingHandler.java:25)
	at com.taskadapter.redmineapi.internal.comm.ComposingHandler.processContent(ComposingHandler.java:25)
	at com.taskadapter.redmineapi.internal.comm.BaseCommunicator.sendRequest(BaseCommunicator.java:47)
	at com.taskadapter.redmineapi.internal.comm.redmine.RedmineAuthenticator.sendRequest(RedmineAuthenticator.java:52)
	at com.taskadapter.redmineapi.internal.comm.FmapCommunicator.sendRequest(FmapCommunicator.java:26)
	at com.taskadapter.redmineapi.internal.comm.FmapCommunicator.sendRequest(FmapCommunicator.java:26)
	at com.taskadapter.redmineapi.internal.comm.BasicSimplifier.sendRequest(BasicSimplifier.java:24)
	at com.taskadapter.redmineapi.internal.Transport.send(Transport.java:605)
	at com.taskadapter.redmineapi.internal.Transport.updateChildEntry(Transport.java:297)
	at com.taskadapter.redmineapi.bean.WikiPageDetail.update(WikiPageDetail.java:142)
	at org.example.redmine.RedmineTest.main(RedmineTest.java:30)

Execution failed for task ':RedmineTest.main()'.
> Process 'command '/usr/lib/jvm/java-1.14.0-openjdk-amd64/bin/java'' finished with non-zero exit value 1
@haiyanghaiyang
Copy link

I've created a PR: #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants