Using log4j with WebSphere

by lichen 3/12/2007 3:05:00 PM

I have been developing a web service using WebSphere. I tried to add logging functionality using log4j. I used a servlet to initialize the log4j configuration using the suggestion in http://logging.apache.org/log4j/docs/manual.html. I also used the example log4j.xml files in http://www.laliluna.de/log4j-tutorial.html. I added the log4j jar file into the WEB-INF/lib directory and added the log4j.xml file into the WEB-INF/classes directory. However, I would lose my log4j.xml file whenever I rebuild my project. This because the entire WEB-INF/classes directory is rewritten when the project is rebuilt. So I moved the log4j.xml into the WEB-INF directory, along with other .xml files. However, when I run the project, I would get:

  • R log4j:WARN No appenders could be found for logger (root).
  • R log4j:WARN Please initialize the log4j system property.

I googled around a bit and found that the log4j.xml file needs to be in the classes directory. So I copied to log4j.xml file into the JavaSource directory. When the project is rebuilt, the file is automatically copied to the the WEB-INF/classes directory. When I ran the program again, it worked beautifully.

Some additional notes:

  1. log4j.dtd needs to be in the same directory as log4j.xml.
  2. When I test the web service using WebSpere v5.1 test environment, the log file is found in the root directory of my WebSphere Studio.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Java | Web Service

Calling Web Service from VB6

by lichen 10/26/2006 5:38:00 PM

It is possible to call web service from VB6 using Soap Toolkit 3.0. Soap Toolkit works the best when calling Web services created using Soap Toolkit 3.0 and COM objects. This is because Soap Tookit 3.0 comes with the WSDL tool that can generate both the WSDL and WSML files. The later is important in deserialze the soap message and map it to the COM objects on the client-side.

What happens to Web Services not created with Soap Toolkit 3.0? Those web services do not have WSML files. So we can either create WSML manually or create the customer mapper. The later essentially requires to walk through the IXMLDOMNodeList returned by soap call and create and set the properties of COM objects. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Web Service | XML

Mono beta 1 is released

by lichen 5/10/2004 12:52:00 PM

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET | Open Source | Web Service

APIs from .COM leaders

by lichen 1/22/2004 3:33:00 PM

Several .COM leaders publish API that allow other developers to integrate their applications offered by these companies. Ebay has a developers program that allows third party developers to automate auction list posting.

Amazon has several programs. You can link to Amazon.com from your Web site and earn up to 10% in referral fees. Or one can use Web Services to query or sell items on Amazon.

Google also has an API that allows us to search Google and get results programmatically. However, there are too many limitations to make the API useful.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET | Web Service

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2010

      Sign in