You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Hans Loeblich <hl...@kpi-consulting.com> on 2008/09/18 00:10:58 UTC

log4j and logging soap requests

I have two issues currently related to logging.

First I would like to be able to log the SOAP request that is being generated on the client side.  I just have no what class I would need to add a logging statement to, or if anything like this can be setup through configuration files, etc.

My second issue is that I would like to use log4j for logging.  I tried following the instructions from this page:
http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/

I inserted META-INF/cxf/org.apache.cxf.Logger into my cxf-2.1.2.jar file, with just a single line in the file containing the text "org.apache.cxf.common.logging.Log4jLogger".  But it did not seem to make any difference.  Am I doing something wrong here?

Thank you,
Hans Loeblich

Re: log4j and logging soap requests

Posted by Benson Margulies <bi...@gmail.com>.
It's entirely at runtime. And we do it all the time. I'm perplexed.

I could also give you a recipe for how to make an explicit call for the
purpose.


On Fri, Sep 19, 2008 at 3:34 PM, Hans Loeblich <hloeblich@kpi-consulting.com
> wrote:

> I don't really see the difference, since the jar is on the classpath too,
> but I went ahead and tried your suggestion.
> So I've I tried adding to jar file, adding direclty to classpath as you
> suggested, and even supplying vm arguments, but still none of these make any
> difference.  Is this part of the wsdl2java step, or just when running the
> generated code?  Either way, I tried it on both steps.  I just don't get it.
>
> Hans
>
> ----- Original Message -----
> From: "Benson Margulies" <bi...@gmail.com>
> To: users@cxf.apache.org
> Sent: Wednesday, September 17, 2008 5:26:17 PM GMT -06:00 US/Canada Central
> Subject: Re: log4j and logging soap requests
>
> Don't modify the CXF jar file. Just add a file at that path to your
> classpath. That should do it.
>
> For logging of messages:
>
> http://cwiki.apache.org/CXF20DOC/debugging.html has an explanation.
> The interceptors log all of the messages when enabled.
>
>
> On Wed, Sep 17, 2008 at 6:10 PM, Hans Loeblich
> <hl...@kpi-consulting.com> wrote:
> > I have two issues currently related to logging.
> >
> > First I would like to be able to log the SOAP request that is being
> generated on the client side.  I just have no what class I would need to add
> a logging statement to, or if anything like this can be setup through
> configuration files, etc.
> >
> > My second issue is that I would like to use log4j for logging.  I tried
> following the instructions from this page:
> >
> http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/
> >
> > I inserted META-INF/cxf/org.apache.cxf.Logger into my cxf-2.1.2.jar file,
> with just a single line in the file containing the text
> "org.apache.cxf.common.logging.Log4jLogger".  But it did not seem to make
> any difference.  Am I doing something wrong here?
> >
> > Thank you,
> > Hans Loeblich
> >
>

RE: CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Can anyone please help with any information?
Thanks
Kuga

-----Original Message-----
From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com] 
Sent: Wednesday, September 17, 2008 5:15 PM
To: users@cxf.apache.org
Subject: RE: CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Hi,
Just as an update,
I have the following also in my <complexType>
<element name="utilization_update" minOccurs="0" type="dateTime"/>
Not sure if this is the one giving the XMLGregorianCalendarImp
exception.

Any pointers is highly appreciated.
Thanks
Kuga

-----Original Message-----
From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com] 
Sent: Wednesday, September 17, 2008 4:13 PM
To: users@cxf.apache.org
Subject: CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Hi,
In the XSD, I am defining the following:

<complexType name = "test">
	<element name="value" minOccurs="0" nillable="true"
type="anyType"/>
</complexType>

When generating the java objects using WSDLTOJava, the generated java
object looks like this:

@XmlElementRef(name = "value", type = JAXBElement.class)
protected JAXBElement<Object> value;

Due to this I am getting a MarshalException while trying to send a SOAP
write request.

Would appreciate if anyone could help me with any pointers to this
issue.

Thanks & Best Regards,
Kuga

javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException:
com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
l is not known to this context]
      at
com.sun.xml.internal.ws.message.jaxb.JAXBMessage.writePayloadTo(Unknown
Source)
      at
com.sun.xml.internal.ws.message.AbstractMessageImpl.writeTo(Unknown
Source)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.encode(Unknown
Source)
      at
com.sun.xml.internal.ws.encoding.SOAPBindingCodec.encode(Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(
Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processR
equest(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
      at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown
Source)
      at $Proxy73.objectWrite(Unknown Source)

RE: CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Hi,
Just as an update,
I have the following also in my <complexType>
<element name="utilization_update" minOccurs="0" type="dateTime"/>
Not sure if this is the one giving the XMLGregorianCalendarImp
exception.

Any pointers is highly appreciated.
Thanks
Kuga

-----Original Message-----
From: Kugaprakash Visagamani [mailto:kvisagamani@infoblox.com] 
Sent: Wednesday, September 17, 2008 4:13 PM
To: users@cxf.apache.org
Subject: CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Hi,
In the XSD, I am defining the following:

<complexType name = "test">
	<element name="value" minOccurs="0" nillable="true"
type="anyType"/>
</complexType>

When generating the java objects using WSDLTOJava, the generated java
object looks like this:

@XmlElementRef(name = "value", type = JAXBElement.class)
protected JAXBElement<Object> value;

Due to this I am getting a MarshalException while trying to send a SOAP
write request.

Would appreciate if anyone could help me with any pointers to this
issue.

Thanks & Best Regards,
Kuga

javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException:
com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
l is not known to this context]
      at
com.sun.xml.internal.ws.message.jaxb.JAXBMessage.writePayloadTo(Unknown
Source)
      at
com.sun.xml.internal.ws.message.AbstractMessageImpl.writeTo(Unknown
Source)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.encode(Unknown
Source)
      at
com.sun.xml.internal.ws.encoding.SOAPBindingCodec.encode(Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(
Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processR
equest(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
      at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown
Source)
      at $Proxy73.objectWrite(Unknown Source)

CXF - WSDLTOJAVA generates JaxbElement for "nillable=true"

Posted by Kugaprakash Visagamani <kv...@infoblox.com>.
Hi,
In the XSD, I am defining the following:

<complexType name = "test">
	<element name="value" minOccurs="0" nillable="true"
type="anyType"/>
</complexType>

When generating the java objects using WSDLTOJava, the generated java
object looks like this:

@XmlElementRef(name = "value", type = JAXBElement.class)
protected JAXBElement<Object> value;

Due to this I am getting a MarshalException while trying to send a SOAP
write request.

Would appreciate if anyone could help me with any pointers to this
issue.

Thanks & Best Regards,
Kuga

javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.bind.JAXBException:
com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
l is not known to this context]
      at
com.sun.xml.internal.ws.message.jaxb.JAXBMessage.writePayloadTo(Unknown
Source)
      at
com.sun.xml.internal.ws.message.AbstractMessageImpl.writeTo(Unknown
Source)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.encode(Unknown
Source)
      at
com.sun.xml.internal.ws.encoding.SOAPBindingCodec.encode(Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(
Unknown Source)
      at
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processR
equest(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
      at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
      at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown
Source)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown
Source)
      at $Proxy73.objectWrite(Unknown Source)

Re: log4j and logging soap requests

Posted by Hans Loeblich <hl...@kpi-consulting.com>.
I don't really see the difference, since the jar is on the classpath too, but I went ahead and tried your suggestion.
So I've I tried adding to jar file, adding direclty to classpath as you suggested, and even supplying vm arguments, but still none of these make any difference.  Is this part of the wsdl2java step, or just when running the generated code?  Either way, I tried it on both steps.  I just don't get it.

Hans

----- Original Message -----
From: "Benson Margulies" <bi...@gmail.com>
To: users@cxf.apache.org
Sent: Wednesday, September 17, 2008 5:26:17 PM GMT -06:00 US/Canada Central
Subject: Re: log4j and logging soap requests

Don't modify the CXF jar file. Just add a file at that path to your
classpath. That should do it.

For logging of messages:

http://cwiki.apache.org/CXF20DOC/debugging.html has an explanation.
The interceptors log all of the messages when enabled.


On Wed, Sep 17, 2008 at 6:10 PM, Hans Loeblich
<hl...@kpi-consulting.com> wrote:
> I have two issues currently related to logging.
>
> First I would like to be able to log the SOAP request that is being generated on the client side.  I just have no what class I would need to add a logging statement to, or if anything like this can be setup through configuration files, etc.
>
> My second issue is that I would like to use log4j for logging.  I tried following the instructions from this page:
> http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/
>
> I inserted META-INF/cxf/org.apache.cxf.Logger into my cxf-2.1.2.jar file, with just a single line in the file containing the text "org.apache.cxf.common.logging.Log4jLogger".  But it did not seem to make any difference.  Am I doing something wrong here?
>
> Thank you,
> Hans Loeblich
>

Re: log4j and logging soap requests

Posted by Benson Margulies <bi...@gmail.com>.
Don't modify the CXF jar file. Just add a file at that path to your
classpath. That should do it.

For logging of messages:

http://cwiki.apache.org/CXF20DOC/debugging.html has an explanation.
The interceptors log all of the messages when enabled.


On Wed, Sep 17, 2008 at 6:10 PM, Hans Loeblich
<hl...@kpi-consulting.com> wrote:
> I have two issues currently related to logging.
>
> First I would like to be able to log the SOAP request that is being generated on the client side.  I just have no what class I would need to add a logging statement to, or if anything like this can be setup through configuration files, etc.
>
> My second issue is that I would like to use log4j for logging.  I tried following the instructions from this page:
> http://www.techper.net/2008/01/30/configuring-cxf-logging-to-go-through-log4j/
>
> I inserted META-INF/cxf/org.apache.cxf.Logger into my cxf-2.1.2.jar file, with just a single line in the file containing the text "org.apache.cxf.common.logging.Log4jLogger".  But it did not seem to make any difference.  Am I doing something wrong here?
>
> Thank you,
> Hans Loeblich
>