cancel
Showing results for 
Search instead for 
Did you mean: 

Broken HOTSWAP Agent with SDK4.3

upforsin
Star Collaborator
Star Collaborator

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 ACCEPTED ANSWER

upforsin
Star Collaborator
Star Collaborator

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 answer in original post

1 REPLY 1

upforsin
Star Collaborator
Star Collaborator

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
Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.