Hi Kinichiro,

I found the problem : the source of the logging handler was actually different !

Mine was from a nightly build of some 3 weeks ago. The crucial difference seems to be that in my version, the getName() method from AbstractHandler was overridden in the log handler, but without providing compensating functionality : that's why I got the "Handler null added to Phase loggingPhase" message. If you don't have this problem, the message contains the name of the handler instead of null.

I don't know where you got your version of the logging handler : do you have the 1.0 release or do you have a more recent nightly build than I used?


For exactness here are the differences in the handlers :
=========================================================
your correct logging handler :

public class LoggingHandler extends AbstractHandler {

    public LoggingHandler() {
        log = LogFactory.getLog (getClass());
    }

    public void invoke(MessageContext msgContext) throws AxisFault {
        log.info(msgContext.getEnvelope().toString());
    }

    static final long serialVersionUID = 0L;
    private Log log;
}
========================================================
my non-functioning logging handler :

public class LogHandler extends AbstractHandler implements Handler {

    private static final Log log = LogFactory.getLog(LogHandler.class);
    private QName name;

    public QName getName() {
        return name;
    }

    public void invoke(MessageContext msgContext) throws AxisFault {
        log.info (msgContext.getEnvelope().toString());
    }

    public void revoke(MessageContext msgContext) {
        log.info(msgContext.getEnvelope().toString());
    }

    public void setName(QName name) {
        this.name = name;
    }




On 7/11/06, Kinichiro Inoguchi <[EMAIL PROTECTED] > wrote:
Hi heikki,

It's nice !
Check extra white space in your module.xml .
I guess maybe that's your problem.

--- heikki <[EMAIL PROTECTED]> wrote:

> Hi Kinichiro ,
>
> thank you so much for your assistence .. your configuration works for
> me too
> ! Although it's not yet obvious to me what the difference is, other
> than
> that you have <phase name="loggingPhase"/> in a different place in
> the
> sequence in the phaseOrders elements in axis2.xml.
>
> I'll find out what mistake I was making and keep you informed.
>
> thanks !
> Heikki
>
>
>
> On 7/11/06, Kinichiro Inoguchi < [EMAIL PROTECTED]> wrote:
> >
> > Hi, heikki,
> >
> > I can't tell what is your problem though,
> > I sent my configuration to you by another mail.
> >
> > 1. logging.mar
> > 2. axis2.xml
> > 3. MyService2.aar - you can call this by
> > http://localhost:8080/axis2/rest/MyService2/echo?echostring=aaabbb
> >
> > In log4j.properties file, I modified 2 lines like this,
> > log4j.rootCategory=INFO, CONSOLE, LOGFILE
> > log4j.appender.LOGFILE.File=/Tomcat50/webapps/axis2/axis2.log
> >
> > I could see log messages in axis2.log.
> >
> > Regards,
> > kinichiro
> >
> > --- heikki <[EMAIL PROTECTED]> wrote:
> >
> > > Hello,
> > >
> > > I'm still trying to deploy the sample logging module,
> server-side.
> > > Unfortunately no-one has answered my previous post.. I'll try to
> > > state my
> > > questions very briefly and clear, hopefully someone has some
> answers
> > > :
> > >
> > > - where can I find a description of exactly what is the meaning
> of,
> > > and
> > > relation between, each module-, phase- and handler-related
> element in
> > > axis2.xml, modules.xml and services.xml ? What does it mean, for
> > > example, if
> > > the class attribute in the module or in the phase elements is
> absent
> > > /
> > > present ?
> > >
> > > - if you get an error message such as
> > > "[11 Jul 2006 13:36:43] ERROR
> > > org.apache.axis2.deployment.DeploymentEngine.doDeploy():636 -
> Invalid
> > > service  MyService.aar due to Invalid phases please recheck
> > > axis2.xmlloggingPhase for the handler InFlowLogHandler", how can
> you
> > > best go about
> > > analyzing what's causing it ?
> > >
> > > - when I just (1) add the logging.mar from the distribution to
> the
> > > modules
> > > directory; (2) add the line <module ref="logging"/> to my
> > > services.xml; and
> > > (3) put <phase name="loggingPhase"/> in to each of the four
> > > phaseOrders in
> > > axis2.xml, I get no errors during deployment. However the logging
> > > does not
> > > work (with my log4j.properties having DEBUG level for all), and I
> see
> > > the
> > > following lines in the server console, which seems not right,
> this
> > > "null" :
> > >
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler null added to Phase loggingPhase
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler ():113
> > > - Handler null added to Phase loggingPhase
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler null added to Phase loggingPhase
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler null added to Phase loggingPhase
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler AddressingFinalInHandler added to Phase PreDispatch
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler ():113
> > > - Handler AddressingSubmissionInHandler added to Phase
> PreDispatch
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler AddressingOutHandler added to Phase MessageOut
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler AddressingFinalInHandler added to Phase PreDispatch
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler AddressingSubmissionInHandler added to Phase
> PreDispatch
> > > [11 Jul 2006 13:39:45] DEBUG
> > > org.apache.axis2.engine.Phase.addHandler():113
> > > - Handler AddressingOutHandler added to Phase MessageOut
> > >
> > >
> > > Surely it should be easy to add server-side handlers to an
> Axis2-run
> > > web
> > > service ? What is it that I'm missing ?
> > > I greatly appreciate your feedback.
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Reply via email to