logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sohan <sohan.kas...@mms.gov>
Subject Re: RepositorySelector + weblogic 8.1 sp6
Date Wed, 06 Jun 2007 20:34:47 GMT

I thought I will try with JNDI sample provided in Log4j manual.
I created JDNIRS  class and initialized it through another class which
implements ServletContextListener.
In this class the code is ...First application is being deployed but the
second application which has same code raises error (see error stack below
(bold)). I tried to get guard both ways, "private static Object guard =
LogManager.getRootLogger" and "private static Object guard = new Object();"

Weblogic 8.1 and Log4j 1.2.14. Log4j.jar is in the classpath.

thanks for any help.
Sohan

public void LogInit(ServletContext ctx) throws ServletException {	
		System.out.println("\n\n---------------Log4jInit---------------\n\n");

		String strLogProperties = ctx.getInitParameter("Log4JProperties");			    
        System.out.println("Log4j properties " + strLogProperties);
        
        String webAppName = ctx.getInitParameter("LogFileName");			    
        System.out.println("App log File name " + webAppName);
       
        if (webAppName == null ) {        	
        	webAppName = getWebAppName(ctx);
        }        
        System.out.println("Application name = " + webAppName);
        rs = new JNDIRS(ctx, webAppName, strLogProperties);

        LogManager.setRepositorySelector(rs, guard);     
        
        LOG = Logger.getLogger(this.getClass());
		LOG.info("Log message from Log4jInit ServletContextListener");

		System.out.println("\n\n---------------Log4jInit:
Complete---------------\n\n");

	}

<Jun 6, 2007 3:27:22 PM CDT> <Warning> <HTTP> <BEA-101162> <User
defined
listene
r pcs.common.util.Log4jConfigNew failed: java.lang.IllegalArgumentException:
Att
empted to reset the LoggerFactory without possessing the guard..><Jun 6,
2007 3:27:22 PM CDT> <Warning> <HTTP> <BEA-101162> <User defined listene
r pcs.common.util.Log4jConfigNew failed: java.lang.IllegalArgumentException:
Att
empted to reset the LoggerFactory without possessing the guard..>
<Jun 6, 2007 3:27:22 PM CDT> <Warning> <HTTP> <BEA-101162> <User
defined
listene
r pcs.common.util.Log4jConfigNew failed: java.lang.NullPointerException.>
<Jun 6, 2007 3:27:22 PM CDT> <Error> <Deployer> <BEA-149231> <Unable
to set
the
activation state to true for the application pcs-staff.
weblogic.management.ApplicationException: start() failed.
{
Module Name: pcs-staff, Error: weblogic.management.DeploymentException:
Attempte
d to reset the LoggerFactory without possessing the guard. - with nested
excepti
on:
[java.lang.IllegalArgumentException: Attempted to reset the LoggerFactory
withou
t possessing the guard.]
}        at
weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2188)
        at
weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2222)
        at
weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2169)
        at
weblogic.management.deploy.slave.SlaveDeployer$Application.setActivat
ion(SlaveDeployer.java:3111)
        at
weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForA
llApplications(SlaveDeployer.java:1769)
        at
weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
ava:352)
        at
weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
e(DeploymentManagerServerLifeCycleImpl.java:229)
        at
weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:136)
        at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:965)
        at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:360)
        at weblogic.Server.main(Server.java:32)
>





sohan wrote:
> 
> Hi,
> 
> I have used RepositorySelector to implement application specific logging
> on Weblogic 8.1.6 server using Log4j 1.2.14 versions. 
> Logging takes place as intended from all java class files when
> applications are hot deployed on weblogic (start weblogic server and
> deploy applications through console). If applications are not redeployed
> after weblogic is started then logging takes place from only two java
> class files, they are filters and rest of the logging does not take place.
> In my applications RepositorySelector is loaded through
> ServletContextListener.
> 
> What could be the reason? Any help is appreciated.
> 
> Thanks,
> Sohan
> 

-- 
View this message in context: http://www.nabble.com/RepositorySelector-%2B-weblogic-8.1-sp6-tf3872539.html#a10996748
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message