Operation Failed With Error Org Apache Log4j Category On Deploy
applications to OC4J 10.1.3.2 or higher By Sandra Muller on Dec 02, 2007 While deploying your JHeadstart application to OC4J 10.1.3.2 or higher, are you experiencing error messages like the following?Operation failed with error: org/apache/log4j/CategoryNo appenders could be found for logger (com.sun.faces.config.ConfigureListener)oracle.oc4j.admin.internal.DeployerException: java.lang.ExceptionInInitializerErrororg.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@900079 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)This occurs because OC4J 10.1.3.2 and higher has defined a common shared library for apache.commons.logging, but this library has a dependency on log4j classes, which are not available in that shared library. Having log4j.jar in your EAR file does not help, because when called from a shared library, the classloader expects them to be available in the shared classpath instead of in the application-specific classpath. See OC4J bug 5871305 and Note 460448.1 in MetaLink for more information.The workaround is to exclude apache.commons.logging from the shared library for your application: update orion-application.xml with the lines
SupportProfessional SupportDownloadHosted Download Try now Administrator's Guide OC4J installation OC4J installation Last modified by Sorin Burjan on 2013/02/19 13:21 Export Annotate Print preview View Source Siblings Comments Attachments History Information × Export Export as PDF Export as HTML Cancel These instructions cover Oracle Application Server 10.1.3.1.0; other versions may differ.Choose/prepare a XWiki distributionThe 'web standard hsqldb.war' build will work right out of the box if you don't mind it storing its own HSQL database files https://blogs.oracle.com/jheadstart/entry/deploying_jheadstart_applicati in ...oracle/product/10.1.3.1/OracleAS_1/j2ee/home/database/.Note that the database directory already exists within the OAS install and is used for other things so you may want to change this directory by editing hibernate.cfg.xml in the .war file. Another option is to edit hibernate.cfg.xml after it has been deployed to the server.Install XWiki http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationOC4J as an OC4J webappInstall XWiki using the Oracle Enterprise Manager webapplication in an already working OAS installation.As of 10.1.3.x the Manager webapp is located at the following address: http://server_address/em/Click on an OC4J instance, then click the "Applications" tab and then "Deploy".Choose the xwiki.war file you have downloaded.On the third deployment page you will be given the option to "Edit Deployment Plan". Click this, open the "war" tree segment on the left, click "xwiki", scroll down and click "Edit webAppClassLoader", change "searchLocalClassesFirst" to "true", click "Continue" and then "Ok".Configuring XWiki to use the OC4J LoggerInside your xwiki.war file find WEB-INFcommons-logging.properties.As a default it looks like this: org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImplTo make it use "Oracles Logging" modify it to look like this: org.apache.commons.logging.LogFactory=oracle.core.ojdl.log4j.OracleAppenderMaking the above change also prevents a deployment time error:[Jun 4, 2009 12:44:46 PM] Operation failed with error: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor[Ljava.lang.Class;@15ae0ff for org.apache.commons.logging.impl.Log4JLogger
3.1 on an Oracle Application Server 10.1.3.4.0 Manually deploying the InfoViewApp under the home ocj4 container works fine, but when deployed under its own container returns this error; [12-jun-2009 10:36:11] Binding InfoViewApp web-module for http://www.nomity.eu/error-orgapachelog4jcategory-while-deploying-bussinessobject-ix-3-1-on-an-oracle-application-server-10-1-3-4-0/ application InfoViewApp to site default-web-site under context root InfoViewApp [12-jun-2009 10:36:12] Operation failed with error: org/apache/log4j/Category As it turned out i ran into a bug reported on Metalink; Unpublished Bug 5871305 http://www.slf4j.org/codes.html : APACHE.COMMONS.LOGGING LIBRARY HAS DEPENDENCY ON LOG4J CLASSES In the OC4J class loading framework, by default, system level shared library takes precedence to that of application defined shared library. commons-logging.jar operation failed is defined as a system level shared library in OC4J. This shared library has a dependency on log4j.x.jar file which has not been properly declared. A properly defined shared library should declare and resolve all its dependencies. This error is reported in unpublished Bug 5871305 A couple of solution are possible here, * The issue will be fixed in version operation failed with 10.1.3.5.0. so wait for that * Use this workaround Remove the inherited system library "apache.commons.logging" from the application. . One of the ways of doing is this to update the application's orion-application.xml with the following lines: [code lang='xml'] [/code] Repackage the ear file with the updated orion-application.xml and deploy the application again. As both are not suitable here i would recommend to downgrade to 10.1.3.1.0 as this error would not occure on this version( i applied this option ) or deploy your app under the home container for the time being. Post navigation runInstaller Segmentation faultEMAGENT defunct spawns on an Application Server 10.1.2.0.2 3 thoughts on “error: org/apache/log4j/Category while deploying BussinessObject ix 3.1 on an Oracle Application Server 10.1.3.4.0” Sandro says: 25-06-2009 at 23:00 Thanks you!!!!!! John Lawson says: 08-07-2009 at 01:39 Thank you for this info. Additionally you can (assuming OEM console deployment) re-order the classpath precedece from Step 3 -> Configure Class Loading -> Select the check box "Search local classes first". John Paul van Helvoort says: 08-07-2009 at 07:54 Yes, you are totally right about that. Thanks
should never be called. However, depending on the deployment of commons-logging.jar files in your servlet container, release() method may be unexpectedly invoked by a copy of org.apache.commons.logging.LogFactory class shipping with commons-logging.jar. This is a relatively common occurrence with recent versions of Tomcat, especially if you place jcl-over-slf4j.jar in WEB-INF/lib directory of your web-application instead of $TOMCAT_HOME/common/lib, where $TOMCAT_HOME stands for the directory where Tomcat is installed. In order to fully benefit from the stability offered by jcl-over-slf4j.jar, we recommend that you place jcl-over-slf4j.jar in $TOMCAT_HOME/common/lib without placing a copy in your web-applications. Please also see bug #22. Operation [suchAndSuch] is not supported in jcl-over-slf4j. An UnsupportedOperationException is thrown whenever one of the protected methods introduced in JCL 1.1 are invoked. These methods are invoked by LogFactory implementations shipping with commons-logging.jar. However, the LogFactory implemented by jcl-over-slf4j.jar, namely SLF4FLogFactory, does not call any of these methods. If you observe this problem, then it is highly probable that you have a copy of commons-logging.jar in your class path overriding the classes shipping with jcl-over-slf4j.jar. Note that this issue is very similar in nature to the warning issued when the "o.a.commons.logging.impl.SLF4FLogFactory.release()" method is invoked, discussed in the previous item. Detected logger name mismatch Logger name mismatch warnings are printed only if the slf4j.detectLoggerNameMismatch system property is set to true. By default, this property is not set and no warnings will be printed even in case of a logger name mismatch. since 1.7.9 T