Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » FooPlugin.getDefault() returns null from code running inside the Foo plug-in
FooPlugin.getDefault() returns null from code running inside the Foo plug-in [message #292715] Tue, 11 October 2005 15:22 Go to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
I create in Eclipse 3.1 a plug-in called "Foo", and its AbstractUIPlugin class, called FooPlugin,
contains (as always) a method getDefault() to return the singleton instance of FooPlugin.

Somewhere else in the code of the Foo plug-in I call FooPlugin.getDefault() -- for example, to be
able to write to the log -- but the return value is null. Every time.

In most of my plug-ins this has never happened, not once. Why would it be happening in the Foo
plug-in? I.e., where should I look for the difference that is causing this?

thanks,
Paul
Re: FooPlugin.getDefault() returns null from code running inside the Foo plug-in [message #292716 is a reply to message #292715] Tue, 11 October 2005 15:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

Paul Keyser <rolarenfan@earthlink.net> wrote:
> I create in Eclipse 3.1 a plug-in called "Foo", and its
> AbstractUIPlugin class, called FooPlugin, contains (as always) a
> method getDefault() to return the singleton instance of FooPlugin.
> Somewhere else in the code of the Foo plug-in I call
> FooPlugin.getDefault() -- for example, to be able to write to the log
> -- but the return value is null. Every time.
> In most of my plug-ins this has never happened, not once. Why would
> it be happening in the Foo plug-in? I.e., where should I look for the
> difference that is causing this?
Perhaps FooPlugin has not been started?
Is the code calling FooPlugin.getDefault() within FooPlugin or is it from
some other plugin?

--
Sunil
Re: FooPlugin.getDefault() returns null from code running inside the Foo plug-in [message #292720 is a reply to message #292716] Tue, 11 October 2005 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Check to see that the MANIFEST.MF has the following:

Eclipse-AutoStart: true

Without it, the FooPlugin won't be activated on the first reference to
any class in Foo.


--
Thanks,
Rich Kulp
Re: FooPlugin.getDefault() returns null from code running inside the Foo plug-in [message #292731 is a reply to message #292720] Tue, 11 October 2005 19:13 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
Weird. We do have that line, and always have. As far as I can tell, the problem is some environmenmt
thing -- do fresh Eclipse 3.2M2 install, point at a suitable JRE (some of our code does not like
Java 1.5, alas), fresh checkout of all projects, and no problems.

Paul

Rich Kulp wrote:
> Check to see that the MANIFEST.MF has the following:
>
> Eclipse-AutoStart: true
>
> Without it, the FooPlugin won't be activated on the first reference to
> any class in Foo.
>
>
Previous Topic:Sharing a menu item
Next Topic:3.1.1 update fails on AMD64
Goto Forum:
  


Current Time: Sat Nov 23 08:24:04 GMT 2024

Powered by FUDForum. Page generated in 0.03452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top