----- Original Message -----
Sent: Monday, January 30, 2006 5:24
PM
Subject: Re: EnterpriseObjects in a
regular Java application
That NPE is a result of your Main Bundle being null ... If you're not
running inside of a bundle, it falls back to using JavaFoundation as your
bundle (this officially explains why when things get funky people end up
launching JavaFoundation.woa!). Double check that JavaFoundation is, in
fact, in your classpath.
At the top of your main method, add:
System.out.println("Main.main: main bundle = " +
NSBundle.mainBundle());
System.out.println("Main.main: JavaFoundation bundle = " +
NSBundle.bundleForName("JavaFoundation"));
In my main method, this prints out:
Main.main: main bundle = <com.webobjects.foundation.NSBundle
name:'JavaFoundation'
bundlePath:'/System/Library/Frameworks/JavaFoundation.framework'
packages:'("com.webobjects.foundation", "com.webobjects.foundation.xml")' 212
classes >
Main.main: JavaFoundation bundle = <com.webobjects.foundation.NSBundle
name:'JavaFoundation'
bundlePath:'/System/Library/Frameworks/JavaFoundation.framework'
packages:'("com.webobjects.foundation", "com.webobjects.foundation.xml")' 212
classes >
ms
PS, for eclipse people -- that "Main.main" is a result of a template I
have that's really handy. I call it "sop", and it's defined as
System.out.println("${enclosing_type}.${enclosing_method}:
${cursor}");
So I can type sop<cmd-space> and it will fill in the class and
method name of where the cursor is located. Just spreading the love
:)
<Thread chopped to keep message size
small>