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

Martin Matula <[email protected]> Fri, 05 Aug 2005 13:12:36 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Just remove the logger from the lookup - using META-INF/services and use 
your own ErrorManager exclusively.
Martin

Olivier RICHAUD wrote:

>Yes of course it doesn't find it : I never generate interfaces. 
>But I want to do is redirect org.netbeans.mdr.Logger from STDERR to my
>log file. How can do this?
>
>Regards.
>
>Olivier.
>
>-----Message d'origine-----
>De : Martin Matula [mailto:[email protected]] 
>Envoyé : jeudi 4 août 2005 11:36
>À : [email protected]
>Objet : Re: [mdr-users] RE : [mdr-users] Using log4j instead of
>ErrorManager with standalone MDR
>
>
>Seems that the JMI interfaces for your metamodel (particularly 
>stbpm.StbpmPackage interface) cannot be found on the classpath of your 
>application.
>Martin
>
>Olivier RICHAUD wrote:
>
>  
>
>>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
>>
>>
>> 
>>
>>    
>>
>
>
>  
>