You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Olivier LAMY <LA...@accor-hotels.com> on 2002/10/21 15:21:48 UTC

apache.commons.logging exception

Hi all,
I have a strange error.
A servlet initialize log4j. Then I want to use commons.logging with the
following code :
public class LogFactory {
/** chargement class en static */
private static final org.apache.commons.logging.LogFactory logFactory =
getLogFactory();
/**
* Method getLog. renvoie un objet de log
* @param name
* @return Log
*/
public static Log getLogger(String name) {
return logFactory.getLog(name);
}
/**
* Methode getLogFactory.
* @return LogFactory
*/
private static final org.apache.commons.logging.LogFactory getLogFactory() {
return Log4jFactory.getFactory();
}
}
This code works fine with w2k, jdk1.4, tomcat 4.1.12 commons-logging 1.0.2
and log4j 1.2.7
But not with Eas Server 3.6.1, jdk1.2 and commons-logging 1.0.2 and log4j
1.2.7.
I have the following exception :
Oct 21 15:09:46 2002: java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException:
java.lang.NullPointerException
        at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java,
Compiled Code)
        at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java,
Compiled Code)
        at com.accor.util.logger.LogFactory.getLogFactory(LogFactory.java,
Compiled Code)
        at com.accor.util.logger.LogFactory.<clinit>(LogFactory.java:15)
        at com.accor.util.logger.Log4jInit.init(Log4jInit.java, Compiled
Code)
        at com.sybase.jaguar.servlet.JagServlet.init(JagServlet.java,
Compiled Code)
        at
com.sybase.jaguar.servlet.ServletPool.createInitializedInstance(ServletPool.
java, Compiled Code)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: apache.commons.logging exception

Posted by Richard Sitze <rs...@us.ibm.com>.
A patch for similar symptoms was submitted last week by another helpful 
user.  Try last nights build to see if that fixes your problem.  If not, 
open a defect.
<ras>

*******************************************
Richard A. Sitze
IBM WebSphere WebServices Development




"Olivier LAMY" <LA...@accor-hotels.com>
10/21/2002 08:21 AM
Please respond to "Jakarta Commons Developers List"
 
        To:     "Jakarta Commons Users List" 
<co...@jakarta.apache.org>
        cc:     "Jakarta Commons Developers List" 
<co...@jakarta.apache.org>
        Subject:        apache.commons.logging exception

 


Hi all,
I have a strange error.
A servlet initialize log4j. Then I want to use commons.logging with the
following code :
public class LogFactory {
/** chargement class en static */
private static final org.apache.commons.logging.LogFactory logFactory =
getLogFactory();
/**
* Method getLog. renvoie un objet de log
* @param name
* @return Log
*/
public static Log getLogger(String name) {
return logFactory.getLog(name);
}
/**
* Methode getLogFactory.
* @return LogFactory
*/
private static final org.apache.commons.logging.LogFactory getLogFactory() 
{
return Log4jFactory.getFactory();
}
}
This code works fine with w2k, jdk1.4, tomcat 4.1.12 commons-logging 1.0.2
and log4j 1.2.7
But not with Eas Server 3.6.1, jdk1.2 and commons-logging 1.0.2 and log4j
1.2.7.
I have the following exception :
Oct 21 15:09:46 2002: java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException:
java.lang.NullPointerException
        at 
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java,
Compiled Code)
        at 
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java,
Compiled Code)
        at com.accor.util.logger.LogFactory.getLogFactory(LogFactory.java,
Compiled Code)
        at com.accor.util.logger.LogFactory.<clinit>(LogFactory.java:15)
        at com.accor.util.logger.Log4jInit.init(Log4jInit.java, Compiled
Code)
        at com.sybase.jaguar.servlet.JagServlet.init(JagServlet.java,
Compiled Code)
        at
com.sybase.jaguar.servlet.ServletPool.createInitializedInstance(ServletPool.
java, Compiled Code)


--
To unsubscribe, e-mail:   <
mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:commons-dev-help@jakarta.apache.org>