How to get it work? Buddy Loading and start(BundleContext text) [message #452665] |
Tue, 11 July 2006 23:21  |
Eclipse User |
|
|
|
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 #452757 is a reply to message #452665] |
Thu, 13 July 2006 18:15  |
Eclipse User |
|
|
|
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
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03326 seconds