Update to deployed AMP does not work

cancel
Showing results for 
Search instead for 
Did you mean: 
sepgs2004
Established Member

Update to deployed AMP does not work

We use Alfresco 5.2 Community.

Our AMP file is in the Alfresco/amps, and to deploy this AMP, we used apply_amps.bat in the Alfresco/bin folder

It all works good.

Then we made updates to our model, and so we prepared/packaged the new AMP.

Now I went and deleted the old AMP from the Alfresco/amps, and put this new one. Then I ran the apply_amps.bat again. 

For some reason, it deploys both the old and the new now. I wonder where it is getting the old from.

And finally, things does not work.

Is there anything that I am missing to do, to clean up the old AMPs from the server...

Is there a proper way to redeploy the updated AMPs to an alfresco instance?

FYI: If I do deploy this new AMP to a newly installed alfresco instance, it works great.

Gnanasekaran Sakthivel
5 Replies
sepgs2004
Established Member

Re: Update to deployed AMP does not work

I tried these instructions. Still I am not sure if the AMP is removed successfully

C:\alfresco-community>java -jar ./bin/alfresco-mmt.jar list tomcat/webapps/alfresco.war
Module 'custom-docmodel-platform-jar' installed in 'tomcat/webapps/alfresco.war'
- Title: Alfresco Platform/Repository JAR Module
- Version: 1.0-SNAPSHOT
- Install Date: Wed Sep 26 14:12:58 EDT 2018
- Description: Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 3
Module 'alfresco-share-services' installed in 'tomcat/webapps/alfresco.war'
- Title: Alfresco Share Services AMP
- Version: 5.2.0
- Install Date: Wed Sep 26 14:12:57 EDT 2018
- Description: Module to be applied to alfresco.war, containing APIs for Alfresco Share
Module 'org.alfresco.integrations.google.docs' installed in 'tomcat/webapps/alfresco.war'
- Title: Alfresco / Google Docs Integration
- Version: 3.0.4
- Install Date: Wed Sep 26 14:12:53 EDT 2018
- Description: The Repository side artifacts of the Alfresco / Google Docs Integration.
Module 'alfresco-aos-module' installed in 'tomcat/webapps/alfresco.war'
- Title: Alfresco Office Services Module
- Version: 1.1.6
- Install Date: Wed Sep 26 14:12:51 EDT 2018
- Description: Allows applications that can talk to a SharePoint server to talk to your Alfresco installation

C:\alfresco-community>java -jar ./bin/alfresco-mmt.jar uninstall custom-docmodel-platform-jar tomcat/webapps/alfresco.war

- Removing file '/WEB-INF/lib/custom-docmodel-platform-jar-1.0-SNAPSHOT.jar' from war
- Removing file '/WEB-INF/classes/alfresco/module/custom-docmodel-platform-jar/modifications.install' from war
- Removing file '/WEB-INF/classes/alfresco/module/custom-docmodel-platform-jar/module.properties' from war

C:\alfresco-community>

After this uninstall, if I list the modules, it still contains the module in alfresco.war

Can I assume that the module got uninstalled?

Gnanasekaran Sakthivel
jpotts
Professional

Re: Update to deployed AMP does not work

You do not need to uninstall old AMPs when you are installing the same AMP (same module ID) that has a newer version. But you do need to remove old versions of the AMP you are updating from the amps/amps_share directories before running apply_amps.

Assuming the version of your AMP is the same or higher, you should be able to copy it into the amps directory, make sure there are no other AMPs in that directory with the same module ID but a different file name (old versions, for example), and then re-run apply_amps. It works every time, quite reliably.

Additionally, when you run apply_amps, it should remove the exploded war file. Check to make sure that is happening. If it doesn't, and Tomcat does not re-deploy, your old AMP will still be in the exploded WAR directory.

It also might be a good idea for you to use versioning to reduce confusion. If your original AMP was 1.0-SNAPSHOT this new version ought to be 1.1-SNAPSHOT (or similar). You can control that by changing the version in your pom.xml files.

douglascrp
Advanced II

Re: Update to deployed AMP does not work

I like to have always brand new war files (alfresco.war and share.war) files when I am about to install new AMPs.

By the way, this is exactly what Loftux's script does when applying AMPs, as you can see at https://github.com/loftuxab/alfresco-ubuntu-install/blob/master/scripts/apply.sh

sepgs2004
Established Member

Re: Update to deployed AMP does not work

I have used apply_amps before in different environment. As far as I could say, It worked great.

But this time, I do not know why it does not seem to work. 

Therefore, I did try to uninstall them using the JAR file.

I could not explain the following behavior. 

The server is in a stopped state. Then I run the mmt jar with the list command. I see the module installed.

Then I call the mmt jar with uninstall command. It says it removes.

Then I call list again. I still see the module installed.

The only thing I could think of is the user permissions in this machine.

Nowadays, IT offices spawn up these virtual/cloud machines in few minutes.

I am working with a virtual machine on this. In my own physical development machine, apply_amps, or even the JAR way of installing/uninstalling works good.

Has anyone had any similar issue?

C:\alfresco-community>java -jar bin/alfresco-mmt.jar list tomcat/webapps/alfresco.war

Module 'lo-docmodel-platform-jar' installed in 'tomcat/webapps/alfresco.war'
   -    Title:        Alfresco Platform/Repository JAR Module
   -    Version:      1.0-SNAPSHOT
   -    Install Date: Mon Oct 22 09:30:09 EDT 2018
   -    Description:   Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 3
...
C:\alfresco-community>java -jar bin/alfresco-mmt.jar uninstall lo-docmodel-platform-jar tomcat/webapps/alfresco.war
   - Removing file '/WEB-INF/lib/lo-docmodel-platform-jar-1.0-SNAPSHOT.jar' from war
   - Removing file '/WEB-INF/classes/alfresco/module/lo-docmodel-platform-jar/modifications.install' from war
   - Removing file '/WEB-INF/classes/alfresco/module/lo-docmodel-platform-jar/module.properties' from war
C:\alfresco-community>java -jar bin/alfresco-mmt.jar list tomcat/webapps/alfresco.war
Module 'lo-docmodel-platform-jar' installed in 'tomcat/webapps/alfresco.war'
   -    Title:        Alfresco Platform/Repository JAR Module
   -    Version:      1.0-SNAPSHOT
   -    Install Date: Mon Oct 22 09:30:09 EDT 2018
   -    Description:   Platform/Repo JAR Module (to be included in the alfresco.war) - part of AIO - SDK 3
...
C:\alfresco-community>
Gnanasekaran Sakthivel
gmarink
Active Member

Re: Update to deployed AMP does not work

Douglas C. R. Paes gostaria de falar com você no privado.