As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hello,
I'm trying to install hotswap agent in an Alfersco sdk 4.1 platform project, I see that hotswapagent is enabled in the logs but actually the reload of the classes does not happen. i've followed the guide so i0ve added in 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/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 COPY hotswap-agent.properties $TOMCAT_DIR/webapps/alfresco/WEB-INF/classes
skdl-web-alfresco-acs: image: alfresco-content-services-skdl-web-alfresco:development build: dockerfile: ./Dockerfile context: ../../../target environment: CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888" command: ["catalina.sh", "run"] ports: - "${acs.port}:8080" - "${acs.debug.port}:8888" volumes: - skdl-web-alfresco-acs-volume:/usr/local/tomcat/alf_data - ../../../target/classes:/usr/local/tomcat/hotswap-agent/skdl-web-alfresco/target/classes - ../../../target/test-classes:/usr/local/tomcat/hotswap-agent/skdl-web-alfresco/target/test-classes depends_on: - skdl-web-alfresco-postgres
As I said hotswapagent reloads the classes in the mount points. But if I print in a class ClassName.class.getProtectionDomain().getCodeSource().getLocation(), I see that it comes from the jar file and not from hotswapagent, in fact if I make a change to the class it is not modified "hot".