• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EnterpriseObjects in a regular Java application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EnterpriseObjects in a regular Java application


  • Subject: Re: EnterpriseObjects in a regular Java application
  • From: "John Huss" <email@hidden>
  • Date: Tue, 31 Jan 2006 13:04:22 -0600

Ok.  I got it to run from inside Eclipse.  But that's the only place it will work.  Eclipse showed that JavaFoundation was in fact the Main bundle.  When I try to run from outside Eclipse using a jar that I exported or using the Mac App Bundle that Eclipse generates, then it always complains about the Main bundle being null.  How do I make it use JavaFoundation as the main bundle?
 
Thanks,
John
----- Original Message -----
From: Mike Schrag
To: John Huss
Cc: email@hidden
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>
 _______________________________________________
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

References: 
 >RE: EnterpriseObjects in a regular Java application (From: "Ruenagel, Frank" <email@hidden>)
 >Re: EnterpriseObjects in a regular Java application (From: "John Huss" <email@hidden>)
 >Re: EnterpriseObjects in a regular Java application (From: Mike Schrag <email@hidden>)
 >Re: EnterpriseObjects in a regular Java application (From: "John Huss" <email@hidden>)

  • Prev by Date: Re: WOPopupButton element is not accessible from JavaScript for some reason
  • Next by Date: Re: Sessions
  • Previous by thread: Re: EnterpriseObjects in a regular Java application
  • Next by thread: Re: EnterpriseObjects in a regular Java application
  • Index(es):
    • Date
    • Thread