Tag: java

Launching Docker demon from Java Service

Trying to launch a docker container in demon mode using shell script from java service deployed on Tomcat, on an ubunty based VM. I have a java based REST service which has been deployed on tomcat, on the same VM i have installed Docker. I have created a shell file to launch my docker container. […]

How to configure GWT debugging with docker?

I have my GWT project deploying in the docker containers. Tomcat application server container requires my_project.war, so every time I make a change in the code, I have to rebuild my project, replace old .war with the new one, rebuild container and run it again. This appears to be very ineffective and frustrating. My question […]

How to build Dockerfile with two jar files

I’m starting with Docker and I’m a little bit lost. I have my java experiment with two jar files, zip files with testing data and two configuration files. And I’m trying to run this exp on Docker. If I want to run this exp on my pc there are two phases. Phase 1: java -classpath […]

Why would I need to run docker privileged to access host log4j2.yaml

I’ve got a centos 7 image in a centos 7 host. My entrypoint uses -Dlog4j.configurationFile=file:/opt/foo/bar/log4j2.yaml I use a -v switch to share /home/fooser/log4j2.yaml:/opt/foo/bar/log4j2.yaml When I just use –cap-add SYS_ADMIN (I need samba access), log4j is unable to access it’s config file; however, if I use –privileged, everything works. I understand I must need an additional […]

Add new Tomcat containers behind Apache with Docker

I have a Java web app running on Tomcat behind Apache. I want to launch a new Tomcat container for each new customer, but all of them behind the same Apache. Each client has its own subdomain, and Apache proxies them to the right Tomcat instance. Here is an example of my Apache configuration for […]

getting java.net.SocketException: Invalid argument:inside docker container

I have a java program that runs inside a docker container. This program tries to connect to a Ipv4 socket. I get the following Invalid argument exception Caused by: java.net.SocketException: Invalid argument: / at sun.nio.ch.Net.connect0(Native Method) at sun.nio.ch.Net.connect(Net.java:454) at sun.nio.ch.Net.connect(Net.java:446) at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648) at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:209) at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:199) at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1089) at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:543) at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:528) at io.netty.handler.ssl.SslHandler.connect(SslHandler.java:415) at […]

AOT Compiler to Shrink Docker Container

Is using an AOT compiler such as GCj or Excelsior Jet appropriate if we’re aiming to shrink the size of a Docker container? The largest part of the container is the JRE, and we’re looking for ways to trim this down. Our microservices are kb in size, it seems odd that we’re having to deploy […]

spring rabbitmq client closes channel with error “Channel shutdown: connection error”

I am running a spring java application in a docker container which connects to rabbitMQ server running on other docker container. I observed that when my application thread doing some long processing, in the middle of processing i am getting the following error messages from rabbitMQ on stdout. ERROR CachingConnectionFactory:281 – Channel shutdown: connection error […]

NoClassDefFoundError in Tomcat for Abstract Class

I have an abstract class, Problem. It’s package is com.namespace.problem. My tomcat app calls Problem.staticMethod() on each page. I get a 500 error, NoClassDefFoundError on every page. In the debugger, I can access static fields from Problem. I can successfully place breakpoints on its instance methods. It fails to place breakpoints on static methods and […]

Run war with tomcat in docker

I’ve followed these two post 1 & 2 and neither work. I’m currently building my tomcat with the below. Build File FROM tomcat:8.0 COPY server/build/libs/server.war /usr/local/tomcat/webapps/server.war CMD [“catalina.sh”, “run”] Terminal docker build -t my_server . docker run -it -rm -p 8080:8080 When I go to http:localhost:8080 I see the manager home page but http:localhost:8080/server or […]

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