[mdr-users] RE : [mdr-users] Using log4j instead of ErrorManager with standalone MDR

"Olivier RICHAUD" <[email protected]> Wed, 3 Aug 2005 18:48:54 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <009c01c5984b$3c459750$6564a8c0@lauris>
OK Thanks I managed to replace the ErrorManager with mine.

Last point : how do I get rid of this:

[STDERR] [org.netbeans.mdr.Logger] Metamodel specific JMI class
stbpm.StbpmPackage not found. Using bytecode generation to create it.

It looks like I need to catch this!

Olivier.

-----Message d'origine-----
De : Martin Matula [mailto:[email protected]] 
Envoyé : mercredi 3 août 2005 17:35
À : [email protected]
Objet : Re: [mdr-users] Using log4j instead of ErrorManager with
standalone MDR


Hi Olivier,

Olivier RICHAUD wrote:

>Hi all,
>
>I'm looking for a way to replace MDR's own logging system by log4j. I'm

>using the standalone version of MDR.
>
>I have gone through various articles, but none of them gave me an 
>answer. As far as I understand, I may need to provide my custom 
>implementation of ErrorManager and replace the default one with mine.
>
Yes, this is the right way to go.

>My
>questions, if this is the way to integrate log4j :
>1. Do I need to implement all ErrorManager's methods? I wonder whether 
>it's worh implementing annotations related methods.
>  
>
Yes. MDR uses annotations - most of the time you will get some runtime 
exception from MDR, which is annotated by the original exceptions that 
caused the runtime exception.

>2. How do I register my customer ErrorManager with the internal lookup?

>Remember I'm using the standalone version of MDR and worse, it is 
>emebedded in a Jboss App Server!
>  
>
You can do it via META-INF/services directory in your jar - that's how 
MDR registers its ErrorManager. You can register your implementation as 
an additional ErrorManager (the logging infrastructure calls all 
registered ErrorMangers). Additionally, you may want to remove the MDR's

default error manager from the lookup in the services folder in a way 
similar to how MDR module removes standalone MDRManager from the lookup 
- see the META-INF/services directory under mdr/module. Regards, Martin