Configuring log4j in jboss ??

Hi All,
i am using jboss.i need to configure log4j with my log4j.properties file.
i did for this is ..
1) under WEB-INF i created one xml file named ,jboss-web.xml. under this..
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
     com.WIL:loader=WIL.war
<loader-repository-config>java2ParentDelegation=false</loader- repository-config>
</loader-repository>
</class-loading>
</jboss-web>
2) raname \server\default\conf\log4j.xml to jboss-log4j.xml
3) change in \server\default\conf\jboss-service.xml ......... reource:log4j.xml to resource:jboss-log4j.xml
<mbean code="org.jboss.logging.Log4jService"
name="jboss.system:type=Log4jService,service=Logging">
<attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
4) write log4j.properties...
log4j.rootCategory=DEBUG, Default
log4j.appender.Default=org.apache.log4j.FileAppender
log4j.appender.Default.File=c:/newLog.log
log4j.appender.Default.layout=org.apache.log4j.PatternLayout
log4j.appender.Default.layout.ConversionPattern=%d{DATE} %-5p: %m%n
log4j.appender.Default.Append=false
i restarted the jboss server.
Every time i am getting ClassCastException..
java.lang.ClassCastException
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1001)
can anybody solve this. it is very urgent.
Thanks in advance.

In my web.xml i wrote like this..
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Times Warner Cable</display-name>
<servlet>
     <servlet-name>RequestHandler</servlet-name>
     <servlet-class>com.mportal.twc.wil.controller.RequestHandler</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
     <servlet-name>RequestHandler</servlet-name>
     <url-pattern>/RequestHandler/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>com.mportal.twc.wil.common.WILSessionListener</listener-class>
</listener>
</web-app>
i need Request Handler class has to be load on start up.
when i started jboss server i am getting exception..
08:53:20,750 INFO [TomcatDeployer] deploy, ctxPath=/WIL, warUrl=file:/C:/jboss-3.2.8.SP1/server/default/deploy/WIL.war/
08:53:22,578 INFO [Engine] StandardContext[WIL]Marking servlet RequestHandler as unavailable
08:53:22,578 ERROR [Engine] StandardContext[WIL]Servlet /WIL threw load() exception
javax.servlet.ServletException: Class com.mportal.twc.wil.controller.RequestHandler is not a Servlet
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1005)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4017)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:163)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5456)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:163)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:288)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:98)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:334)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:968)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:404)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy27.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:371)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:841)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:653)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:316)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:490)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:213)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:286)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:968)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:404)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:263)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:841)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:653)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:600)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:462)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:353)
at org.jboss.Main.boot(Main.java:201)
at org.jboss.Main$1.run(Main.java:459)
at java.lang.Thread.run(Thread.java:534)
08:53:22,578 ERROR [Engine] ----- Root Cause -----
java.lang.ClassCastException
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1001)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4017)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:163)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5456)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:163)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:288)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:98)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:334)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:968)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:404)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy27.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:371)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:841)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:653)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:316)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:490)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:213)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:286)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:968)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:404)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:263)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:841)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:653)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:600)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:462)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:353)
at org.jboss.Main.boot(Main.java:201)
at org.jboss.Main$1.run(Main.java:459)
at java.lang.Thread.run(Thread.java:534)
Can Plaease give me solution.It is very urgent..

