On Nov 28, 2007, at 8:50 PM, Paul Hoadley wrote:

On 29/11/2007, at 5:18 AM, Chuck Hill wrote:

If you are up to it, can you try this and post the output?

Comment out the add model code above and add these logs in the @Before method:

NSLog.out.appendln("Main bundle " + NSBundle.mainBundle());
NSLog.out.appendln("frameworkBundles " + NSBundle.frameworkBundles ().valueForKey("name")); NSLog.out.appendln("frameworkBundle paths " + NSBundle.frameworkBundles()); NSLog.out.appendln("Loaded models " +EOModelGroup.defaultGroup ().modelNames());

I see a conspicuous empty list after "Loaded models"...


Main bundle <com.webobjects.foundation.NSBundle name:'JavaFoundation' bundlePath:'/System/Library/Frameworks/ JavaFoundation.framework' packages:'( com.webobjects.foundation,
com.webobjects.foundation.xml )' 214 classes >


Right there is the problem. The main bundle _should_ be the framework you are testing. JavaFoundation is one of the things it falls back to when all else fails.

The Project/dist/Project.framework/Resources/Java directory should be the working directory. The only thing it might be is that I always do an Ant build so I have a jar in that directory and you might only have .class files. It might that that NSBundle can't find the bundle if there is no jar, I don't recall.

You could try getting the current directory, creating a bundle with that path and using NSBundle._setMainBundle() to set it. Or just give up and create the model group manually. I suspect that without a correct bundle that other things might break. Something to keep in mind.

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to