Broken HOTSWAP Agent with SDK4.3

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

Broken HOTSWAP Agent with SDK4.3

Jump to solution

Has anyone tried to set up HOTSWAP AGENT with the newest SDK 4.3? It seems like the Docker configuration is somehow broken.

Step 14/15 : RUN tar -xvf $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz -C /usr/java/ && rm $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz && alternatives --install /usr/bin/java java /usr/java/dcevm-11.0.1+7/bin/java 40000 && alternatives --install /usr/bin/javac javac /usr/java/dcevm-11.0.1+7/bin/javac 40000 && alternatives --install /usr/bin/jar jar /usr/java/dcevm-11.0.1+7/bin/jar 40000 && alternatives --set java /usr/java/dcevm-11.0.1+7/bin/java && alternatives --set javac /usr/java/dcevm-11.0.1+7/bin/javac && alternatives --set jar /usr/java/dcevm-11.0.1+7/bin/jar && ln -sfn /usr/java/dcevm-11.0.1+7 /usr/java/latest && ln -sfn /usr/java/dcevm-11.0.1+7 /usr/java/default
---> Running in ea6b71afb791
tar: /usr/java: Cannot open: No such file or directory tar: Error is not recoverable: exiting now

I tried to replace "/usr/java" with "/usr/bin/java" but then other errors occur (jar not found, etc.)

While using previous versions of the maven docker AIO archetype, it works (I use this guide).

It looks like in the lastest Docker alfresco-content-services container, system and Java configuration has changed and the following lines does not work anymore.

RUN tar -xvf $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz -C /usr/java/ && \
    rm $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz && \
    alternatives --install /usr/bin/java java /usr/java/dcevm-11.0.1+7/bin/java 40000 && \
    alternatives --install /usr/bin/javac javac /usr/java/dcevm-11.0.1+7/bin/javac 40000 && \
    alternatives --install /usr/bin/jar jar /usr/java/dcevm-11.0.1+7/bin/jar 40000 && \
    alternatives --set java /usr/java/dcevm-11.0.1+7/bin/java && \
    alternatives --set javac /usr/java/dcevm-11.0.1+7/bin/javac && \
    alternatives --set jar /usr/java/dcevm-11.0.1+7/bin/jar && \
    ln -sfn /usr/java/dcevm-11.0.1+7 /usr/java/latest && \
    ln -sfn /usr/java/dcevm-11.0.1+7 /usr/java/default

 

howkymike
Alfresco Developer
1 Solution

Accepted Solutions
upforsin
Senior Member

Re: Broken HOTSWAP Agent with SDK4.3

Jump to solution

If anyone had the same problem, I solved it using the following code in the Dockerfile:

# HOTSWAP AGENT
# Install and configure Trava OpenJDK (OpenJDK pre-built with DCEVM and hotswap agent for Java 11)
COPY trava-jdk-11-dcevm.tar.gz $TOMCAT_DIR
RUN tar -xvf $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz -C /usr/lib/jvm/ && \
    rm $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz && \
    alternatives --install /usr/bin/java java /usr/lib/jvm/dcevm-11.0.1+7/bin/java 40000 && \
    alternatives --install /usr/bin/javac javac /usr/lib/jvm/dcevm-11.0.1+7/bin/javac 40000 && \
    alternatives --set java /usr/lib/jvm/dcevm-11.0.1+7/bin/java && \
    alternatives --set javac /usr/lib/jvm/dcevm-11.0.1+7/bin/javac && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/latest && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/default && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/jre
    
howkymike
Alfresco Developer

View solution in original post

1 Reply
upforsin
Senior Member

Re: Broken HOTSWAP Agent with SDK4.3

Jump to solution

If anyone had the same problem, I solved it using the following code in the Dockerfile:

# HOTSWAP AGENT
# Install and configure Trava OpenJDK (OpenJDK pre-built with DCEVM and hotswap agent for Java 11)
COPY trava-jdk-11-dcevm.tar.gz $TOMCAT_DIR
RUN tar -xvf $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz -C /usr/lib/jvm/ && \
    rm $TOMCAT_DIR/trava-jdk-11-dcevm.tar.gz && \
    alternatives --install /usr/bin/java java /usr/lib/jvm/dcevm-11.0.1+7/bin/java 40000 && \
    alternatives --install /usr/bin/javac javac /usr/lib/jvm/dcevm-11.0.1+7/bin/javac 40000 && \
    alternatives --set java /usr/lib/jvm/dcevm-11.0.1+7/bin/java && \
    alternatives --set javac /usr/lib/jvm/dcevm-11.0.1+7/bin/javac && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/latest && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/default && \
    ln -sfn /usr/lib/jvm/dcevm-11.0.1+7 /usr/lib/jvm/jre
    
howkymike
Alfresco Developer