Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

April 10, 2012

Ontopia 5.2.1 and the CLASSPATH

Filed under: Ontopia — Patrick Durusau @ 6:48 pm

In the latest release of the Ontopia suite, you will find the following comments in the installation document:

Verifying

Now that you’ve set up your CLASSPATH environment variable you can verify it by issuing the following command:

java net.ontopia.Ontopia

It will run and produce the following output if it can find all the classes required:

Ontopia Topic Maps Engine [version]
Success: All required classes found.

If it fails you will get output similar to the following:

Ontopia Topic Maps Engine [version]
Class 'org.apache.log4j.BasicConfigurator' not found. Please add log4j.jar to your CLASSPATH.

The message is hopefully self-explanatory.

Well…, not quite.

At least in the latest release (5.2.1), I encountered the following error message from both Windows and Ubuntu setups:

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230)

To cure this problem, I now have the CLASSPATH setting:

CLASSPATH=/home/patrick/working/ontopia-5.2.1/lib/ontopia-engine-5.2.1.jar:/home/patrick/working/ontopia-5.2.1/lib/log4j-1.2.14.jar:/home/patrick/working/ontopia-5.2.1/lib/slf4j-log4j12-1.5.11.jar:
export CLASSPATH

I say it cures the problem because I can replicate the problem at will on either box and this fix cures it on both boxes (different JDKs).

So, in addition to ontopia-engine-x.x.x.jar, add to your CLASSPATH:

log4j-1.2.14.jar
slf4j-log4j12-1.5.11.jar

4 Comments

  1. Did you report it back to the Ontopia folks? I’m interested in hearing what they have to say…

    Kirk

    Comment by CapnKirk — April 12, 2012 @ 10:11 am

  2. Yes, but not through their bug tracking system so it may take longer to get a response. All volunteers now, i.e., they have day jobs.

    Comment by Patrick Durusau — April 12, 2012 @ 7:11 pm

  3. I have verified that your solution works. I created a classpath as you suggest above and the test command “java net.ontopia.Ontopia” responds:

    Ontopia Topic Maps Engine 5.2.1 (2012-03-30 11:35 by qs)
    Success: All required classes found.

    🙂

    Comment by CapnKirk — May 3, 2012 @ 7:59 am

  4. […] SLF4J bindings (recalling that I had to put slf4j-log4j2-1.5.11.jar explicitly in my class path, Ontopia 5.2.1 and the CLASSPATH). Clashes with […]

    Pingback by Titan: The Rise of Big Graph Data [SLF4J conflicts] « Another Word For It — June 14, 2012 @ 3:14 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress