0

When I run the following command:

bin/tdbloader2 --loc=/store/data/here /seed/data/serverfault-dump.nt

And the response I get is:

10:52:31 -- TDB Bulk Loader Start
10:52:31 Data phase
Error: Could not find or load main class com.hp.hpl.jena.tdb.store.bulkloader2.CmdNodeTableBuilder

Which is most likely caused by a problem with my environment variables, somewhere, of something. The problem is, I don't often work with Java and so I don't know enough to know how to figure out what that class cannot be found.

How do make tdbloader2 find the appropriate class?

Kristian
  • 21,204
  • 19
  • 101
  • 176

2 Answers2

2

I had forgotten to set the JENAROOT path variable.

https://jena.apache.org/documentation/tools/

An environment variable JENAROOT is used by all the command line tools to configure the class path automatically for you. You can set this up as follows:

On Linux / Mac

export JENAROOT=the directory you downloaded Jena to export PATH=$PATH:$JENAROOT/bin On Windows

SET JENAROOT=the directory you downloaded Jena to SET PATH=%PATH%;%JENAROOT%\bat

Kristian
  • 21,204
  • 19
  • 101
  • 176
  • I'm having the same issue currently on a Mac. Still getting the same error after setting up JENAROOT. Anything else that would cause the same behavior. [Asked Here.](https://stackoverflow.com/questions/49949842/how-do-i-interact-with-apache-jena-locally) – detachedhead Apr 21 '18 at 18:14
  • For anyone trying to use this in the future, I am not really good with windows Powershell. But using tdb2_tdbloader as described in https://jena.apache.org/documentation/tdb2/tdb2_cmds.html doesn't work in Powershell for some reason. Switching to CMD does work however after setting JENA_ROOT. – NLxDoDge May 23 '21 at 11:47
1

At a minimum you need to set the TDBROOT environment variable to the directory containing your TDB download. This will be the directory above bin as some of the scripts use ${TDBROOT}/bin/foo to launch other scripts

The script attempts to automatically construct a valid class path by calling the tdb_path script which calls either make_classpath_mvn or make_classpath depending on your environment. If you run the tdb_path script directly you can see if it generates a sane looking class path or not (or add what it does generate to your question if the output doesn't provide anything helpful).

RobV
  • 28,022
  • 11
  • 77
  • 119
  • OK, so I actually realized that I hadn't even set up my JENAROOT variable, which all other fuseki / jena related scripts variables inherits from – Kristian Jan 27 '15 at 23:21