Adding Apache ACE target configuration files - bundle

Does anyone know how to put/load configuration files required for a target in Apache ACE other than configurator? I am using apache configurator to pick .cfg files from conf directry but i always get the error:
*ERROR* Unexpected problem providing configuration xxxxx to service [xxx, id=xx, bundle=xx/osgi-dp:xxx]
Does anyone knows how to fix this?

The configurator bundle was designed to provide configuration via "cfg" files to the ACE server, relay and client. It was not designed for provisioning configuration data to a target. From your question, it looks like you are trying to do that, so...
For doing that, ACE supports the Auto Configuration Service as described in chapter 115 of the Compendium. In short, that specification uses configuration files in an XML format. These files, along with the resource processor, then get provisioned with the end result that the configuration data is sent to the Configuration Admin service automatically. More documentation about that process, and using "template" configuration files (in case you need to configure many targets with only a few differences between them) is described here:
http://ace.apache.org/user-doc/user-guide.html#using-the-template-engine-for-targets

Related

How configs pick ENV value

We have a config folder structure in apps like this:
config
config.author.test
config.author.stage
These have config.runmode.env values
I wanted to know from where It picks the "env" value.
I thought it is coming from runmodes. but in the instances, stage or test is nowhere.
Can anyone please help me know where does the AEM configs picks the value or where do we define those env value. Is it in some OSGi configuration or from where.
If you are not using the AEM runtime for the AEM Cloud SDK, then the run modes can be set in other ways as well apart from the sling.properties file. So depending on how you are starting your AEM server check if the run modes have been specified using the other options.
If you are using the AEM runtime from the cloud SDK, then check if the Jar file is named as shown in the Quickstart jar startup modes.

Where are the Configurations made in OSGi Console saved?

When we update any configuration for a component in the Configurations tab in the Apache Felix Web OSGi Console, where are these configuration settings saved? This is with respect to AEM 6.0 or above.
The manually saved configuration settings are stored in the the crx-quickstart/launchpad/config directory (in your AEM installation folder in the local file system) and, on top of that, as .config files in the Content Respository at /apps/system/config.
For example, if you're looking for the configuration of com.example.MyComponent, you can find it as a text file in crx-quickstart/launchpad/config/com/example/MyComponent.config (in the local file system) and at /apps/system/config/com.example.MyComponent.config inside your Content Repository.
The files at these two locations are updated when you change the settings manually in the OSGi console.
In AEM you can also store configuration in JCR nodes of the type sling:OsgiConfig. These will not be created or updated when you manually save the config but they offer a neat way of managing configuration as content.
When AEM looks for the configuration, the following order of resolution is used:
nodes under /apps/*/config, be it property files or JCR nodes with the node jcr:primaryType of sling:OsgiConfig
nodes with type sling:OsgiConfig under /libs/*/config, these are OOTB definitions for components that come with AEM
.config files from <aem-installation-directory>/crx-quickstart/launchpad/config/ on the local file system.
Depending on the OSGi configuration of Apache Sling JCR Installer, the sling:OsgiConfig nodes can be written back to when you manually change the config. There's also a number of settings affecting the lookup of said configurations so it's a good idea to familiarise oneself with this config.
Please check out the official documentation for more comprehensive information.
If you're trying to get a config stored in a sling:OsgiConfig node to work as expected and you're unsure if another config for the same service has been cached somewhere, here's a sequence of steps that has worked for me consistently in AEM 6.4:
Delete the sling:OsgiConfig node you just created
Go to the Felix console's configMgr, find the relevant service and Delete the configuration.
Recreate the sling:OsgiConfig node (I usually keep those in a CRX package that I can simply reinstall)
The configurations are stored by the felix configadmin bundle inside the felix bundle cache. Not sure where this cache is located in AEM. In Apache Karaf the configs in my case are in:
data/cache/bundle7/date/config
Where bundle id 7 is the id of the configadmin bundle.

Why Sling Configuration has two different formats

in Sling, configuration can be deployed either via a sling:osgiConfig node and via a nt:file node having the configuration values.
When i make some changes in Felix Console in some configuration deployed via sling:osgiConfig node, it gets converted to nt:file format.
Why there are these two different formats for configurations in Sling. is there any significant difference between the two?
I'd say this is mostly for historical reasons, in some cases it's more convenient to provide configurations as hierarchical resources (sling:OsgiConfig) and if the config is coming from a filesystem for example, files are more convenient.
#Shashi sling:osgiConfig changing to nt:file when you make changes in felix console is expected behaviour. This will not cause any issue when you try to read the config value from java class. You will just not be able to edit the run mode config via crxde when it has changed to nt:file as it stores data as binary content.
However there is a way to disable this behaviour, you will have to uncheck "Enable Write Back" at /system/console/configMgr/org.apache.sling.installer.provider.jcr.impl.JcrInstaller as mentioned in this thread.
OSGi config best practices

Spnego setup with websphere custom SSOAuthentication

I am trying to setup Websphere with Spnego. I have my custom SSOAuthentication implementation (the application needs to run o several different web servers). The problem i am facing is that the spnego-client configuration is being searched in
wsjaas.conf file, while i have it setup in a custom conf file. Is there a way to use my custom .conf file and not the wsjaas.conf?
You can change this by editing a system launch properties file /AppServer/properties/systemlaunch/base/.systemlaunch.properties
There you have configured the java.security.auth.login.config

wsadmin: wsInstallApp ejb reference mapping error

I am trying to install EAR file with EJB module on IBM WAS 7.0.0.27 by using WSADMIN-wsInstallApp (for automation). but its getting below error
**WASX7109E: Insufficient data for install task "MapResRefToEJB.**
But the same ear file can be deployed manually by IBM console.
it looks ejb mapping reference issue. i tried so many ways but couldnt get the solution.
can anyone please suggest for a solution.
Code
target name="installEAR"
wsInstallApp ear="${earFile}" options="-appname ${application}" wasHome="${wasHome.dir}" profileName="${profileName}" conntype="${connType}" port="${port}" host="${hostName}" user="${userId}" password="${password}" /target>
Try:
options="app-name ${application} -usedefaultbindings"
If you actually want to specify bindings, you'll need to replace -usedefaultbindings with -MapResRefToEJB ..., where the options you specify need to be formatted based on the wsadmin scripting language you're using (jacl or jython). See the InfoCenter for a full AdminApp options, including -MapResRefToEJB and -MapModulesToServers.

Resources