Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Precedence/order of resolution of an instance's runmode coming from different configurations

Avatar

Level 2

Hello, I'm trying to figure out the order of precedence/resolution if one configures different run modes for the same instance using the different methods available, such as naming the jar file, passing in system or JVM arguments, and configuration in sling.properties.

The following documentation http://helpx.adobe.com/experience-manager/kb/RunModeSetUp.html says the following:

Behavior When Run Modes Are Specified More than One Way

The run mode specified in the naming of the jar file takes precedence. If run modes are not specified in the naming of the jar file, the values in the sling.properties file are used. If run modes are not specified in the either the naming of the jar file or the sling.properties file, the system property (or JVM argument) is used.

So this implies that the jar overrides the run mode set in sling.properties which overrides anything passed in through a system property (-D) or a JVM argument (-r)

 

Meanwhile, this documentation http://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/configure-runmodes.html has a conflicting order:

 

Starting CQ with a specific run mode

If you have defined configurations for multiple run modes then you need to define which is to be used upon startup. There are several methods for specifying which run mode to use; the order of resolution is:

  1. sling.properties file
  2. -r option
  3. system properties (-D)
  4. Filename detection

So the latter documentation implies that sling.properties takes precedence over JVM and System arguments, which take precedence over the naming of the jar.

Can anyone enlighten me as to what the actual order is? A couple of colleagues tested it and said system arguments took precedence, then sling properties, then the naming of the jar, so I've got three conflicting orders and I don't know which one to take as truth.

1 Accepted Solution

Avatar

Correct answer by
Level 10

The official document is almost correct but missing to highlight the way instance is started is missing.   The actual order additionally deponds on way you are staring aem instance.

  • Double clicking jar file
  • Starting from script
  • Starting as windows service.

Which method are you using to start?

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

The official document is almost correct but missing to highlight the way instance is started is missing.   The actual order additionally deponds on way you are staring aem instance.

  • Double clicking jar file
  • Starting from script
  • Starting as windows service.

Which method are you using to start?

Avatar

Level 2

If you don't mind, I'd love to know all three.

However, this is really more of a complaint, that there is contradictory documentation, and knowing this very thing is important for a reason I probably can't disclose. If it does depend on the method one starts it with, that should be in there.

I know you didn't write the documentation so thank you for your help, just hoping someone who sees this can pass it on to whoever is in charge of documentation.

Thanks again.