Override DefaultGetServlet config | Community
Skip to main content
Level 6
April 25, 2024
Solved

Override DefaultGetServlet config

  • April 25, 2024
  • 3 replies
  • 1293 views

Hello Community,

We have a requirement to override some of the properties that are part of the "Apache Sling Get Servlet (org.apache.sling.servlets.get.DefaultGetServlet)". Since this is not a factory config, we don't need to specify "-<identifier>".

I have tried using the following configuration under the paths mentioned below. However, when checking the values in system/console/configMgr, it is not picking up the custom config.

/apps/project1/osgiconfig/config/org.apache.sling.servlets.get.DefaultGetServlet.cfg.json

/apps/project1/osgiconfig/config/org.apache.sling.servlets.get.DefaultGetServlet.config

Do I need to override the config under this path?

/apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet.config

Please let me know if anyone has customized this config in your project. Thank you.

 

@joerghoh @estebanbustamante @vijayalakshmi_s 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

Yes of course. The problem here is, even though I have kept the config under the below path. In some instances, I see it is still pointing to /apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet.config not picking the config from the project folder. I have verified the OSGi-installer console and the status of the config from the project folder says "Install". and the one from the /apps/system/  says "INSTALLED".

 

I had to manually delete the config under /apps/system/config/ and edit the config in the web console and then only it pointed to the project folder but we don't have the liberty to make such manual changes in Prod instance.

 

 /apps/project1/osgiconfig/config/org.apache.sling.servlets.get.DefaultGetServlet.cfg.json

 


@test1234567 

 

We cannot override the preference order. I suggest taking a back-up of configs in production. Install project specific configs and then delete the one in /apps/system.

Perform this operation on one instance at a time and validate.

3 replies

aanchal-sikka
Community Advisor
Community Advisor
April 25, 2024

@test1234567 

 

We should not check-in configs under /apps/system. These are created when we manually save values from OSGi console.

 

I guess OOTB there is no entry for "/apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet.config".
Please cross-check and remove if it was created by you. 

 

After removing, please check if your project specific configs are available via /apps/project1/osgiconfig/config/org.apache.sling.servlets.get.DefaultGetServlet.cfg.json

 

Aanchal Sikka
Level 6
April 25, 2024

Thanks for your reply. If it is lower environment, we can remove the entries from this path /apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet.config but we may have the entries in Prod as well and we have some restrictions to remove the entries from /apps/system. How can we address this scenario?

joerghoh
Adobe Employee
Adobe Employee
April 26, 2024
HrishikeshKagne
Community Advisor
Community Advisor
May 5, 2024

Hi @test1234567 ,

To override the configuration of the Apache Sling Get Servlet (org.apache.sling.servlets.get.DefaultGetServlet), you typically need to place your custom configuration under the /apps/system/config/ directory.

So, the correct path for your custom configuration file would be:

 

/apps/system/config/org.apache.sling.servlets.get.DefaultGetServlet.config

 

Ensure that the configuration file follows the correct format and includes the properties you want to override. Once you place the configuration file in the correct location, you should see the updated values reflected in the system console under the Configuration Manager (/system/console/configMgr).

If you're still not seeing the changes take effect after placing the configuration file in the correct location, make sure that the configuration properties are correctly defined and that there are no syntax errors in your configuration file. Additionally, you may need to restart Apache Sling or the entire AEM instance for the changes to take effect.

If you continue to encounter issues, you may want to check the Apache Sling documentation or seek assistance from the Apache Sling community for further troubleshooting.

 

Hrishikesh Kagane
kautuk_sahni
Community Manager
Community Manager
May 16, 2024

@test1234567 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni