Unable to run zookeeper server - java

I have recently installed kafka_2.11-0.10.2.0, but to run this we have to first run the zookeeper server.
But whenever I run command
bin/zookeeper-server-start.sh config/zookeeper.properties
it throws an error i.e.
Error: Could not find or load main class kafka.kafka_2.11-0.10.2.0.bin....logs.zookeeper-gc.log
Any kind of help will be appreciated

Related

Apache Livy : Could not find or load main class org.apache.livy.server.LivyServer

I am trying to start Apache Livy 0.8.0 server on my windows 10 machine for spark 3.1.2 and hadoop 3.2.1. I am taking help from here.. I have successfully built apache livy using maven (I have attached a of it) But I am not able to run the livy server. When I run it I get the following error -
> starting C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer, logging to D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
ps: unknown option -- o
Try `ps --help' for more information.
failed to launch C:/AmazonJDK/jdk1.8.0_332/bin/java -cp /d/ApacheLivy/incubator-livy-master/incubator-livy-master/server/target/jars/*:/d/ApacheLivy/incubator-livy-master/incubator-livy-master/conf:D:/Program_files/spark/conf:D:/ApacheHadoop/hadoop-3.2.1/etc/hadoop: org.apache.livy.server.LivyServer:
Error: Could not find or load main class org.apache.livy.server.LivyServer
full log in D:/ApacheLivy/incubator-livy-master/incubator-livy-master/logs/livy--server.out
I am using Git bash. If you need more information I will provide
The error got resolved when I used Windows Subsystem for Linux (WSL).

exception thrown when running jar on Heroku

I followed this documentation Using the Heroku Deploy CLI plugin to run my simple jar but when I execute this command :
jar main.jar --app myapp
This exception is thrown :
Exception in thread "main" org.apache.http.client.HttpResponseException: Not Found
at com.heroku.sdk.deploy.utils.RestClient.handleResponse(RestClient.java:172)
at com.heroku.sdk.deploy.utils.RestClient.get(RestClient.java:66)
at com.heroku.sdk.deploy.ConfigVars.getConfigVars(ConfigVars.java:41)
at com.heroku.sdk.deploy.ConfigVars.merge(ConfigVars.java:24)
at com.heroku.sdk.deploy.Deployer.mergeConfigVars(Deployer.java:106)
at com.heroku.sdk.deploy.Deployer.deploy(Deployer.java:68)
at com.heroku.sdk.deploy.App.deploy(App.java:57)
at com.heroku.sdk.deploy.App.deploy(App.java:61)
at com.heroku.sdk.deploy.DeployJar.deploy(DeployJar.java:27)
at com.heroku.sdk.deploy.DeployJar.main(DeployJar.java:105)
I've googled this exception but didn't found anything useful.
Note that this jar is running correctly in my computer without any exceptions.
This error usually means the app you are trying to deploy to does not exist (or you may not have access to it).
Double check that the app name is correct, and use the correct app name with the -a option in the command if necessary.

PMD + jenkins [linux] - class net.sourceforge.pmd.PMD not found

I need to run PMD on my Jenkins server [LINUX].
Everything works fine on my Windows machine with sh.exe but when I am trying to run it on Jenkins I get the following error:
Error: Could not find or load main class net.sourceforge.pmd.PMD
I know it means that it cannot find the main class but the exact same thing works on my local env.
Both machines have java version "1.7.0_111" and pmd-bin-5.5.2. What is wrong with this? Please help.
Thank You.

Apache Connection Refused when running Docker-client Java API

I am trying to install the Docker-client Remote API library ( https://github.com/spotify/docker-client ) to do some image searches and inspect image data (all in public repositories). I have the boot2docker VM downloaded, installed and running. Commands such as "Docker pull ubuntu" work fine but I would like to do this via a Java program now. I used the Eclipse IDE Egit plugin to import the github project and created a Maven/Java project from the existing Master branch. The source code is completely imported and no errors reported. I then tried writing a simple test:
final DockerClient docker = DefaultDockerClient.fromEnv().build();
//docker.pull("busybox");
List<ImageSearchResult> results = docker.searchImages("ubuntu");
for (ImageSearchResult res : results) {
System.out.println(res.getName());
}
However, when running the code in Eclipse I get the following error:
Exception in thread "main" com.spotify.docker.client.DockerException: java.util.concurrent.ExecutionException: javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:1109)
at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:1028)
at com.spotify.docker.client.DefaultDockerClient.searchImages(DefaultDockerClient.java:653)
at com.spotify.docker.client.main.Test.main(Test.java:28)
I tried setting up an apache server on that port but then I get:
Exception in thread "main" com.spotify.docker.client.DockerRequestException: Request error: GET http://localhost:2375/v1.12/images/search?term=ubuntu: 404
at com.spotify.docker.client.DefaultDockerClient.propagate(DefaultDockerClient.java:1100)
at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:1028)
at com.spotify.docker.client.DefaultDockerClient.searchImages(DefaultDockerClient.java:653)
at com.spotify.docker.client.main.Test.main(Test.java:28)
Can anyone tell me what I am supposed to do here to make my search/pull call work? This is my first try with Docker and I've searched through the documentation and googled the problem but can't find anyone with a similar problem.
Thank you!
EDIT: I am running docker in Windows 7 via the pre-built VM Boot2Docker. Maybe the Docker daemon running inside that is not accessible from programs outside of the VM such as Eclipse?
EDIT: solved it by upgrading to v1.6 instead of v1.5 which makes the daemon available in the Windows host. Current problem is that all my API calls are returning "The server failed to respond with a valid HTTP response"
I encountered a similar issue and I managed to solve this issue by using the following way, to build up the DockerClient:
final DockerClient docker = DefaultDockerClient.builder()
.uri(URI.create("unix:///var/run/docker.sock"))
.build();
I had been getting the same exception but adding the above URI part helped me to solve the issue.
A better explanation for a issue similar to the above and how to solve it has been provided in the following issue tracker.
https://github.com/spotify/docker-maven-plugin/issues/61
The Java program does essentially a docker search: that can only work in an environment where the docker engine is present.
Either in the boot2docker VM.
Or in a full Linux host.
I did encounter the same problem on Mac with eclipse and Docker version 1.10.3, I did search for a solution before I settled for a workaround - Using docker CLI docker-manager to create a new virtualbox and get the DOCKER_HOST and DOCKER_CERT_PATH values of that virtualbox and create a new builder.
In my case: I have created a virtual box default2 using docker CLI command docker-machine create -d virtualbox default2
Docker CLI
$ docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.103:2376"
export DOCKER_CERT_PATH="/Users/XXXX/.docker/machine/machines/default2"
export DOCKER_MACHINE_NAME="default2"
Docker-client JAVA
DockerCertificates defaultCertificates = new DockerCertificates(Paths.get("/Users/XXXX/.docker/machine/machines/default2"));
DockerClient docker = DefaultDockerClient.builder()
.uri("https://192.168.99.103:2376")
.dockerCertificates(defaultCertificates)
.build();

Error while starting GoldFish server: Ubuntu 13.10

I consulted here and here but could not get my problem solved.
When I type this on terminal /opt/glassfish4/glassfish/bin/asadmin start, I get the following result:
Remote server does not listen for requests on [localhost:4848]. Is the server up?
Unable to get remote commands.
Closest matching local command(s):
restart-domain
restart-local-instance
start-database
start-domain
start-local-instance
Command start failed.
Similarly, when I type this /opt/glassfish4/glassfish/bin/asadmin --port 5656 start-domain, I get
java.io.IOException: Couldn't get lock for /opt/glassfish4/glassfish/domains/domain1/logs/server.log
at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
at java.util.logging.FileHandler.<init>(FileHandler.java:287)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:98)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:191)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:220)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:117)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:321)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:360)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:298)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:56)
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
Exception in thread "main" java.lang.RuntimeException: the domain directory is not writable.
at com.sun.enterprise.glassfish.bootstrap.MainHelper.verifyDomainRoot(MainHelper.java:244)
at com.sun.enterprise.glassfish.bootstrap.MainHelper.findInstanceRoot(MainHelper.java:347)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:78)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Command start-domain failed.
I sense there is something problem in path /opt/glassfish4/glassfish/bin/asadmin. I am working on my first JSF web application and cannot run glassfish server. I am using Netbeans and ubuntu 13.10.
Can anyone show me the way?
Thank you!
The error messages
java.io.IOException: Couldn't get lock for
/opt/glassfish4/glassfish/domains/domain1/logs/server.log
and
Exception in thread "main" java.lang.RuntimeException: the domain
directory is not writable.
indicate that the user account you use to start the server doesn't have write permissions in your Glassfish domain folder.
To solve the problem either change the permissions or start the asadmin command with a user who has sufficient permissions.
If this doesn't solve the problem, there may be another process which has a lock on your server.log file, but I guess you would have noticed that. To make sure you can run
lsof /opt/glassfish4/glassfish/domains/domain1/logs/server.log
to see if any process is using the file.
See also:
Failed to start glassfish server because Couldn't get lock for /opt/glassfishv3/glassfish/domains/domain1/logs/server.log

Categories

Resources