Tag: java

Why do I get Error: Could not find or load main class .jar when I run docker image

I have written my docker file as below: From java:8 EXPOSE 8081 ADD /target/Demo-0.0.1-SNAPSHOT.jar Demo.jar ENTRYPOINT [“java”,”.jar”,”Demo.jar”] (“Demo” is my project name. It creates a Spring boot application.) I am using a Linux machine.

Should I restart docker container if I'm doing update

I’m using spotify docker client (8.7.1 version) to manage docker containers. Seems that if try to udpate hostconfig by calling updateContiner method nothing works.. All of this I’m doing when container is started. Should I restart container after update? ContainerInfo ci = containerManager.createContainer(godzillaName, imagePath, new String[] {DEFAULT_API_PORT}, defaultNetwork.id(), networks); containerManager.startContainer(ci.id()); ContainerInfo info = containerManager.inspectContainer(ci.id()); HostConfig.RestartPolicy […]

Java stack trace overlaps error message

Debian Jessie and OpenJDK running on Windows Docker Toolbox, strange behavior from printStackTrace() on an Exception: The Exception is a java.lang.NullPointerException, but somehow the stack trace is overwriting or overlapping the first line of the error message, making it difficult to debug. I added the red line to delineate the stack trace text. Anyone seen […]

How to add 3rd party jar to maven container docker

Hi i have developed a Java application which will take data from MsSql DB and push this data to Salesforce account. I have created this project as Maven project. The Jars used for Sql and salesforce are local one. I have installed locally using mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \ -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> And able to […]

Java ee api gets 404 on payara production server

I’m running a java ee application on payara server with docker-compose, the application seems to work normally locally. But when deployed it will give a 404 on all “/api” requests. The jsp files seem to work fine. @ApplicationPath(“/api”) public class SimulationApplication extends Application { } Is there something that could cause this behaviour. I already […]

Docker java pass startup param to jar

Here is my Dockerfile: FROM java:8 EXPOSE 8080 ADD target/Demo.jar demo.jar RUN sh -c ‘touch /demo.jar’ ENV JAVA_OPTS=”” ENTRYPOINT [ “sh”, “-c”, “java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /demo.jar” ] And my question is how can i pass some startup param like in normal call .jar file. For example when i call: java -jar demo.jar param1 param2 […]

Failed connections between docker containers

My application consists of a standalone java server, a client java web start application, a set of webapps that all run in one wildfly instance, and postgres. The client container is just an nginx server that serves a JNLP and corresponding java client. All of my containers are running on the same host. Here’s a […]

running a Docker container with Java application and a webserver doesnt work

Im a new to docker and i am trying to create a container running multiple services, using this documentation:Run multiple services in a container I’ve managed to get Java and Nodejs installed on the containe, eventually leading to running this script at the end of the Dockerfile as an ENTRYPOINT: #!/bin/bash # Start the first […]

Tomcat freezes in Docker container when starting

Here’s the thing. I have the following Dockerfile: DOCKERFILE FROM centos:centos7 MAINTAINER Legos ADD epel-release-7-9.noarch.rpm /etc/extras/epel-release-7-9.noarch.rpm RUN rpm -Uvh /etc/extras/epel-release*rpm # Install prepare infrastructure RUN yum -y update && \ yum -y install wget && \ yum -y install tar && \ yum -y install haveged && \ yum -y install rng-tools RUN chkconfig haveged […]

How to wait a ResultCallback from DockerClient.waitContainerCmd()?

In our J2EE project, we’re doing some video conversion by calling sjourdan/ffmpeg docker from our java code, relying on docker-java. For now, it looks something like this (quite simplified for brevity): CreateContainerCmd createCommand = dockerClient.createContainerCmd(“sjourdan/ffmpeg”) .withVolumes(aVolume) .withBinds(aBind) .withCmd(“a lot of options about the conversion itself, codec, ratio, …”); CreateContainerResponse container = createCommand.exec(); dockerClient.startContainerCmd(container.getId()).exec(); // vanilla […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.