[Coldbox 3.7] SES Help

I have Coldbox running on Railo 4.1, Windows 7 with Apache.

The rewriting works but when I go to the url (ex http://localhost/contacts/editor) I get the default page, nothing changes. I’ve gone through the SES docs and followed the instructions. Can’t figure out whats wrong, tried fwrenint and restarting railo.

Files below: Config, Routes, Htaccess

Help appreciated :slight_smile:

Here is my config:
component{
// Configure ColdBox Application
function configure(){

// coldbox directives
coldbox = {
//Application Setup
appName = “ColdBox LITE Contact Manager”,

//Development Settings
reinitPassword = “”,
handlersIndexAutoReload = true,

//Implicit Events
defaultEvent = “contacts.index”,
requestStartHandler = “”,
requestEndHandler = “”,
applicationStartHandler = “”,
applicationEndHandler = “”,
sessionStartHandler = “”,
sessionEndHandler = “”,
missingTemplateHandler = “”,

//Error/Exception Handling
exceptionHandler = “”,
onInvalidEvent = “”,
customErrorTemplate = “includes/error.cfm”,

//Application Aspects
handlerCaching = false,

interceptors =
{
class=“coldbox.system.interceptors.SES”,
properties =
{
configFile = “config/Routes.cfm”
}
}
};

/**

// custom settings
settings = {
};
// environment settings, create a detectEnvironment() method to detect it yourself.
// create a function with the name of the environment so it can be executed if that environment is detected
// the value of the environment is a list of regex patterns to match the cgi.http_host.
environments = {
//development = “^cf8.,^railo.”
};

// Layout Settings
layoutSettings = {
defaultLayout = “”
};

//Register Layouts
layouts = [
{ name = “login”,
file = “Layout.tester.cfm”,
views = “vwLogin,test”,
folders = “tags,pdf/single”
}
];

*/
}

}

Here is my htaccess:

Bypass call related to adminstrators or non rewrite folders, you can add more here.

RewriteCond %{REQUEST_URI} ^/(.(CFIDE|cfide|CFFormGateway|jrunscripts|railo-context|mapping-tag|fckeditor)).$
RewriteRule ^(.*)$ - [NC,L]

Bypass flash / flex communication

RewriteCond %{REQUEST_URI} ^/(.(flashservices|flex2gateway|flex-remoting)).$
RewriteRule ^(.*)$ - [NC,L]

Bypass images, css, javascript and docs, add your own extensions if needed.

RewriteCond %{REQUEST_URI} .(bmp|gif|jpe?g|png|css|js|txt|pdf|doc|xls|ico)$
RewriteRule ^(.*)$ - [NC,L]

The ColdBox index.cfm/{path_info} rules.

RewriteRule ^$ index.cfm [QSA,NS]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.cfm/%{REQUEST_URI} [QSA,L,NS]

RewriteEngine on

Here are my routes:

Okay, I threw an abort dump in my config/Routes.cfm and did a fwreinit. This should produce the dump and nothing else, right, I got nothing. So this tells me the Routes is not getting called which makes me wonder if the interceptors = { class=“coldbox.system.interceptors.SES”… } line even works. Also upon looking at the example it is wrapped in curly brackets, however when I added the curly’s like so:
interceptors =
{ {

class=“coldbox.system.interceptors.SES”,
properties =
{
configFile = “config/Routes.cfm”
}
} }

I get the following error:
Railo 4.0.4.001 Error (expression)
Message invalid argument for JSON struct, only named arguments are allowed like {name:“value”,name2:“value2”}
Stacktrace The Error Occurred in
C:\Users\user\Documents\My Webs\frameworkone\config\Coldbox.cfc: line 38

36: interceptor = {
37: { class=“coldbox.system.interceptors.SES” }
38: };
39:

What am I missing here?

What do you get if you put this in your URL?
http://localhost/index.cfm/contacts/editor

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Same thing, the homepage.

Are you on the full ColdBox platform, (as opposed to ColdBox LITE)?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I am using the ActiveContactManager example from the lite test apps with
the full Coldbox framework.

Then, I’d say that rules out the web server rewrites as an issue. Do you have a handler called “contacts” with an action (method) called “editor”?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yeah, it brings up the form if I go to:
localhost/index.cfm?event=contacts.editor&contactID=4

Right, which is why I think it comes down to the config, the only way I could get the following line not to throw a railo error was to move the wrapping brackets. You can’t nest brackets with labeling them in railo:

So this:
interceptors =
{
{
class=“coldbox.system.interceptors.SES”,
properties = {configFile = “myconfig/path/Routes.cfm”}
}
}

Had to be changed to this to not throw an error but I fear that coldbox isn’t reading it right:
interceptors =

{
class=“coldbox.system.interceptors.SES”,
properties = {configFile = “myconfig/path/Routes.cfm”}
}

Okay, the error is also on Adobe Coldfusion 10. Go to http://cflive.net/ and copy/paste the following and run it, you should get a struct of settings, but instead you get errors:

coldbox = {
//Application Setup
appName = “ColdBox LITE Contact Manager”,

//Development Settings
reinitPassword = “”,
handlersIndexAutoReload = true,

//Implicit Events
defaultEvent = “contacts.index”,
requestStartHandler = “”,
requestEndHandler = “”,
applicationStartHandler = “”,
applicationEndHandler = “”,
sessionStartHandler = “”,
sessionEndHandler = “”,
missingTemplateHandler = “”,

//Error/Exception Handling
exceptionHandler = “”,
onInvalidEvent = “”,
customErrorTemplate = “includes/error.cfm”,

//Application Aspects
handlerCaching = false,

interceptors =
{
{
class=“coldbox.system.interceptors.SES”,
properties = {configFile = “myconfig/path/Routes.cfm”}
}
}
};

Did the sample app come with brackets like that? The interceptor setting needs to be an array of structs like so:

//Register interceptors as an array, we need order
interceptors = [
//SES
{ class=“coldbox.system.interceptors.SES” }
];

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Yes, quit trying to put unnamed struct keys inside another struct. That has never been valid CFML.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Agreed, however that is your code, not mine, check your docs :confused:

http://wiki.coldbox.org/wiki/URLMappings.cfm#SES_Interceptor

Ahh, that makes sense. I couldn’t figure out where you were seeing that. The docs have been fixed.

The doc page for the config CFC has/had the correct syntax:
http://wiki.coldbox.org/wiki/ConfigurationCFC.cfm#interceptors

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

And you are missing a semi colon at the end of this as well

interceptors =
{
{
class=“coldbox.system.interceptors.SES”,

properties = {configFile = “myconfig/path/Routes.cfm”}
}
}

Should be

interceptors = [
{
class=“coldbox.system.interceptors.SES”,

properties = {configFile = “myconfig/path/Routes.cfm”}
}
];