Greg's Blog

helping me remember what I figure out

Where CF Mappings Are Stored in MX Running on JRUN

| Comments

Ever wondered were CF MX stores all it’s mapping information? Well we were and Simon Horwith of the CFDJ list was kind enough to point it out for us. As with most things these days the information is captured in an XML file called neo-runtime.xml and resides in {root_drive}\JRun4\servers\{server_name}\cfusion-ear\cfusion-war\WEB-INF\cfusion\lib. He also indicated that the information was actually captured in a WDDX packet.

So I went and took a peak at the file and it actually stores a lot of the cfadmin information, such as the servers settings (missing template, site wide template, Timeout Requests and Enable HTTP status), cache settings (trusted cache, Template cache size, save class files), memory variables (session and application), mappings, logging settings (slow Request Time Limit), mail settings (mail char settings) and custom tag paths.

Using a WDDX packet as the store for such information opens up the options to use it programmatically and Simon Horwith was again kind enough to provide a sample script:

<cfscript>
foo=”myMappingName”;
bar = “myMappingValue”;
factory = createObject(“java”,”coldfusion.server.ServiceFactory”);
runtime = variables.factory.getRuntimeService();
maps = variables.runtime.mappings;
maps[variables.foo] = variables.bar;
</cfscript>

As it’s WDDX the data is returned or added programmatically in the shape of structures, which as he suggest allows possibly for the use of StructDelete() to remove mappings programmatically as well. But he did also point out that this is something you’d do at your own risk.

While I was in the aforementioned folder I decided to take a closer look at some of the XML files in there:

  1. neo-security.xml: This file contains references to security information held in the cfadmin under security. There are three Boolean settings here, one for enabling a password for cfadmin, another for RDS and yet another for sandbox security. There is also a reference to context, but I am not sure what this is for.
  2. neo-query.xml: Holds a lot of database related information. Specifically for query caching in the cache settings of cfadmin there is an entry. I also saw a bunch of information relating to SQL statements, though not entirely sure what it is used for. And finally there is a lot of what looks like database driver information.
  3. neo-mail.xml: This WDDX packet stores all of the mail settings found in cfadmin.
  4. neo-logging.xml: expands on the logging information already captured in neo-runtime.xml. It also contains information that is not accessible in cfadmin, such as the log pattern.
  5. neo-cron.xml: This one stores all the scheduled tasks set up in cfadmin.
  6. neo-debug.xml: as the name indicates this stores the setting for debugging, both for debugging and debugging IP addresses in cfadmin.