Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Configuring the externalizer service via XML file

Avatar

Level 4

I'm having trouble configuring the externalizer service via an XML file.

The first thing I did was add a domain via the Felix console to test, and that worked. Then I created a file in my project at /apps/client/project/config/com.day.cq.commons.impl.ExternalizerImpl.xml. It looks like

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" externalizer.contextpath="" externalizer.host="" externalizer.domains="[local http://donotuse.com,author http://donotuse.com,publish http://donotuse.com,project-placeholder http://project-placeholder.com]"/>

When I build the project with Maven, I can see that this does get successfully deployed by looking at CRXDE Lite. However, the configuration that I see in the Felix console never changes to reflect this.

I also tried moving this XML file to /apps/client/project/config.author, with the same results.

I also tried looking in CRXDE Lite /apps/system/config for the configuration I set via Felix, and didn't find it. I did find it on the file system, and after restarting AEM, the configuration has returned to the default configuration, not what I specified in my XML file.

Is there something wrong that I'm not seeing in my XML?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 4

Found it!

In my first post, I mentioned "I also tried looking in CRXDE Lite /apps/system/config for the configuration I set via Felix". I don't know which article I found that suggested looking there, but it turns out there was a node in /apps/cq/commons that appears to have the values I set in the Felix interface. This node was taking precedence over the node I created in my actual project.
 

Thanks for your time, all.

View solution in original post

10 Replies

Avatar

Level 10

Joel Triemstra wrote...

I'm having trouble configuring the externalizer service via an XML file.

The first thing I did was add a domain via the Felix console to test, and that worked. Then I created a file in my project at /apps/client/project/config/com.day.cq.commons.impl.ExternalizerImpl.xml. It looks like

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
  3. jcr:primaryType="sling:OsgiConfig"
  4. externalizer.contextpath=""
  5. externalizer.host=""
  6. externalizer.domains="[local http://donotuse.com,author http://donotuse.com,publish http://donotuse.com,project-placeholder http://project-placeholder.com]"/>

The content of config looks ok to me. But the extension of file ".xml" does not make sense.  Can you send snapshot from crxdelight ?

When I build the project with Maven, I can see that this does get successfully deployed by looking at CRXDE Lite. However, the configuration that I see in the Felix console never changes to reflect this.

Config not picked by installer & hence not seeing it.

I also tried moving this XML file to /apps/client/project/config.author, with the same results.

I also tried looking in CRXDE Lite /apps/system/config for the configuration I set via Felix, and didn't find it. I did find it on the file system, and after restarting AEM, the configuration has returned to the default configuration, not what I specified in my XML file.

Which version of AEM?   Sounds like enable write back is disabled. Verify at http://host:port/system/console/configMgr/org.apache.sling.installer.provider.jcr.impl.JcrInstaller

Is there something wrong that I'm not seeing in my XML?

Thanks

 

Avatar

Level 4

Thanks, but it looks like that's not making a difference.

Avatar

Level 4

I'm using AEM 6.1, and writeback is enabled.

Here's a screenshot of what I see in CRXDE Lite after deploying my package

[img]Externalizer1.jpg[/img]

Also, here's a screenshot of my project in Eclipse - hopefully that explains where the XML file I'm referring to comes from. I believe the other OsgiConfigs in there are working properly.

[img]Externalizer2.jpg[/img]

Avatar

Level 10

Hi Joel,

I tried the same thing and it seems to be working. Can you remove the properties externalizer.contextpath and host.

 

Regards,

Lokesh

Avatar

Level 4

That also doesn't seem to be making a difference.

When you add the \ character, as in

externalizer.domains="[local\ http://donotuse.com,author\ http://donotuse.com,publish\ http://donotuse.com,project-placeholder\ http://project-placeholder.com]"/>

do you see that character in CRXDE Lite after deploying? I don't; I'm assuming it's behaving as an escape character, so I shouldn't see it, but wanted to double check.

Avatar

Level 10

Steps I followed which worked for me

1. copy the 'config.author' folder from /libs/cq/commons where the OOB configuration resides

2. paste it under the 'config' folder in under /apps/<project>

3. Change the values for different instances required and save.

Avatar

Correct answer by
Level 4

Found it!

In my first post, I mentioned "I also tried looking in CRXDE Lite /apps/system/config for the configuration I set via Felix". I don't know which article I found that suggested looking there, but it turns out there was a node in /apps/cq/commons that appears to have the values I set in the Felix interface. This node was taking precedence over the node I created in my actual project.
 

Thanks for your time, all.

Avatar

Level 10

check if you have the correct Service PID

Avatar

Level 4

The PID is

com.day.cq.commons.impl.ExternalizerImpl

And that just needs to match the file name, correct?

com.day.cq.commons.impl.ExternalizerImpl.xml

I think I'm good from that respect - is there another place the PID comes into play?

Thanks

Avatar

Level 10

As @Sham mentioned, just the file name saving as .xml will not work,

Can you let us know the steps you have followed or how have you created this configuration.