Alfresco / alfresco-sdk

The Alfresco In-Process SDK is based on Apache Maven, includes support for rapid and standard development, testing, packaging, versioning and release of your Alfresco integration and extension projects
Apache License 2.0
185 stars 113 forks source link

HotSwap capability for SDK4 beta does not work #543

Closed FilipBruska closed 3 years ago

FilipBruska commented 5 years ago

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request

Expected Behavior

SDK4 with HotSwap capability should start properly according to https://github.com/Alfresco/alfresco-sdk/blob/sdk-4.0/docs/advanced-topics/hot-reloading/hotswap-agent.md#configuring-hotswapagent-in-the-project-java-11

Current Behavior

Following error can be seen (link to full log is mentioned in last section):

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
ERROR: Service 'hotswap-acs' failed to build: The command '/bin/sh -c 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' returned a non-zero code: 2

Possible Solution

I tried to gunzip compressed file and adjust Dockerfile but no success

Steps to Reproduce (for bugs)

  1. Generate a new AIO SDK4 project named hotswap (whole path is /opt/alfresco/sdk/hotswap)
  2. $ cd /opt/alfresco/sdk/hotswap/hotswap-platform-docker/src/main/docker
  3. $ wget https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases/download/dcevm-11.0.1%2B7/java11-openjdk-dcevm-linux.tar.gz
  4. $ mv java11-openjdk-dcevm-linux.tar.gz trava-jdk-11-dcevm.tar.gz # Rename TravaJDK to follow the same filename as in Dockerfile
  5. Appending commands for TravaJDK and hotswap-agent.properties to Dockerfile
  6. Appending command and volumes parts to /opt/alfresco/sdk/hotswap/docker/docker-compose.yml:
    command: ["catalina.sh", "run"]

    and

      - ../../../hotswap-platform-jar/target/classes:/usr/local/tomcat/hotswap-agent/hotswap-platform-jar/target/classes
      - ../../../integration-tests/target/test-classes:/usr/local/tomcat/hotswap-agent/integration-tests/target/test-classes

Context

Hot reloading feature is not working

Your Environment

Additional information

Whole log is available on my gist

ohej commented 5 years ago

This might be caused by the Maven resources plugin trying to filter the .gz file. This has been fixed in the sdk-4.0 branch, but wasn't fixed until after we released the first beta.

Can I ask that you try and edit your platform-docker/pom.xml ?

You'll need to add

                                        <include>**/*.gz</include>

To the configuration in the resources plugin. You can compare your local file to the one in the sdk-4.0 branch here: https://github.com/Alfresco/alfresco-sdk/blob/sdk-4.0/archetypes/alfresco-allinone-archetype/src/main/resources/archetype-resources/__rootArtifactId__-platform-docker/pom.xml#L138

FilipBruska commented 5 years ago

Hi Ole, The problem with gz file was fixed by adding include/exclude params to maven-resources-plugin configuration. Anyway, I am still facing some issues. I will need to do more testing on my side and then I will provide you more info. You can expect more tomorrow.

FilipBruska commented 5 years ago

As mentioned above, I still face some issues during Alfresco startup (even with include/exclude part for *.gz files). Repo does not start properly - full Docker compose log is here. You can see that spring beans cannot be created properly.

Btw, I can see more differences in platform-docker/pom.xml between sdk-4.0 branch and 4.0.0-beta-1. For example, there are different versions of maven-dependency-plugin and maven-resources-plugin defined using pluginManagement. Can it cause any issues?

@ohej: Are you going to release SDK 4.0.0-beta-2?

Joysond commented 5 years ago

Hi Ole, The problem with gz file was fixed by adding include/exclude params to maven-resources-plugin configuration. Anyway, I am still facing some issues. I will need to do more testing on my side and then I will provide you more info. You can expect more tomorrow.

I am facing similar issue with hotswap :(

FilipBruska commented 5 years ago

@ohej : Do you have any news related to HotSwap and SDK4? I can see there is a pull request for final SDK4 but I cannot see anything about HotSwap.

christian-riedlberger commented 5 years ago

Has there been any resolution to this issue?

FilipBruska commented 5 years ago

@kat-riedlberger : Unfortunately, I haven't received any hint how to get it working.

10SPD commented 5 years ago

Is it the assumption we should pay for a RJebel license now then?

FilipBruska commented 5 years ago

@10SPD: You can spend ages by Alfresco restarts or pay some money to ZeroTurnaround (JRebel creator) ... it's your choice. Well, I miss official Alfresco statement if this issue with HotSwap is going to be solved or not.

10SPD commented 4 years ago

Since we just got a very large quote from JRebel folks based on annual subscription - I do not anticipate us moving to that. Any news on HotSwap from anyone?