Getting Started with JWPL

513 views
Skip to first unread message

Carell

unread,
Jan 10, 2012, 12:37:29 PM1/10/12
to jwpl-users, emanuela.d...@gmail.com
Hello,

I am a beginner and I would like to create an "information extraction"
program. I am having a really hard time trying to figure out how JWPL
works.


What I did was:
- I installed eclipse
- I downloaded the JWPL 0.8.0 API

The first project I created was based on "Hello World 1" which I found
here: http://code.google.com/p/jwpl/wiki/JwplTutorial but after
running it I get this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/
hibernate/Session
at T1a_HelloWorld.main(T1a_HelloWorld.java:54)
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more

Could somebody please tell me step by step what I need to do to fix
this problem?

Thank you in advance.

A.

Oliver Ferschke

unread,
Jan 11, 2012, 4:32:31 AM1/11/12
to jwpl
Hi,
where did you download the API?
The package on the Google Code page requires you to add the included dependency folder to your classpath.

A ready-to-use jar with built-in dependencies can be found on maven central. The API, for example, can be found here:
http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wikipedia/de.tudarmstadt.ukp.wikipedia.api/0.8.0/de.tudarmstadt.ukp.wikipedia.api-0.8.0-jar-with-dependencies.jar

Before using JWPL, you will need to create a JWPL database with the DataMachine.
You can find the runnable jar here:
http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wikipedia/de.tudarmstadt.ukp.wikipedia.datamachine/0.8.0/de.tudarmstadt.ukp.wikipedia.datamachine-0.8.0-jar-with-dependencies.jar

The DataMachine is described here:
http://code.google.com/p/jwpl/wiki/DataMachine

Regards,
Oliver

--
-------------------------------------------------------------------
Oliver Ferschke, M.A.
Doctoral Researcher
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
fers...@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de
Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------

________________________________________
Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea....@gmail.com]
Gesendet: Dienstag, 10. Januar 2012 18:37
An: jwpl
Cc: emanuela.d...@gmail.com
Betreff: [jwpl-users] Getting Started with JWPL

winmail.dat

Carell

unread,
Jan 11, 2012, 10:18:11 AM1/11/12
to jwpl-users
Hello,

Thank you for your answer.
I downloaded the API from here: http://code.google.com/p/jwpl/downloads/list

I will try it and I will net you know. I am trying to do the same
thing on Windows 7 and Ubuntu. Do you know how I can add the
dependency folder to my classpath in Ubuntu?
Thank you a lot!!!

A.

On Jan 11, 10:32 am, Oliver Ferschke <fersc...@tk.informatik.tu-
darmstadt.de> wrote:
> Hi,
> where did you download the API?
> The package on the Google Code page requires you to add the included dependency folder to your classpath.
>
> A ready-to-use jar with built-in dependencies can be found on maven central. The API, for example, can be found here:http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wik...
>
> Before using JWPL, you will need to create a JWPL database with the DataMachine.
> You can find the runnable jar here:http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wik...
>
> The DataMachine is described here:http://code.google.com/p/jwpl/wiki/DataMachine
>
> Regards,
> Oliver
>
> --
> -------------------------------------------------------------------
> Oliver Ferschke, M.A.
> Doctoral Researcher
> Ubiquitous Knowledge Processing Lab
> FB 20 Computer Science Department
> Technische Universität Darmstadt
> Hochschulstr. 10, D-64289 Darmstadt, Germany
> phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
> fersc...@tk.informatik.tu-darmstadt.dewww.ukp.tu-darmstadt.de
> Web Research at TU Darmstadt (WeRC)www.werc.tu-darmstadt.de
> -------------------------------------------------------------------
>
> ________________________________________
> Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea.care...@gmail.com]
> Gesendet: Dienstag, 10. Januar 2012 18:37
> An: jwpl
> Cc: emanuela.degiorgi...@gmail.com
> Betreff: [jwpl-users] Getting Started with JWPL
>
> Hello,
>
> I am a beginner and I would like to create an "information extraction"
> program. I am having a really hard time trying to figure out how JWPL
> works.
>
> What I did was:
> - I installed eclipse
> - I downloaded the JWPL 0.8.0 API
>
> The first project I created was based on "Hello World 1" which I found
> here:http://code.google.com/p/jwpl/wiki/JwplTutorialbut after
> running it I get this error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: org/
> hibernate/Session
> at T1a_HelloWorld.main(T1a_HelloWorld.java:54)
> Caused by: java.lang.ClassNotFoundException: org.hibernate.Session
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 1 more
>
> Could somebody please tell me step by step what I need to do to fix
> this problem?
>
> Thank you in advance.
>
> A.
>
>  winmail.dat
> 6KViewDownload

