This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Websphere and the fly likes Getting Log4J working in RAD 7.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting Log4J working in RAD 7.0" Watch "Getting Log4J working in RAD 7.0" New topic
Author

Getting Log4J working in RAD 7.0

Vidula Mishra
Greenhorn

Joined: Jun 26, 2009
Posts: 2
Hi,

We are trying to get an EAR running on WAS 6.1 in RAD 7.0.
The application has a EJB and a WEB module.

The log4j-1.2.9.jar is a part of both these modules.

When installed on WAS 6.1, it throws an error as below:

Caused by: java.lang.Throwable: java.lang.NoClassDefFoundError: org.apache.log4j.Logger

The Class Loader policy is set to PARENT_FIRST.

I have tried to create the Service folder with the org.apache.commons.logging.LogFactory with the following content into the file:
org.apache.commons.logging.impl.Log4jFactory

I am not getting a clue to resolve this one.

Please help.
Thanks in advance.

Regards,
Vidula
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Vidula Mishra wrote:The log4j-1.2.9.jar is a part of both these modules.

Both? It's traditional to put a jar in the EAR or Web project, but not both. If it used by both, it would go in the EAR and be referred to from both projects in the manifest.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vidula Mishra
Greenhorn

Joined: Jun 26, 2009
Posts: 2
Its an existing application. Hence have retained it as is. It has been working like that in WAS 5.1 for years now.

I have tried to create the META-INF\services folder.
Also added the commons-logging.properties to the WEB-INF of the Web Module.
Changed the Class Loader to the PARENT_LAST.

Nothing seem to be working for me.

Please help.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting Log4J working in RAD 7.0