I'm trying to use Bliki to access and parse wiki pages. I just downloaded the zip file and put the bliki-core-3.0.19.jar into my eclipse build path.
However, when I tried to connect using sample code. there was an error. The sample code is here:
public static void test(){
String pageName = "File:Mona Lisa.jpg";
User user = new User("", "", "http://en.wikipedia.org/w/api.php");
Connector con = new Connector();
user = con.login(user);
List<Page> pages = user.queryImageinfo(new String[]{pageName});
if(pages != null)
System.out.println(pages.size());
}
And I got errors as:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod
at info.bliki.api.User.<init>(User.java:98)
at info.bliki.api.User.<init>(User.java:71)
at main.wiki.WikiCall.test(WikiCall.java:23)
at main.wiki.WikiCall.main(WikiCall.java:32)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 4 more
It seems like I'm missing the http jar for the connection, but there's no one the zip file and i thought the bliki-core.jar should contain it.
Any suggestions?
I'm not familiar with
Blikibut from your stacktrace it looks like you are missing theHttp ClientfromApache Commons.You should add the jar to your project and that should solve the problem.
Get the jar from here: http://hc.apache.org/