Re: Issue 8 in dkpro-statistics: NoSuchMethod error when using agreement jars

1 view
Skip to first unread message

dkpro-st...@googlecode.com

unread,
Oct 17, 2014, 9:52:53 AM10/17/14
to dkpro-stati...@googlegroups.com
Updates:
Status: WontFix
Owner: chmeyer.de
Labels: Component-Agreement Milestone-2.0.0

Comment #1 on issue 8 by chmeyer.de: NoSuchMethod error when using
agreement jars
https://code.google.com/p/dkpro-statistics/issues/detail?id=8

Dear Anne,

Most probably there is only part of the agreement library in your
classpath. That is to say, the stack trace says that the constructors of
CodingAnnotationStudy are being executed, while the constructor of the
super class AnnotationStudy (invoked in line 52) cannot be found. This
explains why it works from Eclipse but not from the command line, where a
different classpath is assigned.

The easiest way to solve it, is probably to compile a runnable fat jar
(right click on the Eclipse project, select Export > Runnable Jar and
follow the wizard). The resulting JAR can be easily executed using java
-jar...

Alternatively, make sure that the whole JAR is part of the classpath by
specifying the libraries using Java's -cp parameter.

Best,
Christian

PS: Sorry for late response, the notifications did not work (or to be more
precise, they worked but I misconfigured them :/).

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

dkpro-st...@googlecode.com

unread,
Oct 18, 2014, 9:14:01 AM10/18/14
to dkpro-stati...@googlegroups.com

Comment #2 on issue 8 by annemari...@googlemail.com: NoSuchMethod error
Hi Christian,

my question relates to the jar downlodable from
http://search.maven.org/#search|ga|1|de.tudarmstadt.ukp.dkpro.statistics
(for non-Maven users).

I didn't run it from the command line, but I attached the jars downloadable
from the above mentioned web site to an eclipse project and ran it from
there. AnnotationStudy.class is in the jar, but I still got that error. I
can of course create my own jar, I just wanted to find out whether any
other users have trouble using the jar provided on the web site above.

What do you mean by whole jar? Actually all of the dkpro statistics etc.
jars are already added to my project. Do I need to do anything else?

Thanks!

Best,
Anne

dkpro-st...@googlecode.com

unread,
Oct 20, 2014, 4:06:49 AM10/20/14
to dkpro-stati...@googlegroups.com

Comment #3 on issue 8 by chmeyer.de: NoSuchMethod error when using
agreement jars
https://code.google.com/p/dkpro-statistics/issues/detail?id=8

Hmm, probably it's good to take a look at the code then. Maybe there is a
version conflict?

Here's what I tried:
1. Download
de.tudarmstadt.ukp.dkpro.statistics:dkpro-statistics-agreement:2.0.0 from
http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/dkpro/statistics/dkpro-statistics-agreement/2.0.0/dkpro-statistics-agreement-2.0.0.jar
2. Setup a new Eclipse project, store the jar in a lib/ subfolder, add the
jar to the classpath.
3. Create a new class with example code in some new agrtest package.
4. Run the project from Eclipse (works as expected)
5. Run the program from the command line using

java -cp bin:lib/dkpro-statistics-agreement-2.0.0.jar agrtest.Main

(on Windows replace the ":" in the -cp with ";") - this should work as well.

I am attaching this project setup and hope it helps.

Attachments:
agreement-non-maven.zip 61.4 KB

dkpro-st...@googlecode.com

unread,
Oct 20, 2014, 11:48:01 AM10/20/14
to dkpro-stati...@googlegroups.com

Comment #4 on issue 8 by annemari...@googlemail.com: NoSuchMethod error
Hi Christian,

I found the culprit: I had earlier added
de.tudarmstadt.ukp.dkpro.statistics-1.0.2.jar to my project. Thanks!

Best,
Anne

dkpro-st...@googlecode.com

unread,
Oct 20, 2014, 11:57:09 AM10/20/14
to dkpro-stati...@googlegroups.com

Comment #5 on issue 8 by chmeyer.de: NoSuchMethod error when using
agreement jars
https://code.google.com/p/dkpro-statistics/issues/detail?id=8

Very well, glad that it's solved!

Best wishes,
Christian
Reply all
Reply to author
Forward
0 new messages