You need to ensure the ERCoreBL framework finishes loading before your model loads. If you have your model in a framework which is the recommended way to do things, the way to do this is add a ERXFrameworkPrincipal subclass to it and add a REQUIRES constant to that subclass. Look at ERCoreBL.java for an example. Don’t forget to set your framework principal class in your build properties.
http://wiki.wocommunity.org/display/documentation/Creating+a+ERXFrameworkPrincipal+subclass?src=search On Nov 17, 2014, at 11:48 AM, Flavio Donadio <[email protected]> wrote: > Ramsey, > > > Got it... Some weeks ago, when I first tried ERAttachment, I created a wrong > relationship, just like you said: a two-way relationship. Don't ask me how, > but the ERAttachment project's EOModel was changed and saved... I think I > need to pay more attention to dialog boxes! > > I just deleted the relationship now and it's going a bit further... Now I get: > >> er.extensions.migration.ERXMigrationFailedException: Migration failed. >> at >> er.extensions.migration.ERXMigrator$ERXMigrationAction.doPerform(ERXMigrator.java:493) >> at >> er.extensions.eof.ERXEOAccessUtilities$ChannelAction.perform(ERXEOAccessUtilities.java:1586) >> at >> er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:201) >> at >> er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1315) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:601) >> at >> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) >> at >> com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) >> at >> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) >> at >> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) >> at com.webobjects.appserver.WOApplication.run(WOApplication.java:1229) >> at er.extensions.appserver.ERXApplication.run(ERXApplication.java:1432) >> at com.webobjects.appserver.WOApplication.main(WOApplication.java:548) >> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:866) >> at br.com.codeprint.Suporte.Application.main(Application.java:24) >> Caused by: java.lang.RuntimeException: Failed to execute 'ALTER TABLE Users >> ADD CONSTRAINT Users_mailAddressID_id_FK FOREIGN KEY (mailAddressID) >> REFERENCES ERCMailAddress (id)'. >> at >> er.extensions.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:670) >> at >> er.extensions.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:624) >> at >> er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1395) >> at >> er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1380) >> at >> er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1357) >> at >> er.extensions.migration.ERXMigrationTable.addForeignKey(ERXMigrationTable.java:1335) >> at >> br.com.codeprint.Suporte.migrations.SuporteModel0.upgrade(SuporteModel0.java:37) >> at >> er.extensions.migration.ERXMigrationDatabase$Migration.upgrade(ERXMigrationDatabase.java:440) >> at >> er.extensions.migration.ERXMigrator$ERXMigrationAction.doPerform(ERXMigrator.java:476) >> ... 16 more >> Caused by: org.h2.jdbc.JdbcSQLException: Table "ERCMAILADDRESS" not found; >> SQL statement: >> ALTER TABLE Users ADD CONSTRAINT Users_mailAddressID_id_FK FOREIGN KEY >> (mailAddressID) REFERENCES ERCMailAddress (id) [42102-168] >> at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) >> at org.h2.message.DbException.get(DbException.java:169) >> at org.h2.message.DbException.get(DbException.java:146) >> at org.h2.schema.Schema.getTableOrView(Schema.java:413) >> at >> org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:175) >> at >> org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:68) >> at org.h2.command.CommandContainer.update(CommandContainer.java:75) >> at org.h2.command.Command.executeUpdate(Command.java:230) >> at >> org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:125) >> at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:110) >> at >> er.extensions.jdbc.ERXJDBCUtilities.executeUpdateScript(ERXJDBCUtilities.java:666) >> ... 24 more > > > Do I need to have er.migration.modelNames in the properties file? > > > Cheers, > Flavio > > On 17/11/2014, at 16:06, Ramsey Gurley <[email protected]> wrote: > >> It sounds like you created an entity named Image in your model, modeled a >> to-one relationship to ERAttachment, but forgot to uncheck the reverse >> relationship from ERAttachment to Image. You should only make that a one way >> relationship >> >> Image -> ERAttachment >> >> not >> >> Image <<-> ERAttachment >> >> ERAttachment can’t find Image because it doesn’t import your framework with >> the Image entity. >> >> >> >> On Nov 17, 2014, at 10:59 AM, Flavio Donadio <[email protected]> wrote: >> >>> Ramsey, >>> >>> >>> I am trying R2D2W... >>> >>> Just followed your instructions (way below) and, then, created an EOModel >>> in the project. When I created the model, though, there were a bunch of >>> messages in a window titled "EOModel Verification Failures", one of them >>> being: >>> >>> ERAttachment: Missing entity named 'Image'. >>> >>> I ignored those and created an entity called User, setting its parent as >>> "ERUser". >>> >>> Then, in the user.d2wmodel, I created a rule like this: >>> >>> 100 : *true* => userEntity = “User" >>> [com.webobjects.directtoweb.EntityAssignment] >>> >>> When I tried to run the app, I got this: >>> >>>> java.lang.IllegalArgumentException: EORelationship(): cannot find entity >>>> named Image for destination of relationship images in entity ERAttachment. >>>> at >>>> com.webobjects.eoaccess.EORelationship.<init>(EORelationship.java:773) >>>> at com.webobjects.eoaccess.EOEntity.relationships(EOEntity.java:1055) >>>> at >>>> er.extensions.eof.ERXEntityClassDescription$Factory.checkForeignKeys(ERXEntityClassDescription.java:491) >>>> at >>>> er.extensions.eof.ERXEntityClassDescription$Factory.processModelGroup(ERXEntityClassDescription.java:318) >>>> at >>>> er.extensions.eof.ERXEntityClassDescription$Factory.modelGroupWasAdded(ERXEntityClassDescription.java:287) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:601) >>>> at >>>> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) >>>> at >>>> er.extensions.eof.ERXModelGroup.loadModelsFromLoadedBundles(ERXModelGroup.java:267) >>>> at er.extensions.ERXExtensions.defaultModelGroup(ERXExtensions.java:148) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:601) >>>> at >>>> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) >>>> at com.webobjects.foundation._NSDelegate._perform(_NSDelegate.java:223) >>>> at com.webobjects.foundation._NSDelegate.perform(_NSDelegate.java:155) >>>> at >>>> com.webobjects.eoaccess.EOModelGroup.defaultGroup(EOModelGroup.java:328) >>>> at >>>> er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:169) >>>> at >>>> er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1315) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) >>>> at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:601) >>>> at >>>> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532) >>>> at >>>> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546) >>>> at com.webobjects.appserver.WOApplication.run(WOApplication.java:1229) >>>> at er.extensions.appserver.ERXApplication.run(ERXApplication.java:1432) >>>> at com.webobjects.appserver.WOApplication.main(WOApplication.java:548) >>>> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:866) >>>> at br.com.codeprint.Suporte.Application.main(Application.java:24) >>> >>> What did I do wrong? >>> >>> >>> Cheers, >>> Flavio >>> >>> On 24/02/2014, at 21:48, Ramsey Gurley <[email protected]> wrote: >>> >>>> A basic getting started would be, >>>> >>>> 1. Clone ponder using eGit >>>> 2. Import ponder frameworks into workspace >>>> 3. Copy '$repo/ponder/* Application Template' directories into >>>> ~/Library/Application Support/WOLips/Project Templates/ >>>> 3. Eclipse->File->New->Other->WOLips->WOProject from Template, click Next> >>>> Select R2D2W Application, etc >>>> 4. Add Login and Logout to your Navigation.plist root children. >>>> 5. Set up your javamail properly in the Properties file >>>> >>>> That would give you a basic D2W app with user management. >>> >> > _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
