This content has been marked as final.
Show 2 replies
-
1. Re: The static method getLogger(class) from the class Logger
jaikiran Nov 23, 2007 12:11 AM (in response to theneo)private static Logger logger;
public MasterSessionBean() {
logger = logger.getLogger("org.apache");
log("SessionMaster()");
}
Even if you ignored that warning and deployed this bean, i would expect a NullpointerException at logger.getLogger, since the logger object is never instantiated. The right way to do this (and also get rid of the warning) is:private static Logger logger = Logger.getLogger(MasterSessionBean.class.getName()); public MasterSessionBean() { log("SessionMaster()"); }
-
2. Re: The static method getLogger(class) from the class Logger
theneo Nov 24, 2007 4:43 AM (in response to theneo)@jaikiran
Thanks :-)
i resolved it