Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to get it work? Buddy Loading and start(BundleContext text)
How to get it work? Buddy Loading and start(BundleContext text) [message #452665] Wed, 12 July 2006 03:21 Go to next message
Jason is currently offline JasonFriend
Messages: 45
Registered: July 2009
Member
Hi there,

I'm developing a plugin under Eclipse3.2 and running into some trouble...
I have one class created by PDE and want to do some initialization work in
the start() method:

private static final Log log = LogFactory.getLog(Activator.class);

public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
log.debug(">>>Entering start()");
super.start(context);
do some initializtion work here...
log.debug("Leaving start()");
}
}

Runing it, I'm warned with the following message:
log4j:WARN No appenders could be found for logger.
log4j:WARN Please initialize the log4j system properly.

I wrapped log4j.jar as a plugin, and use Buddy Loading.
I'm sure the configuration of Buddy Loading is correct because the plugin
print debug information using log.debug somewhere else in this plugin.

I think probably the problem is the sequence of plugin loading. By the
time Activator.start() is invoked, the plug in log4j is not registered yet.

Also I do not want to include a log4j.jar in my plugin. How could I make
it?
Could someone shed light on this problem and point me to right direction?

Thanks in advance,
Jason
Re: How to get it work? Buddy Loading and start(BundleContext text) [message #452666 is a reply to message #452665] Wed, 12 July 2006 03:43 Go to previous messageGo to next message
Jason is currently offline JasonFriend
Messages: 45
Registered: July 2009
Member
Jason wrote:

> Hi there,

> I'm developing a plugin under Eclipse3.2 and running into some trouble...
> I have one class created by PDE and want to do some initialization work in
> the start() method:

> private static final Log log = LogFactory.getLog(Activator.class);

> public class Activator extends AbstractUIPlugin {
> public void start(BundleContext context) throws Exception {
> log.debug(">>>Entering start()");
> super.start(context);
> do some initializtion work here...
> log.debug("Leaving start()");
> }
> }

> Runing it, I'm warned with the following message:
> log4j:WARN No appenders could be found for logger.
> log4j:WARN Please initialize the log4j system properly.
Sorry, it does not print anything.

> I wrapped log4j.jar as a plugin, and use Buddy Loading.
> I'm sure the configuration of Buddy Loading is correct because the plugin
> print debug information using log.debug somewhere else in this plugin.

> I think probably the problem is the sequence of plugin loading. By the
> time Activator.start() is invoked, the plug in log4j is not registered yet.

> Also I do not want to include a log4j.jar in my plugin. How could I make
> it?
> Could someone shed light on this problem and point me to right direction?

> Thanks in advance,
> Jason
Re: How to get it work? Buddy Loading and start(BundleContext text) [message #452757 is a reply to message #452665] Thu, 13 July 2006 22:15 Go to previous message
Neil Bartlett is currently offline Neil BartlettFriend
Messages: 93
Registered: July 2009
Member
Jason,

Log4j is starting fine - tt just can't find its initialization file,
which by default is called log4j.properties.

Take a look at the Log4j documentation
(http://logging.apache.org/log4j/docs/manual.html) especially the
section on "Default Initialization Procedure"

Regards
Neil

Jason wrote:
> Hi there,
>
> I'm developing a plugin under Eclipse3.2 and running into some trouble...
> I have one class created by PDE and want to do some initialization work
> in the start() method:
>
> private static final Log log = LogFactory.getLog(Activator.class);
>
> public class Activator extends AbstractUIPlugin {
> public void start(BundleContext context) throws Exception {
> log.debug(">>>Entering start()");
> super.start(context);
> do some initializtion work here...
> log.debug("Leaving start()");
> }
> }
>
> Runing it, I'm warned with the following message:
> log4j:WARN No appenders could be found for logger.
> log4j:WARN Please initialize the log4j system properly.
>
> I wrapped log4j.jar as a plugin, and use Buddy Loading.
> I'm sure the configuration of Buddy Loading is correct because the
> plugin print debug information using log.debug somewhere else in this
> plugin.
>
> I think probably the problem is the sequence of plugin loading. By the
> time Activator.start() is invoked, the plug in log4j is not registered yet.
>
> Also I do not want to include a log4j.jar in my plugin. How could I make
> it? Could someone shed light on this problem and point me to right
> direction?
>
> Thanks in advance,
> Jason
>
>
>
Previous Topic:Testing SWT classes with JUnit plugin
Next Topic:Properties View not showing my IPropertySource
Goto Forum:
  


Current Time: Sun Dec 22 05:39:53 GMT 2024

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

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

Back to the top