Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest controllers do not work if added as part of aps-extension-jar #65

Closed
dilip-chenani opened this issue Feb 9, 2023 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dilip-chenani
Copy link

dilip-chenani commented Feb 9, 2023

Rest controllers do not work if added as part of aps-extension-jar.
We created the custom rest endpoint following this document : https://docs.alfresco.com/process-services/latest/develop/dev-ext/#custom-rest-endpoints. There is also a "note" mentioned in documentation about same :
Note: Due to classloading, it is currently not possible to put jars with these custom rest endpoints in the global or common classpath (for example tomcat/lib for Tomcat). They should be put in the web application classpath (for example WEB-INF/lib).

@OpenPj
Copy link
Owner

OpenPj commented Feb 9, 2023

Hi Dilip,
the final artifact built by theaps-extensions-jar module is included in the WAR overlayed used by the container, so inside the activiti-app.war built by the APS SDK you will find the extensions JAR as expected, below the war overlay configuration included in the SDK:
https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/activiti-app-overlay-war/pom.xml

APS SDK creates the activiti-app.war for you with the aps-extensions-jar inside the WAR. Then the custom WAR is included in the aps-current-project container. So if you follow the examples included in the APS SDK there is no problem at all.

If you are deploying your extensions without using the activiti-app-overlay-war and activiti-app-overlay-docker module included in the SDK, you have to build by yourself your own Maven project for your specific purpose.

Please let me know if you need more informations.

@dilip-chenani
Copy link
Author

dilip-chenani commented Feb 9, 2023

Thanks @OpenPj for quick response and details.
I was creating a Dockerfile and was referring to this file from SDK : https://github.com/OpenPj/alfresco-process-services-project-sdk/blob/master/activiti-app-overlay-docker/src/main/docker/Dockerfile .
On line 20, it is moving the extensions jar to tomcat/lib. I was also trying the same thing. I used maven to build my extensions jar and then tried to move that jar using Dockerfile to /tomcat/lib , and it was not working. Surprisingly, activiti-app.properties and license file do work if thrown at same location tomcat/lib.

Do you know what could be the reason for it?

@OpenPj
Copy link
Owner

OpenPj commented Feb 9, 2023

Ohhh I see 😮 , thank you so much @dilip-chenani for raising this issue, it's a problem to solve and it was created for the old versions of the APS SDK. The initial version of the APS SDK was based on the aps-extensions-jar module with a Dockerfile, so for that specific project layout was fine.

Now we have a module totally dedicated to create the activiti-app.war from scratch so I think that we have to remove that command from both the editions of the APS SDK 1.x and 2.x (this because we have the same issue also in 2.x 😅).

It's up to developers then to choose the right approach for their build process but we have to solve this problem to avoid any classloading issue. We could leave the command inside the Dockerfile commented and if someone needs it, they only need to uncomment it for enabling it.

@OpenPj OpenPj self-assigned this Feb 9, 2023
@OpenPj OpenPj added the bug Something isn't working label Feb 9, 2023
@OpenPj
Copy link
Owner

OpenPj commented Feb 9, 2023

I added something in the latest commit 1.8.0-SNAPSHOT (main trunk) we don't have an official release yet, @dilip-chenani feel free to clone the main trunk and test everything. Hopefully tomorrow we will have two new releases for both the SDKs 😄

OpenPj added a commit that referenced this issue Feb 9, 2023
….11.5 (#67), added jpda debug feature on port 5005 (#36), updated Maven plugins (#66), removed extensions JAR from tomcat/lib (#65)
OpenPj added a commit that referenced this issue Feb 9, 2023
….11.5 (#67), added jpda debug feature on port 5005 (#36), updated Maven plugins (#66), removed extensions JAR from tomcat/lib (#65)
@OpenPj
Copy link
Owner

OpenPj commented Feb 10, 2023

If you are using APS SDK 1, I have just released APS SDK 1.8.0:
https://github.com/OpenPj/alfresco-process-services-project-sdk/releases/tag/v.1.8.0

APS SDK 2.2.0 is coming soon... 😄

OpenPj added a commit that referenced this issue Feb 10, 2023
… commented jar deployment in tomcat/lib (#65), upgraded Maven plugins (#66)
@OpenPj
Copy link
Owner

OpenPj commented Feb 13, 2023

Released with APS SDK 2.2.0 and APS SDK 1.8.0

@OpenPj OpenPj closed this as completed Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants