Problem when restarting server running ContentBox

Luis, when a server running ContentBox is restarted, somehow it thinks it is a new install and runs the installation part of it.

hmm, I have not seen this as it should detect the database if populated already. do you have drop create on the Application.cfc

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Luis,

I have whatever you had it set too, it was a complete fresh install. Ran it once, needed to restart the server (ColdFusion for something else) and ran the application, and sure enough it was asking for a reinstall again.

So as a test here is what I did.

  1. Delete the database, and remove the framework and ContentBox.
  2. restart ColdFusion
  3. Run ContentBox
  4. run the install option, setup ContentBox
  5. restart ColdFusion

First problem is what I have been trying to explain, in another thread. ORM Error is thrown, see below for the error.

  1. Hit refresh button
  2. Wait for ContentBox to come back and try to re-install itself again.

The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values.

Wow ok will do some tests

Damn,

I had changed the original copy from update to dropcreate, which meant the install was not changing this to none.

However the ORM error still happens.

AHH OK, that makes more sense. Ok, now the error I will investigate. Just on first request right? When installed or non installed?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yes on first request, just restart ColdFusion and run ContentBox.

If it helps, I know what causes the error. This is ColdFusion timing out when scanning ORM entities, the more files it has to search causes this. Which is one reason why I had asked for the ORM entities and services to be segregated in ColdBox by Convention.

The idea was that with the help of another component, I have been able to modify the Application.cfc for CFCLocation, but due to a bug and import and mappings in the pseudo constructor it will only work if there is no mapping to ColdBox and ColdBox is in the web root.

But basically this is what I am doing.

this.ormsettings = {
datasource=this.datasource, dbcreate=‘none’,
cfclocation= system.interceptors.applicationInterceptor.getDomains(), savemapping=‘false’
,eventhandling = false
,flushatrequestend = false
,logSQL=false
};

What this does is gets the convention settings, and gets a list of all the modules and the directory domains. It then returns this as the required information, to setup the cfclocation so that it scans less folders than it needs too.

Now as I stated the downside is that there is a bug in ColdFusion, in which I have logged a bug with Adobe, and also blogged about it. That stops this from working if ColdBox is used via a mapping.

But as you can see what I was trying to achieve here, is to allow for developers to not worry about making modifications to this setting in Application.cfc and to automate the process to help speed up the search for ORM entities. Which works well, but not if CB is used with mappings.

I did also get it working by using an interceptor that used the onModuleLoad and Unload, to create an array of paths that was stored in a file, and then load that into the setting in Application.cfc but I found this method buggy for some reason.

Anyway now you can see why I had asked for both Entities and Services to be by Convention, Services because they should be separated anyway by design, and Entities to help with this process even further. Without ORM Entities by Convention, it means there is still one manual process that has to be done. But if it was by convention, then I could easily pull the convention out of the settings and add that to the Application.cfc for both the core and modules of the Application.

Now I made some noise about this, and I did so with very good reason. As you can see I have been trying to make adding modules, with Entities as painless for the developer as I possibly could.

Hopefully you can now see why I asked for these 2 new conventions, even if others could not.