New Screencast

WO/ProjectWonder/WOLips – Part 2

I just completed part 2 of the WO/Wonder/WOLips series. This episode introduces:

  • Reusable components
  • Importing files into your project
  • DirectActions
  • Modeling relationships
  • Updating a db schema with Migrations

It should be in available in WebObjects Podcasts on iTunes, from the WOCommunity site, or direct from my .mac account here.


Source of the completed project.

As always, comments and suggestions welcome.

23 thoughts on “New Screencast

  1. Awesome screencasts! I think you’ve single-handedly sucked me into WOLips with these (I used to make due with WOProject+EOModeler+WOBuilder).

  2. Thank you Wolf, that’s very high praise indeed… My nefarious secret plan has been exposed!

  3. I agree, David. These screencasts are really great. You make things obvious and clear and watching live refactoring of code as you move it from component to component or to session/direct action is increasing my understanding by leaps and bounds. Thanks again.

  4. Just wanted to say THANKS! I found this very useful even though I consider my self quite experienced in WebObjects. πŸ™‚

  5. David, this is great stuff for helping the newcomers to WO. Keep up the good work. Hopefully, someday, my mountainous workload will ease off so that I can get back blogging about WO again!


  6. Thanks Kieran!

    I’ve found your blog posts very helpful, and with the rapid progress in the WO tools, it certainly would be nice to have you voice returned to the mix πŸ™‚

  7. First, great screencasts Dave! Simply an invaluable resource for learning WO. And now to the questions. I’m following along with my own app, but in mine I’m creating my EO Model in a Wonder Framework. First, is there anything wrong with doing that? Next, my Properties file (which seems to be quite full in your demo project) is empty in my project. Should this be the case? Perhaps because I’m developing a Framework? Will I be able to use the migrations stuff (which I’ll admit I don’t fully understand yet) to create my database schema with an empty properties file?


  8. Jeff,

    There is absolutely nothing wrong with creating your EOModel in a framework. In fact for anything beyond a trivial app, it is recommended. We have several project on the go right now that use ERMigrations and have the their models in a separate framework.

    If you add the ERMigration specific entries to your Framework’s Properties file it should all just work.


  9. Me again Dave,
    I tried adding the entries to the Framework Properties file, and then referenced the framework from a Hello world WonderApp. This didn’t cause the migration class to run. However, when I added the ERMigration entries to my application’s Properties file, it did run, but with the below error. It actually created my table in the database, but then the app crashed on the error. I’m using Frontbase btw. Any ideas why I might be getting the error?

    CREATE TABLE _dbupdater(“lockowner” VARCHAR(100), “modelname” VARCHAR(100)NOT NULL, “updatelock” INTEGERNOT NULL, “version” INTEGERNOT NULL);

    at er.extensions.migration.ERXJDBCMigrationLock._tryLock(
    at er.extensions.migration.ERXJDBCMigrationLock.tryLock(
    at er.extensions.migration.ERXMigrator$ERXMigrationAction.doPerform(
    at er.extensions.ERXEOAccessUtilities$ChannelAction.perform(
    at er.extensions.migration.ERXMigrator.migrateToLatest(
    at er.extensions.ERXApplication.finishInitialization(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.webobjects.appserver.WOApplication.main(
    at er.extensions.ERXApplication.main(
    Caused by: java.sql.SQLException: Syntax error 61. Expected Identifier not found.
    at com.frontbase.jdbc.FBJErrorMetaData.errorMessageAtIndex(
    at com.frontbase.jdbc.FBJErrorMetaData.getExceptionChain(
    at com.frontbase.jdbc.FBJStatement.checkMetaData(
    at com.frontbase.jdbc.FBJStatement.executeUpdate(
    at er.extensions.ERXJDBCUtilities.executeUpdateScript(
    at er.extensions.ERXJDBCUtilities.executeUpdateScript(
    at er.extensions.migration.ERXJDBCMigrationLock._tryLock(
    … 18 more

  10. The first line (and probably most important) of the exception is:

    [2008-4-1 4:11:9 CDT] er.extensions.migration.ERXMigrationFailedException: Failed to create lock table. Try executing:

  11. Thank you for taking the time to produce your screencasts. As a WO beginner I am struggling to get started. The information contained in the available beginner books is quite different to the development approaches that are currently being used. It is wonderful that you and others are willing to help others get started. I particularly like the interactive nature of learning by following a screencast.

    I am having problems getting the WO/ProjectWonder/WOLips – Part 1 working. Before I start to ask the community for help, would it be possible to obtain a copy of a ‘working’ version of the project to test and compare with my project to help with debugging. I have tried for days and still cannot find the error in my code.


  12. The Screencast is wonderful! I was able to replicate everything except because I use WO5.4 I had to switch to Frontbase instead of MySQL. Following everything you did I struggled with the SQL Statements – in your screencast they where not completly visible and this step did not work – Error in SQL -Statement.
    …sword,c_username,c_group_id,id) VALUES (‘Ádmin’,’User’,’jj’,’profjens’,’1′,’1′)” ); – After “user” I guessed but got errors.
    I did put in everything manually and managed to get that working but I also tried to “downgrade” with migration and could not find a clue how to do that. Where is the magic switch?
    Another thing is the properties file. All the options are to defined where?

  13. In case you’re following along, my problem was I hadn’t added the Frontbase plugin as a referenced framework. Still can’t get migrations to work though, no I’m getting an SQL syntax error Length > max message.

  14. Thanks for all of the comments guys! A couple of things:

    There are known issues with WO 5.4 and ERMigrations. The API’s ERMigrations uses generates incorrect SQL. This is slated for a fix in the next release of WO.

    I use MySQL, so if you have FrontBase specific questions, a better place would be the WebObjects or Wonder mailing lists.

    I’ll try and post snapshots of the projects later today.

    If you can make it, I highly recommend attending WOWODC this year. From the horses mouth and all that πŸ™‚


  15. Thanks Dave,
    Just one more easy question. Since I’m using Frontbase I think I want to just turn off migrations, but I can figure out how. I re-commented out all the migrations stuff in my properties files, and even deleted my migrations class, but when I run it still tries to “migrate” and I get a migration error and project won’t start.


  16. Weird Jeff,

    Did you comment out the entries in your framework, and have you tried cleaning the project?

  17. Yes to all of that, and yet it still wants to migrate. Here’s a little bit of what my logger spits out. My migration class is completely gone, and yet it still looks like it’s trying to run it. It eventually gets a Migration Failed error and dies…

    Apr 01 21:33:39 netBrackets[54250] ( DEBUG NSLog – evaluateExpression:
    Apr 01 21:33:39 netBrackets[54250] ( DEBUG NSLog – fetch canceled
    Apr 01 21:33:39 netBrackets[54250] ( DEBUG NSLog – 1 row(s) processed
    Apr 01 21:33:39 netBrackets[54250] ( INFO er.extensions.migration.ERXMigrator – Upgrading netbracketsFW to version 0 with migration ‘com.netbracketsfw.migration.netBracketsFW0@d5fcfe’
    Apr 01 21:33:39 netBrackets[54250] ( INFO er.extensions.ERXJDBCUtilities – Executing CREATE TABLE “t_pool” (
    “c_admin_msg” VARCHAR(255),

  18. Ahh, I figured it out. I guess I had installed the framework somewhere along the line in Library/Frameworks, probably using the handy WOLips Ant Tools->Install. After deleting my installed Framework it no longer tries to migrate.

  19. Just for posterity, since this is one of the only hits on Google, I thought that I’d mention that I came across this with both openbase and mysql using WebObjects 5.4.1. I updated to 5.4.3 and the problem has gone away, so anyone with a similar problem should upgrade (which is a somewhat tortuous process all by itself, but that’s another story…)

  20. The reason migrations fail using Frontbase is that _dbupdater is not a legal table name. I’m off now to figure out if there’s a way to tell migrations to use a different value.

  21. Correction – table names may have underscores in the leading position but they must be quoted. This works:

    CREATE TABLE “_dbupdater”(lockowner VARCHAR(100), modelname VARCHAR(100) NOT NULL, updatelock INTEGER NOT NULL, version INTEGER NOT NULL);

    … but this does not:

    CREATE TABLE _dbupdater(lockowner VARCHAR(100), modelname VARCHAR(100) NOT NULL, updatelock INTEGER NOT NULL, version INTEGER NOT NULL);

  22. Great tutorial, though I block when writing migration code for version 0 to 1.

    It seems that the “alter table t_user add c_group_id” statement is failing, as the application is submiting “alter table t_user null c_goup_id …” instead.
    Does any one have an idea ? I am using the latest version (21-12-2008) of Wonder. I have the latest MySQL Connector/J.

    I am pretty new to the thing, I would like to have a pilot to show some alternative to my company.

    Any help greatly appreciated !

Comments are closed.