Re: framework load order????
Re: framework load order????
- Subject: Re: framework load order????
- From: Theodore Petrosky <email@hidden>
- Date: Tue, 24 Feb 2015 13:46:44 -0500
ok I got it. I was just slow!!!
I needed to create a class in my Framework that extends ERXFrameworkPrincipal:
--------------
package com.eltek.frameworkprincipal;
import org.apache.log4j.Logger;
import er.corebusinesslogic.ERCoreBusinessLogic;
import er.extensions.ERXFrameworkPrincipal;
public class BookingFramework extends ERXFrameworkPrincipal {
public static final Logger log = Logger.getLogger(BookingFramework.class);
/** holds the shared instance reference */
protected static BookingFramework sharedInstance;
public final static Class<?> REQUIRES[] = new Class[] {ERCoreBusinessLogic.class};
// Registers the class as the framework principal
static {
setUpFrameworkPrincipalClass(BookingFramework.class);
}
public static BookingFramework sharedInstance() {
if (sharedInstance == null) {
synchronized (BookingFramework.class) {
if(sharedInstance == null) {
sharedInstance = sharedInstance(BookingFramework.class);
}
}
}
return sharedInstance;
}
public void initialize() {
// code during startup
}
public void finishInitialization() {
}
}
———————————————
then I added the class to the build.properties file:
#Tue Feb 24 08:41:20 EST 2015
cfBundleID=com.eltek
cfBundleShortVersion=
cfBundleVersion=
classes.dir=bin
component.inlineBindingPrefix=$
component.inlineBindingSuffix=
component.wellFormedTemplateRequired=false
customInfoPListContent=
embed.Local=true
embed.System=true
eoAdaptorClassName=
javaVersion=1.5+
principalClass=com.eltek.frameworkprincipal.BookingFramework
project.name=BookingFramework
project.name.lowercase=bookingframework
project.type=framework
and lastly to my primary migration of MY framework:
@Override
public NSArray<ERXModelVersion> modelDependencies() {
return new NSArray<ERXModelVersion>(new ERXModelVersion("ERCoreBusinessLogic", 0));
}
I am always amazed at how complete WebObjects/Wonder really is!
On Feb 23, 2015, at 6:19 PM, Ramsey Gurley <email@hidden> wrote:
> In your framework principal class you reference ERCoreBL.class in your REQUIRES constant. That will ensure it is loaded before your framework can finish loading. See er.r2d2w.ERR2D2W for an example.
>
> You need to set up your framework principal correctly
> https://wiki.wocommunity.org/display/documentation/Creating+a+ERXFrameworkPrincipal+subclass?src=search
>
> And you need to define which migrations you want to run before yours in your Migration's modelDependencies() method. See ERCoreBL0 for an example.
>
>
> On Feb 23, 2015, at 4:09 PM, Theodore Petrosky <email@hidden> wrote:
>
>> How can I ensure that ERCoreBusinessLogic is loaded BEFORE my framework. I ordered the frameworks and put the ERCBL on top, ahead of my framework, but still no joy. I need to run some SQL against the ERCBL:
>>
>> ERXJDBCUtilities.executeUpdate(database.adaptorChannel(), "ALTER TABLE ERCAuditTrail DROP COLUMN is_deleted");
>> ERXJDBCUtilities.executeUpdate(database.adaptorChannel(), "ALTER TABLE ERCAuditTrail ADD COLUMN is_deleted boolean not null");
>>
>> I want to put this in a migration and run it AFTER ERCBL’s migrations are run.
>>
>> Or is there someplace else I can put this?
>>
>> Actually, is this something I should put into a pull request. if I don’t make this change, I will get:
>>
>> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: <com.webobjects.jdbcadaptor.PostgresqlExpression: "INSERT INTO ERCAuditTrail(GID, id, IS_DELETED) VALUES (?::varchar(255), ?::int4, ?::bool)" withBindings: 1:_EOIntegralKeyGlobalID[EventBook (java.lang.Integer)19](gid), 2:1(id), 3:false(isDeleted)>: Next exception:SQL State:42804 -- error code: 0 -- msg: ERROR: column "is_deleted" is of type integer but expression is of type boolean Hint: You will need to rewrite or cast the expression. Position: 84 Next exception:SQL Warning:00000 -- error code: 0 -- msg: parse <unnamed>: SHOW TRANSACTION ISOLATION LEVEL Next exception:SQL Warning:00000 -- error code: 0 -- msg: bind <unnamed> to <unnamed> Next exception:SQL Warning:00000 -- error code: 0 -- msg: execute <unnamed>:
>>
>> anyone else have this problem?
>>
>> Ted
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden