System.getProperty("sling.run.modes") not returning value | Community
Skip to main content
Level 3
October 16, 2015
Solved

System.getProperty("sling.run.modes") not returning value

  • October 16, 2015
  • 1 reply
  • 1045 views

All,

we're running 5.6.1. I've started CQ by renaming my jar files:

1) cq5-author-4502

2) cq5-publish-4503

I have a servletfilter that checks the runmode you're in using this way:

System.getProperty("sling.run.modes")

 

However, when I just run the Author from the quickstart jar, this returns null. When I run Author in debug mode it works fine.

When I run Publish from the quickstart.jar it also runs fine (returns publish).

 

The strange thing is, when I check in the felix console xxx//system/console/status-slingsettings I do see in all cases the correct runmode displayed.

Anyone any idea? Or tips to help debug.

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 JustinEd3

This is not the correct way to get the current runmodes. You should use the SlingSettingsService and the getRunModes() method.

1 reply

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

This is not the correct way to get the current runmodes. You should use the SlingSettingsService and the getRunModes() method.