Hello,

 

I am a newbie as far as web services and log4j are concerned. I want to
write a web service appender using Axis and log4j. This appender should
be able to call the web service. 

 

Here's what I have done:- 

 

1) Created a service named MyService, using Axis, and deployed it
successfully in tomcat.

2) Created a remote appender class MyAppender by extending
AppenderSkeleton class. 

3) Created a main class LogClass having loggers.

4) Created log4j.properties file so as to call MyAppender.

 

While running the main class, it seems as if the append() method is
being called multiple times, which in turn creates multiple
org.apache.axis.client.Service objects and that leads to the following
exception:-

 

message
=getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)

java.lang.NullPointerException

 

message =loadBundle: Ignoring MissingResourceException: Can't find
bundle for base name org.apache.axis.resource, locale en_US

java.lang.NullPointerException

 

message =Created org.apache.axis.i18n.resource, linked to parent null

java.lang.NullPointerException

 

message
=getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)

 

The program eventually terminates by throwing - Exception in thread
"main" java.lang.StackOverflowError

 

 

Moreover, this web service is working absolutely fine when invoked from
a class having just a main method. The above problem occurs when the
same piece of code is moved inside a private method
(executeWebService()) and the method is called from the append() method
of the appender (MyAppender). Could anyone please point me to the
problem with the appender (MyAppender)?

 

My Queries:-

1) Has it anything to do with the lifecycle of append() method? If yes,
could someone elaborate on its lifecycle?

2) If this is not the correct way of writing a web service appender
using log4j (given that the service is deployed in tomcat), how can I do
so correctly?

 

Thanking you in anticipation.

 

Regards,

Sushil Duseja

 

PS: All the files discussed are attached with the mail.

Attachment: log4j.properties
Description: log4j.properties

Attachment: LogClass.java
Description: LogClass.java

Attachment: MyAppender.java
Description: MyAppender.java

Attachment: MyService.java
Description: MyService.java

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to