Could not find or load main class com.puppetlabs.puppetdb.core

224 views
Skip to first unread message

Darin Perusich

unread,
Jun 13, 2014, 9:21:26 AM6/13/14
to puppet...@googlegroups.com
Hello,

I'm attempting to build puppetdb-2.0.0 from source and the resulting
jar fails to start and errors with "Could not find or load main class
com.puppetlabs.puppetdb.core". When inspecting the puppetdb.jar it
doesn't contain any of the classes so it would appear that 'lein
uberhar' is failing to build said classes. When listing the content of
puppetdb-2.0.0-standalone.jar the do not exist. Also compiling the
source, 'lein compile' doesn't appear to be compiling the classes, no
"Compiling com.puppetlabs.puppetdb.core" or "Compiling clj-time.core"
output like when I build 1.6.3 and nothing created under
target/classes.

Any thoughts on what might be causing this?

This system is openSUSE 13.1, puppet-3.0.2, and Oracle java 1.7.0_55-b13.

To recreate do:

wget https://github.com/puppetlabs/puppetdb/archive/2.0.0/puppetdb-2.0.0.tar.gz
tar -zxf puppetdb-2.0.0.tar.gz
cd puppetdb-2.0.0/
echo 2.0.0 > version
lein uberjar

Check for puppetdb.core in resulting jar:
jar tf target/puppetdb-2.0.0-standalone.jar |grep puppetdb.core
com/puppetlabs/puppetdb/core.clj

--
Later,
Darin

Ken Barber

unread,
Jun 13, 2014, 10:28:11 AM6/13/14
to Puppet Users
> I'm attempting to build puppetdb-2.0.0 from source and the resulting
> jar fails to start and errors with "Could not find or load main class
> com.puppetlabs.puppetdb.core".

The way we execute the clojure code has changed, we no longer use AOT
compilation so the syntax for invoking PDB from the jar has changed
somewhat:

java -cp puppetdb.jar clojure.main -m com.puppetlabs.puppetdb.core
services -c config.ini

Basically now we're invoked in the clojure.main class, and passing in
parameters so that it knows what initial clojure file to invoke with
the -m switch. In the past, we invoked the
com.puppetlabs.puppetdb.core class directly, which no longer works.

You can see examples of the new invocation litter in the ext/templates
directory for the various distros.

> When inspecting the puppetdb.jar it
> doesn't contain any of the classes so it would appear that 'lein
> uberhar' is failing to build said classes.
>
> When listing the content of
> puppetdb-2.0.0-standalone.jar the do not exist. Also compiling the
> source, 'lein compile' doesn't appear to be compiling the classes, no
> "Compiling com.puppetlabs.puppetdb.core" or "Compiling clj-time.core"
> output like when I build 1.6.3 and nothing created under
> target/classes.

This is intentional, we no longer compile these class files up front.

ken.
Reply all
Reply to author
Forward
0 new messages