Similar Messages

  • Log4J on Weblogic vs Log4J on JBoss

    I am working on migrating from JBoss to WebLogic 10. I am able to successfully setup Log4J on WL with a small problem. What I did to configure Log4J was the following.
    . Change the Logging implementation from the WL console to use Log4J
    . Replace the jboss appenders in the Log4J.xml(org.jboss.appender.DailyRollingFileAppender) to Log4J's DailyRollingFileAppender.
    . Added the required Log4J jars to the server classpath
    The problem I am having is, WL is logging too much information onto the console and since it is doing that, the same app with similar Log4J's is slower on WebLogic as compared to JBoss.
    Is there another setting I need to change to not have WebLogic spit everything out to the console? I compared the thresholds in the JBoss' Log4J vs WL Log4J and everything is the same. Can someone please explain why the difference?
    Thanks.

    You can add your.properties and log4j.properties to the classpath cant you?
    You just need to edit setEnv.cmd (if i remember correctly) in your weblogic server folder to add the folder containing the properties files to the classpath variable.

  • Log4j and Jboss are acting weird

    This question is reagards to Log4j and JBoss and I thought this is the best place to ask this question.
    I am using Jboss 3.2.3. My purpose was to log messages in a seperate file "developer.log" using Log4j. These messages has to be logged in this file only. So in my WAR's folder under WEB-INF/classes I created a file log4j.properties:
    log4j.logger.standard=DEBUG, devlog
    log4j.appender.devlog=org.apache.log4j.RollingFileAppender
    log4j.appender.devlog.File=C:/logs/developer.log
    log4j.appender.devlog.layout=org.apache.log4j.PatternLayout
    log4j.appender.devlog.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%nNow my code :
    import org.apache.log4j.Logger;
    private static Logger log = Logger.getLogger("standard");
    log.debug("a debug message");
    log.info("a info message");
    log.warn("a war message");I test run this code without Jboss and it works perfect. It created a file "developer.log" in the desired location and logs messages in it.
    Now i run with JBoss. JBoss does not create "developer.log" file at all. Instead it logs all the messages in server.log
    2005-09-30 23:07:35,459 DEBUG [standard] a debug message
    Jboss is recognizing that it is standard but after that it is not gving me the desired results. Any input on how to fix this problem?
    TIA

    You can tell it you don't want to inherit, by adding
    this to your "standard" category tag:
    <category name="standard" additivity="false">
    thanks. it works perfect.
    ok i got it working kind of. Jboss already comeswith
    a log4j.xml so i put my log4j stuff in this file :You should be able to deploy your own log4j.xml with
    your app's resource files and make it use yours when
    it is running your app.Ok I took out my stuff from Jboss log4j.xml, create a new xml progtest.log4j.xml like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
      <appender name="DEVLOG" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="${jboss.server.home.dir}/log/developer.log" />
        <param name="Append" value="true" />
        <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
        </layout>
      </appender>
      <category name="standard" additivity="false">
        <priority value="INFO"/>
        <appender-ref ref="DEVLOG" />
      </category>
    </log4j:configuration>My web application is in a ProgTest.WAR folder. I put the above file "progtest.log4j.xml" under WEB-INF/classes in ProgTest.WAR folder. When i run the app the very first problem again arises that no developer.log file was created; instead the concerned messages were put into server.log and console.
    All my classes are in one jar file. I include progtest.log4j.xml in that jar file, redeploy it and test it but still the same problem.
    What i am doing wrong here?
    Thanks

  • Configure log4j to write to different log files conditionally

    Hi folks,
    Is there is way log4j could be configured to write to multiple log files conditionally? Let me try to explain what i am trying to do.
    I have two classes DatabaseChecker and FTPChecker extends Checker class. Within Checker class, there is a method logTestResult(CheckerType c, boolean isFailed, int retry, int isMaxRetryExceeded). Depending on the CheckerType(database or FTP), I need to write log outputs to different files (dbchecker.log or ftpchecker.log). How do i configure log4j to do this?
    I've seen how to configure log4j based on classes from different package, but not sure on this one. Any clue would be much appreciated.

    lgmqy2000 wrote:
    I have two classes DatabaseChecker and FTPChecker extends Checker class. Within Checker class, there is a method logTestResult(CheckerType c, boolean isFailed, int retry, int isMaxRetryExceeded). Depending on the CheckerType(database or FTP), I need to write log outputs to different files (dbchecker.log or ftpchecker.log). How do i configure log4j to do this?
    if (checker.isType(CheckerType.DATABASE)) {
        dbLogger.info(someMessage);
    } else if (checker.isType(CheckerType.FTP)) {
        ftpLogger.info(someMessage);
    } else {
        defaultLogger.info(someMessage);
    }~

  • How to configur log4j logging for weblogic 10.1

    Hi,
    I am tried to set log4j logging for my application running in weblogic 10.1. I set a log4j.properties file and loaded the properties by a servlet. Where its load the properties files and configure it by PropertyConfigurator.
    The same logic has worked out in websphere. But in weblogic, it is not working. I set the server logging and domain logging to Log4j in Admin console. Now it is writing all the log statements.
    If i write a property for a package to Error level and root level is Debug. Its not working, all debug statements are getting written.
    Can you please tell me the steps to configure log4j logging in weblogic 10.1.
    Thanks & Regards,
    Nasrin.N

    Did you manage to get this working?
    If yes ... what did you do?
    I am having the same problem implementing commons-logging with log4j

  • Creating SSL certificate and configuring it with JBOSS 4.0.1

    I have to post some data to a secured site from my application.
    For this, I am creating connection to that site using URLConnection and to send data I create OutputStream using the connection.
    But, while creating the stream it is showing SSLException and message is No trusted certificate found.
    For this, I need to create SSL certificate (mostly using keytool command) and configure it with my application server which is JBOSS 4.0.1
    Now, my problem is that I don't know the exact steps to create a certificate and configure it with JBOSS. Please provide the steps in detail.

    I think you have this back to front. Unless this exception came from the server, in which case it is misconfigured, you don't have to create a certificate, you have to import the server's certificate, or that of one of its signers, into the client's truststore, and tell Java where the truststore is if it's in a non-standard location.
    See http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html. You'll have to ask about the JBoss part in a JBoss forum.

  • Steps to configuring log4j with plain text file

    can anyone help me with the steps involved with configuring log4j with a plain text configuration file...Where should log4j.properties file be stored?.....do you have a simple example of a config file using a file appender?.....do I have to make changes within the startWebLogic.cmd script?.....Is it possible for you to lay out the procedure for me to begin logging?.....nothing I have tried thus far has worked.....Any help you may be able to provide will be greatly appreciated.

    i am using sun jsf implementaion version 1.2
    can i know do we need to specify anything for application bean to be called. beacause when i tried to print in sample application also my log was not getting printed.
    i have mentioned in my managed bean
    <managed-bean>
    <managed-bean-name>ApplicationBean1</managed-bean-name>
    <managed-bean-class>webapplication3.ApplicationBean1</managed-bean-class>
    <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
    i my page class
    protected webapplication3.ApplicationBean1 getApplicationBean1() {
    return (webapplication3.ApplicationBean1)getBean("ApplicationBean1");
    can i know why it is not getting called.

  • How to configure and use jboss cache

    Hi,
    I need to use Jboss Cache in our application,
    But i don't know anything about Jboss Cache...
    can u tell me requirements and configuration for this?
    and i am using jboss application server 3.2.3..
    and apache-ant-1.7.1, jdk1.6.0_06, jbosscache 2.2.0
    can u tell me how to configure and use jboss cache?
    Thanks & Regards
    Thilkumar

    Go to the JBoss web site and read up on the documentation there.
    And if you still have any questions you'll probably get better answers at the JBoss forums than in these forums.
    - Roy

  • How to configure Hibernate in JBoss

    Hi,
    I'm using JBoss to run my application.
    we are migrating complete application from JDBC to Hibernate,
    Can any one explain how should i configure Hibernate in JBoss server
    Cheers

    Go through this tutorial: http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html
    It explains how to setup hibernate.

  • How to configure datasource in JBOSS?

    Hi All,
    I want to configure datasource in JBOSS for oracle database? The constraints are
    1) The password should be in the encrypted format in the configuration file because I dont want to reveal my password to anyone.
    How can we acheive this.
    Can I do the encryption at the time of build(If yes how?)
    For any help Thanks in advance.
    Rajani Kanth

    Hi Rajani
    I was browsing the web looking for a way to solve the same problem.
    Have you every found a way to do this?
    I'm faced with the same problem: I must encrypt the user name and
    password.
    Did you find out whether JBoss has a way to accomplish this.
    Many thanks in advance.
    Serge
    [email protected]

  • How to configure log4J ?

    Hi All,
    Can anyone please let me know how to configure log4J in portal?
    I searched in sdn, help.sap and market place, but in vain. Could n't really get any help.
    Thanks in advance
    -Sudheer

    Hi Kathik,
    That's pretty much not very different from configuring log4j in another IDE. Look at the documentation website of the Log4J project, see: http://logging.apache.org/log4j/docs/documentation.html.
    You can find a good intro at: http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/log4j/log4j.html.
    You could also use the logging mechanism of the Java SE.
    Ronald

  • Configuring Log4j for weblogic

    Hi
    can any one tell me how to configure Log4j for weblogic. I have added the log4j jar files to the weblogic classpath but it does not seem to work..
    Thanks and Regards
    Narayan

    You must make a new directory on the same level with applications directory, place "log4j.properties" file in it, include this directory in the "PRE_CLASSPATH" entry in your startup script and that's all.
    Sample line in "startWebLogic.cmd" script
    'set PRE_CLASSPATH=%_LIBJARS%;classes'
    in classes dir you have "log4j.properties"
    Should work,
    Cristian Negoita

  • Configuring log4j 1.1.2 with WL6.0

    I'm sure many of you have configured Log4J version 1.1.2 with weblogic 6.0? following is the problem I have configuring it, any help is appreciatedI am setting the system property log4j.configuration during weblogic start up using "-Dlog4j.configuration=log4j.properties". I have the file in WEB-INF/classes directory of my web-application as documented in log4j manual, but I still get the well documentedlog4j: No appenders could be found for category (some.category.name).log4j: Please initialize the log4j system properlycould someone please point me in the right direction??thanx in advance

    We've had to do the same for log4j and now for resource bundles. My
    understanding was that anything under web-inf/classes was part of the
    classpath for the webapp. WLS 6.0sp1 does provide isolation between webapps,
    but it seems that things that are found by searching the classpath
    (properties/resources) don't get found. This is a big issue for us because
    separate web apps may need their own version of log4j, resource bundles,
    etc. The example Daniel provided works for us, until we want a separate
    configuration for different web apps.
    I hope someone [BEA?] can clarify the behavior of classpath searching (not
    class loading) when using webapps. Maybe this should be in the Servlet
    thread, but I didn't see anything like this thread over there.
    "Daniel Hoppe" <[email protected]> wrote in message
    news:[email protected]..
    Hi Kiran,
    you could specify a complete file url like this one:
    -Dlog4j.configuration=file:/c:/dev/fbs2/repository/fbs_config/log_config
    .xml
    Cheers,
    Daniel
    -----Ursprüngliche Nachricht-----
    Von: Kiran [mailto:[email protected]]
    Bereitgestellt: Freitag, 8. Juni 2001 08:23
    Bereitgestellt in: environment
    Unterhaltung: Configuring log4j 1.1.2 with WL6.0
    Betreff: Configuring log4j 1.1.2 with WL6.0
    I'm sure many of you have configured Log4J version 1.1.2 with weblogic
    6.0? following is the problem I have configuring it, any help is
    appreciatedI am setting the system property log4j.configuration during
    weblogic start up using "-Dlog4j.configuration=log4j.properties". I
    have the file in WEB-INF/classes directory of my web-application as
    documented in log4j manual, but I still get the well documentedlog4j: No
    appenders could be found for category (some.category.name).log4j: Please
    initialize the log4j system properlycould someone please point me in the
    right direction??thanx in advance

  • Unable to configure log4j using a properties file

    So i have an xml log4j config file that i stole from JBOSS, so i know it has the correct syntax. i put this file into my project dir, and i do this in the main method:
    System.out.println(new File("crawler.log4j.properties.xml").exists()); //prints true
    PropertyConfigurator.configure("crawler.log4j.properties.xml");i have the console appender set to INFO
    I am seeing DEBUG messages.
    i searched my project for log4j* files and there are no other configs laying about.
    what am i missing?

    i should have been using DOMConfigurator instead of PropertyConfigurator

  • Log4j with Jboss

    hi i wanted to implement my own log4j logging in JBoss not the default log4j logging ..for which we made classes which extends log4j classes ..it is working fine with applications ..but the problem is when using with .ear file in jboss ..
    can someone tell me how to package our own logging jars in EAR file on jboss

    Can you share your current custom log4j logging settings? the XML file entries.
    Without much to debug the problem I would suggest that you configure logging in:
    /META-INF/jboss-app.xml
    and not in individual WAR - web files:
    /WEB-INF/jboss-web.xml

Maybe you are looking for