Hi,
I am using Oracle Application Server 10g Release 3 (10.1.3.5.0) for
windows.
Because of below bug in Oracle App Server
After Upgrading from 10.1.3.1.0 the Application Fails with
"java.lang.NoClassDefFoundError: org/apache/log4j/Category" [ID 460448.1]
I am not importing the OC4J standard shared lib "apache.commons.logging
version 1.0.4" But have created my own shared-lib along with others. The
nex.apache.commons.logging has one jar file commons-logging-1.1.1.jar.
<imported-shared-libraries>
<import-shared-library name="nex.apache.commons.logging"
max-version="1.1.1"/>
<import-shared-library name="nex.Displaytag" max-version="1.1.1"/>
<import-shared-library name="nex.iBatis" max-version="2.3.0"/>
<import-shared-library name="nex.jakarta.commons" max-version="2.0"/>
<import-shared-library name="nex.Spring" max-version="2.5.0"/>
<import-shared-library name="nex.Struts" max-version="1.3.9"/>
<import-shared-library name="oracle.jdbc" max-version="11.1.0.7.0"/>
</imported-shared-libraries>
In my ear file I have log4j-1.2.13.jar file. The log4j.properties is:
log4j.rootCategory=DEBUG,stdout,standardFile
log4j.configCheckDelay=900000
################################## CONSOLE
########################################
log4j.appender.OJDL=oracle.core.ojdl.log4j.OracleAppender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d{dd MMM yyyy HH:mm:ss}]
%-5p [%c{1}] %m%n
log4j.defaultInitOverride=true
################################## STANDARD FILE
##################################
log4j.appender.standardFile=org.apache.log4j.RollingFileAppender
log4j.appender.standardFile.File=/u5/reteklogs/dev/VGCC/log/vgcc.log
log4j.appender.standardFile.MaxFileSize=1000KB
log4j.appender.standardFile.MaxBackupIndex=50
log4j.appender.standardFile.layout=org.apache.log4j.PatternLayout
The Java class using apche commons logging has code:
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class CustomerFindAction
extends CommonDispatchAction
{
private Log logger = LogFactory.getLog(this.getClass());
public ActionForward findCustomer(ActionMapping mapping, ActionForm
form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
logger.info("Entered findCustomer()");
logger.debug("Testing apache commons");
.......
It does not print the logs on my log file vgcc.log.
But the Java class where I am using logger instance from log4j, it does
print:
import org.apache.log4j.Logger;
public class SessionCounter
{
private Logger logger = Logger.getLogger("SessionCounter");
public void addSession(HttpServletRequest request)
throws ParseException, BusinessRuleException,
CloneNotSupportedException
{
logger.info("Entered addSession");
logger.debug("testing log4j");
} ....
But I really need to display logs via apache commons logging, because my
application has several other libraries that uses apache commons. and I
need to print logs from there.
Thanks for your help.
Jasmin
******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.
Thank You!
******************************************************************************