simpleblog

when trying to turn on the debugpanel and (fwreinit the framework) for simple blog 5 i get

that’s an ORM issue. Activate logging and see the console output for hibernate in coldfusion.

Luis F. Majano
President
Ortus Solutions, Corp

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

it only happens when i turn on debugmode=true in config.cfc

could not initialize a collection: [User.entries#123]

ColdFusion cannot determine the line of the template that caused this error. This is often caused by an error in the exception handling subsystem.

Ok, I know what it is.

The MSSQL script is not updated so it does not match the domain
model. I only tested with the MysQL script. So if you want this to
run on MSSQL, you will have to update it yourself for now.

I am going on vacation today :slight_smile:

you are saying i should just compare the mysql script and make the appropriate changes to update it?
or what do you mean it does not match the domain model?

I just looked at the two sql scripts for simpleblog and it looks like
the MSSQL one is missing an FK_UserId field on the Entries table. I
added it to the script, changed the id in the User table from a
numeric string (was 123 in the mssql script) to the uuid that is used
in the mysql script (though they are both stored in a varchar 50).
That should work and I attached the sql file. It is untested though.
I'll try and test it later and then add in the foreign keys and such
that are in the mysql script but not in the mssql script.

Hope that helps,
Judah

MSSQL.sql (5.98 KB)

thanks for doing this…
i spent yesterday installing mysql, setting up a new dsn. running the mysql script etc in hopes i would have better luck with the mysql version. i am not familiar with mysql so it could be something i have done.

but this did not help getting a new set of errors.

when i click on the blog avatar i get

An Unhandled Exception Occurred

An unhandled exception has occurred. Please look at the diagnostic information below:

Type

org.hibernate.exception.SQLGrammarException

Message

could not initialize a collection: [Entry.comments#ff8080812ad4674a012ad975ed93001e]

Detail

Extended Info

Tag Context

C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\model\entries\Entry.cfc (27)
C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\views\blog\entries.cfm (29)
C:\inetpub\tools\coldbox\coldbox-core\system\plugins\Renderer.cfc (139)
C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\layouts\Layout.Main.cfm (20)
C:\inetpub\tools\coldbox\coldbox-core\system\plugins\Renderer.cfc (258)
C:\inetpub\tools\coldbox\coldbox-core\system\Coldbox.cfc (244)
C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\Application.cfc (71)

and when i click on the admin avatar:

An Unhandled Exception Occurred

An unhandled exception has occurred. Please look at the diagnostic information below:

Type

Application

Message

Error while loading the entity.

Detail

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘this_.author’ in ‘field list’

Extended Info

Tag Context

C:\inetpub\tools\coldbox\coldbox-core\system\orm\hibernate\BaseORMService.cfc (127)
C:\inetpub\tools\coldbox\coldbox-core\system\orm\hibernate\VirtualEntityService.cfc (76)
C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\handlers\admin\blog.cfc (23)
C:\inetpub\tools\coldbox\coldbox-core\system\web\Controller.cfc (651)
C:\inetpub\tools\coldbox\coldbox-core\system\web\Controller.cfc (542)
C:\inetpub\tools\coldbox\coldbox-core\system\Coldbox.cfc (226)
C:\inetpub\wwwroot\coldbox-samples\applications\SimpleBlog\simple_blog_5\Application.cfc (71)

i guess following up on what Luis said about the “domain model” not being in sync with the scripts is the real issue here (for both dbs).
i just noted that the comment entity is completely inconsistent with the script.

there are author columns of any type in the db table… has this simpleblog step 5 been tested/run by anyone? i can’t imagine it has ever worked. (disappointing if you are trying to use this to learn from. )

// PROPERTIES

property name=“commentID” column=“comment_id” fieldtype=“id” generator=“uuid” setter=“false”;

property name=“comment”;

property name=“time” insert=“false” update=“false”;

property name=“author”;

property name=“authorEmail”;

property name=“authorURL”;

Scott,

Sorry for the confusion. All of the sample apps are in the processes of being looked at for errors and updated to version 3.0 standards. With the coming release of a full 3.0, we will verify each of the sample apps is working correctly. There are a lot of them, so they can be difficult to maintain for each minor release. We don’t want to make ease of entry into the ColdBox framework as smooth as possible, so we will look into the bugs in the simpleblog sample app.

Thanks,

Curt Gratz

Computer Know How

just confirmed that running the new script produces the exact same errors as before

I just pushed the new script from my running DB which works great. So please use the new script on git and also make sure you do an ORM Reload and FW REinit.

If somebody can translate the script to MSSQL that would be great.

Luis F. Majano
President
Ortus Solutions, Corp

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

Thought you were on vacation! Now quit checking email and go
vacate! :slight_smile:

I forked the Samples project on github, updated the MSSQL script and
pushed it back to my forked version. You can grab it from there. I'll
also attach the script to this email so other folks have it.

Judah

MSSQL.sql (15.1 KB)

i can confirm that this solved all the issues and both scripts seem to work nicely.
sampleblog working now… thanks so much for the quick attention to this…