Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=2.11.12' - apache-kafka

I am not able to run a Apache Kafka service due to a failure while trying to start a Zookeeper instance. I have downloaded and tried it with all 3 availabe downloads at the official site. (binarys and source) When i try to start zookeeper with
./bin/zookeeper-server-start.sh config/zookeeper.properties
I always get the same error message:
Classpath is empty. Please build the project first e.g. by running
'./gradlew jar -PscalaVersion=2.11.12'
The same goes for (after starting a seperate zookeeper (not the build-in from kakfa) instance)
./bin/kafka-server-start.sh config/server.properties
I have tried it under Ubuntu 17.04 and 18.04. When i try this on a virtual machine using Ubuntu 16.04 it works.
Unfortunatly, all i found regarding this problem, was for Windows.
Thank you for any help.

In my case it has nothing to do with the binary or source cause both of them give that same "classpath is empty please build the project first" error. Its because there is a space in the path where kafka resides.

I had the same issue, the problem was I was downloading the source of Kafka. So to make my Kafka server run, I downloaded the Kafka binaries and it worked for me.
Kafka binaries: http://mirror.cc.columbia.edu/pub/software/apache/kafka/1.1.0/

We need to download kafka-binary and not the source
Download Binary from mirror
http://mirrors.estointernet.in/apache/kafka/2.2.0/kafka_2.11-2.2.0.tgz

Go to your terminal and run:
$ ./gradlew jar -PscalaVersion=2.11.12

I had the same issue. I solved it when removed the white spases from my folder name e.g "Kafka binary" -> "Kafka_binary".

I have the same message when I try bin/kafka-topic.sh.
It's just because you have a space in the full path.
Go to the folder and execute "pwd", in the path, you must change the white space of folder by an underscore or use camel case.

I changed the path:
~/Documents/Formation/Moi/Big Data/Logiciels/kafka_2.12-2.4.1
to
~/Documents/Formation/Moi/Logiciels/kafka_binary
and it works (binary sources)

Try echo $CLASSPATH in the terminal, check if there is a Java in this system.
Or maybe you need to install java

Please check scala version installed in your system. It should be scalaVersion=2.11.12.
Otherwise Download the kafka binary with installed scala version.

Related

Jboss6 not starting up - Error message

I have a small issue here. I installed Jboss-6.1.0 and when I run the 'run' bat file, JBoss does not get started and I get this error. (Please refer the attached)
My OS is Windows 8.1.I have set my Path and Java_Home variables correctly.Is there any more configuration to do?
A help is much appreciated.Thanks in advance.
I also had the same problem although with java 1.8. These are the steps I followed.
1.Go to the “bin” directory where you’ve installed JBoss
2.Edit the “run.bat” file
3.Search for the line “
set JAVA_OPTS=-Dprogram.name=%PROGNAME% -Dlogging.configuration=file:%DIRNAME%logging.properties %JAVA_OPTS%“
Change the %DIRNAME%
to your absolute path to the “bin” directory of your installed JBoss.e.g.
set JAVA_OPTS=-Dprogram.name=%PROGNAME% -Dlogging.configuration=file:”C:\Java\jboss-6.1.0-final\bin\logging.properties” %JAVA_OPTS%
I do not think the java version difference would affect the solution. It should work.

libzookeeper_mt.so.2 and libmosquitto.so.1 not found

So here is the problem: I installed zookeeper(prereq) for kafka using apt-get. Also, unzipped a tar file onto my image.
When i am running the kafka adapter to connect kafka producer to my ESP(SAS Event stream processing) I am getting an error for following two files not found or shared:
libzookeeper_mt.so.2
libmosquitto.so.1
I did look around for a quite few questions on SO, but didnt find any alternative than someone saying that these files are located in
/usr/local/lib directory
Unfortunately my directory contains only the following files:
vagrant#packer-virtualbox-iso-1421293493:/usr/local/lib$ ls
librdkafka.a librdkafka++.a librdkafka.so librdkafka++.so
librdkafka.so.1 librdkafka++.so.1 pkgconfig python2.7 python3.4 site_ruby
Can anyone tell me where can i locate these 2 files so that i can share them to run my kafka adapters? FYI, following is the link to the documentation of kafka adapters in case anyone wants to know more:
http://go.documentation.sas.com/?docsetId=espca&docsetVersion=4.2&docsetTarget=p0sbfix2ql9xpln1l1x4t9017aql.htm&locale=en
#alvits suggested that the libs are not installed, so i will be trying a separate installation again. Still any help during this will be appreciated!

Error: Could not find or load main class config.zookeeper.properties

I am trying to execute a sample producer consumer application using Apache Kafka. I downloaded it from https://www.apache.org/dyn/closer.cgi?path=/kafka/0.10.0.0/kafka-0.10.0.0-src.tgz . Then I started following the steps given in http://www.javaworld.com/article/3060078/big-data/big-data-messaging-with-kafka-part-1.html.
When I tried to run bin/zookeeper-server-start.sh config/zookeeper.properties, I am getting Error: Could not find or load main class config.zookeeper.properties I googled about the issue but didn't get any useful information on this. Can anyone help me to continue?
You've downloaded the source package. Download the binary package of Kafka and do testing.
You have to download the binary version from the official Kafka web site.
Assuming you have the correct binary version check to see that you do not already have CLASSPATH defined in your environment. If you do and the defined CLASSPATH has a space in it (e.g.C:\Program Files\<>) then neither zookeeper or kafka will start.
To solve this either delete your existing CLASSPATH or modify the startup script that builds the zookeeper and kafka CLASSPATH values, putting your CLASSPATH entry in double quotes before the path is built

eclipse plugin missing in hadoop-1.2.1

I am trying to install hadoop on Windows. Following all the steps provided on http://v-lad.org/Tutorials/Hadoop/13.5%20-%20copy%20hadoop%20plugin.html
I am facing a problem installing the hadoop-plugin. The hadoop version downloaded from apache.org(hadoop-1.2.1.tar.gz) does not contain the 'eclipse-plugin' folder in 'hadoop-1.2.1/contrib/'
Is there any other way that I can get this done.
Thanks
The folder might be src/contrib/eclips-plugin (not just contrib/eclips-plugin)
Try taking it from http://svn.apache.org/repos/asf/hadoop/common/tags/release-1.2.1/src/contrib/eclipse-plugin/
Use http://svn.apache.org/repos/asf/hadoop/common/tags/ for other releases

Hadoop location in Eclipse (Error: null)

I've downloaded hadoop from Yahoo tutorial, started linux VM with hadoop and in eclipse created new DFS location (entered IP of my VM, Map/Reduce master port 9001, DFS port 9000.
But in the node I got the error "Error:null."
What I'm doing wrong?
I'm using Eclipse Europe 3.3.1 and Hadoop 0.18.0.
Thanks for helping.
You should check the additional properties that you are able to configure. I was also getting this problem but the actual problem was that hadoop.job.ugi property was not available to be setup.To fix this, go to "\workspace\.metadata\.plugins\org.apache.hadoop.eclipse\locations". Here open the XML file and just add the property "hadoop.job.ugi" with value "hadoop-user,ABC" and then restart your eclipse. It worked for me.
I've configured properly eclipse when had installed it in my VM where hadoop was. But due to incompatible new versions of eclipse and eclipse hadoop plugin I refused to use it, because seems to me that using this plugin doesn't have any good benefits.
I was facing the same problem, i thinks the problem because there is no folder or files in the HDFS,i solved with these steps:
hadoop dfs -mkdir /name of folder
hadoop fs -ls /