lxbzmy / gwtwiki

Automatically exported from code.google.com/p/gwtwiki
0 stars 0 forks source link

ConcurrentEditException while importing HTML page to my mediawiki #140

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
steps to reproduce the problem

1.save page "Ganges"(or any page) from en.wikipedia.org as HTML only.
2.Convert this HTML page to Wiki text using info.bliki.html.HTML2WikiConverter
3.Now trying to import this article to my wiki using following code

           this.editURL = trgwikiURL + "/index.php";
           String[] cookiePairs = {};
           MediaWikiComm comm = new MyMediaWikiComm(this.editURL,cookiePairs);
            try {
                comm.login(userName, password, false);
                comm.saveData(pageTitle, CONTENT);
                comm.logout();
             } catch (Exception e) {

                e.printStackTrace();

            }

But it fails , and i get
info.bliki.api.MediaWikiComm$ConcurrentEditException
    at info.bliki.api.MediaWikiComm.saveData(MediaWikiComm.java:280)

What version of the product are you using? On what operating system?
I'm using Bliki 3.0.19  on Windows XP

Thanks in advance  !!!

Original issue reported on code.google.com by smita.su...@gmail.com on 13 May 2013 at 10:27

GoogleCodeExporter commented 9 years ago
From the implementation I assume, that there's "duplicate edit" detetected in 
your MediaWiki instance?

                        // This time, 302 means success. 302 is returned when the server
            // attempts a page redirection.
            // 200 means the save failed probably because another user posted some
            // edits since loadData() was called.
            if (responseCode >= HttpStatus.SC_OK && responseCode < 300) {
                // The calling code will respond by reloading the data, merging, and
                // attempting to save again.
                throw new ConcurrentEditException();
            } else if (responseCode != 302) {
                // Some other error code.
                throw new IOException(method.getStatusText() + " (" + responseCode + ")");
            }

Original comment by axelclk@gmail.com on 13 May 2013 at 4:07