2 Replies Latest reply on Jun 16, 2013 4:49 PM by rsmastermind

    Apache logger configuration over Jboss Logger configuration

    rsmastermind

      I tried everything to configure apache logger (commons-logging-1.1.1.jar) but it doen't work.

       

      I have changed jboss-5.1.0.GA\server\default\deployers\jbossweb.deployer\META-INF\war-deployers-jboss-beans.xml file .

      uncommented the line

      <property name="useJBossWebLoader">false</property>

      Line changed to:-

      <property name="filteredPackages">javax.servlet</property>

       

      Here is what I find in console

       

      22:08:19,972 INFO  [ServerImpl] Starting JBoss (Microcontainer)...

      22:08:19,973 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)

      22:08:19,973 INFO  [ServerImpl] Bootstrap URL: null

      22:08:19,973 INFO  [ServerImpl] Home Dir: C:\Softwares\jboss-5.1.0.GA

      22:08:19,973 INFO  [ServerImpl] Home URL: file:/C:/Softwares/jboss-5.1.0.GA/

      22:08:19,973 INFO  [ServerImpl] Library URL: file:/C:/Softwares/jboss-5.1.0.GA/lib/

      22:08:19,974 INFO  [ServerImpl] Patch URL: null

      22:08:19,974 INFO  [ServerImpl] Common Base URL: file:/C:/Softwares/jboss-5.1.0.GA/common/

      22:08:19,974 INFO  [ServerImpl] Common Library URL: file:/C:/Softwares/jboss-5.1.0.GA/common/lib/

      22:08:19,974 INFO  [ServerImpl] Server Name: default

      22:08:19,974 INFO  [ServerImpl] Server Base Dir: C:\Softwares\jboss-5.1.0.GA\server

      22:08:19,974 INFO  [ServerImpl] Server Base URL: file:/C:/Softwares/jboss-5.1.0.GA/server/

      22:08:19,976 INFO  [ServerImpl] Server Config URL: file:/C:/Softwares/jboss-5.1.0.GA/server/default/conf/

      22:08:19,976 INFO  [ServerImpl] Server Home Dir: C:\Softwares\jboss-5.1.0.GA\server\default

      22:08:19,976 INFO  [ServerImpl] Server Home URL: file:/C:/Softwares/jboss-5.1.0.GA/server/default/

      22:08:19,976 INFO  [ServerImpl] Server Data Dir: C:\Softwares\jboss-5.1.0.GA\server\default\data

      22:08:19,976 INFO  [ServerImpl] Server Library URL: file:/C:/Softwares/jboss-5.1.0.GA/server/default/lib/

      22:08:19,976 INFO  [ServerImpl] Server Log Dir: C:\Softwares\jboss-5.1.0.GA\server\default\log

      22:08:19,976 INFO  [ServerImpl] Server Native Dir: C:\Softwares\jboss-5.1.0.GA\server\default\tmp\native

      22:08:19,976 INFO  [ServerImpl] Server Temp Dir: C:\Softwares\jboss-5.1.0.GA\server\default\tmp

      22:08:19,976 INFO  [ServerImpl] Server Temp Deploy Dir: C:\Softwares\jboss-5.1.0.GA\server\default\tmp\deploy

      22:08:20,518 INFO  [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/Softwares/jboss-5.1.0.GA/server/default/conf/bootstrap.xml

      22:08:20,981 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]

      22:08:20,984 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]

      22:08:21,205 INFO  [CopyMechanism] VFS temp dir: C:\Softwares\jboss-5.1.0.GA\server\default\tmp

      22:08:21,285 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.

      22:08:22,157 INFO  [ServerInfo] Java version: 1.6.0_24,Sun Microsystems Inc.

      22:08:22,157 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_24-b07)

      22:08:22,157 INFO  [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 19.1-b02,Sun Microsystems Inc.

      22:08:22,157 INFO  [ServerInfo] OS-System: Windows 7 6.1,amd64

      22:08:22,157 INFO  [ServerInfo] VM arguments: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:51545 -Dprogram.name=JBossTools: JBoss 5.1 Runtime -Xms256m -Xmx768m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=C:\Softwares\jboss-5.1.0.GA\lib\endorsed -Dfile.encoding=Cp1252

      22:08:22,183 INFO  [JMXKernel] Legacy JMX core initialized

      22:08:23,649 INFO  [ProfileServiceBootstrap] Loading profile: ProfileKey@4f737d41[domain=default, server=default, name=default]

      22:08:25,187 INFO  [WebService] Using RMI server codebase: http://localhost:8083/

      22:08:27,708 WARN  [TomcatDeployer] This flag is ignored, see JIRA issue JBAS-6914 on the new MC JBossCL usage.

      22:08:28,700 INFO  [NativeServerConfig] JBoss Web Services - Stack Native Core

      22:08:28,701 INFO  [NativeServerConfig] 3.1.2.GA

      22:08:28,974 INFO  [AttributeCallbackItem] Owner callback not implemented.

      22:08:29,743 INFO  [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl@ca8e2b8[ defaultDomain='jboss' ]

      22:08:38,320 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@403144217{vfsfile:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}

      22:08:38,321 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@403144217{vfsfile:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}

      22:08:38,321 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@403144217{vfsfile:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}

      22:08:38,321 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@403144217{vfsfile:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/profileservice-secured.jar/}

      22:08:40,376 INFO  [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://localhost/jndi/rmi://localhost:1090/jmxconnector

      22:08:40,488 INFO  [MailService] Mail Service bound to java:/Mail

      22:08:42,475 WARN  [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.

      22:08:42,488 WARN  [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent

      22:08:42,543 WARN  [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent

      22:08:42,585 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version - tag:JBOSSTS_4_6_1_GA) - JBoss Inc.

      22:08:42,585 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer

      22:10:01,531 INFO  [TransactionManagerService] Initializing recovery manager

      22:10:01,662 INFO  [TransactionManagerService] Recovery manager configured

      22:10:01,662 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference

      22:10:01,685 INFO  [TransactionManagerService] Starting transaction recovery manager

      22:10:02,057 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;native;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/bin/server;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/lib/amd64;C:\app\RAHUL\product\11.1.0\db_1\BIN;C:\app\RAHUL\product\11.2.0\client_1\bin;C:\Program Files\Java\jdk1.7.0_02\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Softwares\eclipse;

      22:10:02,118 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080

      22:10:02,126 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009

      22:10:02,153 INFO  [StandardService] Starting service jboss.web

      22:10:02,156 INFO  [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.3.GA

      22:10:02,192 INFO  [Catalina] Server startup in 65 ms

      22:10:02,207 INFO  [TomcatDeployment] deploy, ctxPath=/invoker

      22:10:02,641 INFO  [TomcatDeployment] deploy, ctxPath=/web-console

      22:10:02,932 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws

      22:10:03,008 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml

      22:10:03,022 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml

      22:10:03,041 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml

      22:10:03,054 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml

      22:10:03,072 INFO  [RARDeployment] Required license terms exist, view vfszip:/C:/Softwares/jboss-5.1.0.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml

      22:10:07,219 ERROR [AbstractKernelController] Error installing to Start: name=jboss.jca:name='quartz-ra.rar',service=RARDeployment state=Create mode=Manual requiredState=Installed

      org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.

          at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:874)

          at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:604)

          at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:336)

          at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:310)

          at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)

          at org.quartz.simpl.SimpleThreadPool.getLog(SimpleThreadPool.java:126)

          at org.quartz.simpl.SimpleThreadPool.initialize(SimpleThreadPool.java:247)

          at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:965)

          at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152)

          at org.jboss.resource.adapter.quartz.inflow.QuartzResourceAdapter.start(QuartzResourceAdapter.java:64)

          at org.jboss.resource.deployers.RARDeployment.startService(RARDeployment.java:150)

          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)

          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)

          at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:124)

          at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)

          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

          at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)

          at $Proxy38.start(Unknown Source)

        • 1. Re: Apache logger configuration over Jboss Logger configuration
          rsmastermind

          When I removed the commons-logging-1.1.1.jar from server classpath then the above error message is not coming rather I am getting java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory because of spring jars which requires commonn logging jars.

          • 2. Re: Apache logger configuration over Jboss Logger configuration
            rsmastermind

            After doing some workout I got the reason

             

            1.The war which are present in "default" directory (server node) like admin-console.war should have commons logging jars in WEB-INF lib directory but even after this you can get the error for your own war(application wars).

            2.I have checked the method "createLogFromClass" of Class org.apache.commons.logging.impl.LogFactoryImpl where Loop performed through the classloader hierarchy trying to find a viable classloader. Plese see the below code snippet where they try to create the instance of Logger

             

            Class c = null;

                            try {

                                c = Class.forName(logAdapterClassName, true, currentCL);

                            } catch (ClassNotFoundException originalClassNotFoundException) {

                                // The current classloader was unable to find the log adapter

                                // in this or any ancestor classloader. There's no point in

                                // trying higher up in the hierarchy in this case..

                                String msg = "" + originalClassNotFoundException.getMessage();

                                logDiagnostic(

                                    "The log adapter '"

                                    + logAdapterClassName

                                    + "' is not available via classloader "

                                    + objectId(currentCL)

                                    + ": "

                                    + msg.trim());

                                try {

                                    // Try the class classloader.

                                    // This may work in cases where the TCCL

                                    // does not contain the code executed or JCL.

                                    // This behaviour indicates that the application

                                    // classloading strategy is not consistent with the

                                    // Java 1.2 classloading guidelines but JCL can

                                    // and so should handle this case.

                                    c = Class.forName(logAdapterClassName);

                                } catch (ClassNotFoundException secondaryClassNotFoundException) {

                                    // no point continuing: this adapter isn't available

                                    msg = "" + secondaryClassNotFoundException.getMessage();

                                    logDiagnostic(

                                        "The log adapter '"

                                        + logAdapterClassName

                                        + "' is not available via the LogFactoryImpl class classloader: "

                                        + msg.trim());

                                    break;

                                }

                            }

             

            Check the highlighted part for that to work you need log4j.jar in sever classpath. This jar is located in common\lib directory. Don't know whether this is correct solution or not but this works fine.