Re: Properties, Frameworks and App
Re: Properties, Frameworks and App
- Subject: Re: Properties, Frameworks and App
- From: Tim Worman <email@hidden>
- Date: Wed, 11 Jan 2012 12:48:51 -0800
James:
I don't know if this will be of any use to you but this is how we do it. The following absolutely works if you don't have conflicting connection properties.
1. Put the basics of the connection dictionary in the model framework's resources folder. It might look sth like below. I do not put username/password info in them. I do not want that information in a code repository, etc.
ModelName.URL = jdbc:openbase://host/DatabaseName
ModelName.DBDriver = com.openbase.jdbc.ObDriver
ModelName.DBPlugin = OpenBasePlugIn
2. For dev purposes, put any overrides of those in Properties.username in the app resources so that you can point your dev instance at a different database sth like:
GSEISDB.URL= jdbc:openbase://127.0.0.1/LocalDatabaseName
The others properties stay the same if you're using the same database, driver, plugin.
3. handling username/password
in dev:
Keep dev username/pass values out of your project by putting those in this properties file:
~/WebObjects.properties
in deployment:
Put the username/pass connection properties in /etc/WebObjects/AppName/Properties on the server that the app is running on.
Tim Worman
UCLA GSE&IS
On Jan 10, 2012, at 5:58 PM, James Cicenia wrote:
> If I have a model in a Framework, what controls it's connection configuration?
>
> I thought the properties file in the App would, but it looks like it doesn't. It barks
> about ERAttachment's configuration vs. the apps. If I put the connection info
> in the Model Frameworks's properties file, it runs... sort of. But now I get this
> kind of exception on startup:
>
> setting traceOpenLocks to false
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC$DefaultFactory - Setting default delegate on editing context: er.extensions.eof.ERXEC@4a4854f6 allows validation: true
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC - setting delegate to er.extensions.eof.ERXDefaultEditingContextDelegate@d054f93
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC -
> at er.extensions.eof.ERXEC.setDelegate(ERXEC.java:1469)
> at er.extensions.eof.ERXEC$DefaultFactory.setDefaultDelegateOnEditingContext(ERXEC.java:1563)
> at er.extensions.eof.ERXEC$DefaultFactory._newEditingContext(ERXEC.java:1618)
> at er.extensions.eof.ERXEC$DefaultFactory._newEditingContext(ERXEC.java:1589)
> at er.extensions.eof.ERXEC.newEditingContext(ERXEC.java:1681)
> at er.extensions.jdbc.ERXJDBCUtilities.databaseProductName(ERXJDBCUtilities.java:826)
> at er.extensions.migration.ERXMigrator._buildDependenciesForModel(ERXMigrator.java:352)
> at er.extensions.migration.ERXMigrator._buildDependenciesForModelsNamed(ERXMigrator.java:275)
> at er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:184)
> at er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1128)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> 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:1241)
> at com.webobjects.appserver.WOApplication.main(WOApplication.java:548)
> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:726)
> at com.jimijon.blessings.app.Application.main(Application.java:16)
>
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC$DefaultFactory - setting useSharedEditingContext to false
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC - setting useUnlocker to true
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.eof.ERXEC - After pushing: [er.extensions.eof.ERXEC@4a4854f6]
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.ERXEC.LockLogger - locked er.extensions.eof.ERXEC@4a4854f6
> Jan 10 19:53:00 BlessingsApp[6789] DEBUG er.extensions.localization.ERXLocalizer - FrameworkSearchPath: ("app", "ERJars", "ERPrototypes", "ERModernLook", "ERModernDefaultSkin", "ERModernDirectToWeb", "JavaWOExtensions", "Ajax", "ModelBlessings", "ERAttachment", "MySQLPlugIn", "ERDirectToRest", "ExcelGenerator", "ERExcelLook", "ERRest", "WOLips", "JavaDTWGeneration", "JavaDirectToWeb", "JavaFoundation", "JavaXML", "JavaJDBCAdaptor", "JavaWebObjects", "JavaEOAccess", "JavaEOControl", "JavaEOProject", "ERDirectToWeb", "ERExtensions")
> Exception
> at er.extensions.eof.ERXEC.lock(ERXEC.java:513)
> at er.extensions.eof.ERXEC$DefaultFactory._newEditingContext(ERXEC.java:1620)
> at er.extensions.eof.ERXEC$DefaultFactory._newEditingContext(ERXEC.java:1589)
> at er.extensions.eof.ERXEC.newEditingContext(ERXEC.java:1681)
> at er.extensions.jdbc.ERXJDBCUtilities.databaseProductName(ERXJDBCUtilities.java:826)
> at er.extensions.migration.ERXMigrator._buildDependenciesForModel(ERXMigrator.java:352)
> at er.extensions.migration.ERXMigrator._buildDependenciesForModelsNamed(ERXMigrator.java:275)
> at er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:184)
> at er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1128)
>
>
> James Cicenia
> cell: 773.398.4649
>
>
>
> _______________________________________________
> 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