Oliver Ferschke

unread,
Jan 11, 2012, 10:24:46 AM1/11/12
to jwpl
In eclipse, you can add external libraries in the project properties (under "Java Build Path > Libraries")
Alternatively, just use the respective "jar-with-dependencies.jar" from Maven Central as decribed in my last mail.
It does not need any additional external dependencies.

-----Ursprüngliche Nachricht-----
Von: jw...@googlegroups.com [mailto:jw...@googlegroups.com] Im Auftrag von Carell
Gesendet: Mittwoch, 11. Januar 2012 16:18
An: jwpl
Betreff: [jwpl-users] Re: Getting Started with JWPL

winmail.dat

Carell

unread,
Jan 14, 2012, 12:13:20 PM1/14/12
to jwpl-users
Hello,

So I am trying to follow the guide you gave me: http://code.google.com/p/jwpl/wiki/DataMachine

I am at the second step and I get this error while I run the
transformation: "Unable to access jarfile
de.tudarmstadt.ukp.wikipedia.datamachine-0.8.0"

any help?

On Jan 11, 4:24 pm, Oliver Ferschke <fersc...@tk.informatik.tu-
>  winmail.dat
> 8KViewDownload

Torsten Zesch

unread,
Jan 14, 2012, 4:39:14 PM1/14/12
to jw...@googlegroups.com
> I am at the second step and I get this error while I run the
> transformation: "Unable to access jarfile
> de.tudarmstadt.ukp.wikipedia.datamachine-0.8.0"

Please provide more details.

What command are you trying to execute?
What is your operating system?

Without more details, it's impossible to say what's going on.

-Torsten

Carell

unread,
Jan 15, 2012, 1:16:00 PM1/15/12
to jwpl-users
You are right, sorry. I will explain everything with more details:
I am using eclipse on both Windows 7 and Ubuntu.

I am following this guide here:
http://code.google.com/p/jwpl/wiki/DataMachine

I am at step 2:
"Run the transformation:
java -jar JWPLDataMachine.jar [LANGUAGE] [MAIN_CATEGORY_NAME]
[DISAMBIGUATION_CATEGORY_NAME] [SOURCE_DIRECTORY]"
I am wondering... what EXACTLY should I write instead of "[LANGUAGE]
[MAIN_CATEGORY_NAME] [DISAMBIGUATION_CATEGORY_NAME]
[SOURCE_DIRECTORY]"?
i tried to write this (as shown in the example): "java -jar
JWPLDataMachine.jar english Contents Disambiguation_pages ~/enwiki/
20081013"

but, in Ubuntu, I get this error:
"log4j:WARN No appenders could be found for logger
(org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly."
-HOW CAN I INITIALIZE THE LOG4J SYSTEM PROPERLY?

while on Windows 7 (italian language) I get this other error:
"nessun attributo manifest principale in C:\Users\User\workspace\JWPL
\JWPLDataMachine.jar" which in English would be "No main manifest
attribute in C:\Users\User\workspace\JWPL\JWPLDataMachine.jar"


Could you please help me step by step? Thank you so much.

A.


On Jan 14, 10:39 pm, Torsten Zesch <torsten.ze...@googlemail.com>
wrote:

Torsten Zesch

unread,
Jan 15, 2012, 2:39:03 PM1/15/12
to jw...@googlegroups.com
> i tried to write this (as shown in the example): "java -jar
> JWPLDataMachine.jar english Contents Disambiguation_pages ~/enwiki/
> 20081013"

Looks good.
You might want to assign more memory by -Xmx4g (assumming that you
have enough memory.

> but, in Ubuntu, I get this error:
> "log4j:WARN No appenders could be found for logger
> (org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
> log4j:WARN Please initialize the log4j system properly."
> -HOW CAN I INITIALIZE THE LOG4J SYSTEM PROPERLY?

This is a known issue (many users have been confused by this message).
You can safely ignore it.
If there are no other errors, I think you just have to wait from there on.

> while on Windows 7 (italian language) I get this other error:
> "nessun attributo manifest principale in C:\Users\User\workspace\JWPL
> \JWPLDataMachine.jar" which in English would be "No main manifest
> attribute in  C:\Users\User\workspace\JWPL\JWPLDataMachine.jar"

Which version of the DataMachine.jar did you download?

-Torsten

Carell

unread,
Jan 15, 2012, 2:50:11 PM1/15/12
to jwpl-users
Hello,

Thanks for your fast answer.

-If I try -Xmx4g I get the same error.

-I'm using the 0.8.0 version

:( I need to setup this JWPL otherwise I cannot start programming....
aaaaahhhh why is it so hard??? :(

On Jan 15, 8:39 pm, Torsten Zesch <torsten.ze...@googlemail.com>
wrote:

Oliver Ferschke

unread,
Jan 15, 2012, 3:04:05 PM1/15/12
to jwpl
Is it the version from Google Code?
Or from Maven central?

Try the Maven Central jar with included dependencies. This should work:

http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wikipedia/de.tudarmstadt.ukp.wikipedia.datamachine/0.8.0/de.tudarmstadt.ukp.wikipedia.datamachine-0.8.0-jar-with-dependencies.jar

-Oliver

________________________________________
Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea....@gmail.com]
Gesendet: Sonntag, 15. Januar 2012 20:50


An: jwpl
Betreff: [jwpl-users] Re: Getting Started with JWPL

Hello,

winmail.dat

Carell

unread,
Jan 18, 2012, 11:35:32 AM1/18/12
to jwpl-users
Hello,

I tried to use the jar you linked me and, now, on WIndows 7 I get the
same error that I get on Linux:

"log4j:WARN No appenders could be found for logger
(org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly."

on linux I keep reeving that same error.

Damn... this is so hard to figure out!

=(

On Jan 15, 9:04 pm, Oliver Ferschke <fersc...@tk.informatik.tu-
darmstadt.de> wrote:
> Is it the version from Google Code?
> Or from Maven central?
>
> Try the Maven Central jar with included dependencies. This should work:
>
> http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/wik...
>
> -Oliver
>
> ________________________________________
> Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea.care...@gmail.com]
>  winmail.dat
> 7KViewDownload

Oliver Ferschke

unread,
Jan 18, 2012, 12:33:16 PM1/18/12
to jwpl
This is not a problem. Just let it run.
We'll provide a proper configuration for the logger soon.
It should not affect the rest of the software.

--
-------------------------------------------------------------------
Oliver Ferschke, M.A.
Doctoral Researcher
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111

fers...@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de


Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------

________________________________________
Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea....@gmail.com]
Gesendet: Mittwoch, 18. Januar 2012 17:35

winmail.dat

Carell

unread,
Jan 18, 2012, 12:50:03 PM1/18/12
to jwpl-users
But I cannot go ahead as this should create some data files as it is
mentioned here in step 3 --> http://code.google.com/p/jwpl/wiki/DataMachine
"This should create a lot of new data files in a "output" subfolder of
each input folder. "

I am so confused

On Jan 18, 6:33 pm, Oliver Ferschke <fersc...@tk.informatik.tu-
darmstadt.de> wrote:
> This is not a problem. Just let it run.
> We'll provide a proper configuration for the logger soon.
> It should not affect the rest of the software.
>
> --
> -------------------------------------------------------------------
> Oliver Ferschke, M.A.
> Doctoral Researcher
> Ubiquitous Knowledge Processing Lab
> FB 20 Computer Science Department
> Technische Universität Darmstadt
> Hochschulstr. 10, D-64289 Darmstadt, Germany
> phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
> fersc...@tk.informatik.tu-darmstadt.dewww.ukp.tu-darmstadt.de
> Web Research at TU Darmstadt (WeRC)www.werc.tu-darmstadt.de
> -------------------------------------------------------------------
>
> ________________________________________
> Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea.care...@gmail.com]
>  winmail.dat
> 8KViewDownload

Oliver Ferschke

unread,
Jan 18, 2012, 5:23:50 PM1/18/12
to jwpl
It should.
Does the DataMachine terminate after the log4j configuration message?
It should keep on running. Depending on your system and the Wikipedia-Dump you want to process, it could take a couple of minutes up to a couple of hours until any data is written.


--
-------------------------------------------------------------------
Oliver Ferschke, M.A.
Doctoral Researcher
Ubiquitous Knowledge Processing Lab
FB 20 Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111

fers...@tk.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de


Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
-------------------------------------------------------------------

________________________________________
Von: jw...@googlegroups.com [jw...@googlegroups.com] im Auftrag von Carell [andrea....@gmail.com]
Gesendet: Mittwoch, 18. Januar 2012 18:50

winmail.dat

Carell

unread,
Jan 19, 2012, 1:32:27 PM1/19/12
to jwpl-users
- I created a project by importing the libraries. I created only one
class where I put this code: http://goo.gl/qn5TO
IT DOES NOT WORK! I keep receiving always the same errors.

- I just found a text file file, named 20120118_170419, in C:\users
\userid. Here is what I found inside:
"Date/Time","Total Memory","Free Memory","Message"
"2012.01.18 17:04:19","63242240","53117880",". is not a directory.
Continue read from C:\Users\userid\."
"2012.01.18 17:04:19","63242240","53117880","Not all necessary
source files could be found in ~/enwiki/20081013"

- "Does the DataMachine terminate after the log4j configuration
message?"
No, it doesn't terminate, I keep receiving other errors (please
help):

log4j:WARN No appenders could be found for logger
(de.tudarmstadt.ukp.wikipedia.api.Wikipedia).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main"
org.hibernate.exception.JDBCConnectionException: Cannot open
connection
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:
74)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
43)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:
29)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:
426)
at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:
144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:
1327)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.context.ThreadLocalSessionContext
$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:
301)
at $Proxy0.beginTransaction(Unknown Source)
at de.tudarmstadt.ukp.wikipedia.api.MetaData.<init>(MetaData.java:40)
at de.tudarmstadt.ukp.wikipedia.api.Wikipedia.<init>(Wikipedia.java:
79)
at T1a_HelloWorld.main(T1a_HelloWorld.java:29)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure

The last packet sent successfully to the server was 0 milliseconds
ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:
1118)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:
2308)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:
2122)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:
289)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:
110)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:
423)
... 13 more
Caused by: java.net.UnknownHostException: SERVER_URL
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:
246)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
... 28 more



On Jan 18, 11:23 pm, Oliver Ferschke <fersc...@tk.informatik.tu-
darmstadt.de> wrote:
> It should.
> Does the DataMachine terminate after the log4j configuration message?
> It should keep on running. Depending on your system and the Wikipedia-Dump you want to process, it could take a couple of minutes up to a couple of hours until any data is written.
>
> --
> -------------------------------------------------------------------
> Oliver Ferschke, M.A.
> Doctoral Researcher
> Ubiquitous Knowledge Processing Lab
> FB 20 Computer Science Department
> Technische Universität Darmstadt
> Hochschulstr. 10, D-64289 Darmstadt, Germany
> phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
>  winmail.dat
> 9KViewDownload
Reply all
Reply to author
Forward
0 new messages